Blame SOURCES/0027-tc-Reflect-HW-offload-status.patch

cd1737
From 724d67b36f9e6bbbfac88b29fee019c05284a888 Mon Sep 17 00:00:00 2001
cd1737
From: Kamal Heib <kheib@redhat.com>
cd1737
Date: Thu, 9 Nov 2017 04:44:32 -0500
cd1737
Subject: [PATCH] tc: Reflect HW offload status
cd1737
cd1737
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1456539
cd1737
cd1737
commit e57285b81a098ed705d683ce94f9abd1cc53438a
cd1737
Author: Or Gerlitz <ogerlitz@mellanox.com>
cd1737
Date:   Thu May 4 16:15:15 2017 +0300
cd1737
cd1737
    tc: Reflect HW offload status
cd1737
cd1737
    Currently there is no way of querying whether a filter is
cd1737
    offloaded to HW or not when using "both" policy (where none
cd1737
    of skip_sw or skip_hw flags are set by user-space).
cd1737
cd1737
    Add two new flags, "in hw" and "not in hw" such that user
cd1737
    space can determine if a filter is actually offloaded to
cd1737
    hw or not. The "in hw" UAPI semantics was chosen so it's
cd1737
    similar to the "skip hw" flag logic.
cd1737
cd1737
    If none of these two flags are set, this signals running
cd1737
    over older kernel.
cd1737
cd1737
    Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
cd1737
    Reviewed-by: Jiri Pirko <jiri@mellanox.com>
cd1737
    Reviewed-by: Simon Horman <simon.horman@netronome.com>
cd1737
cd1737
Signed-off-by: Kamal Heib <kheib@redhat.com>
cd1737
---
cd1737
 tc/f_bpf.c      | 5 +++++
cd1737
 tc/f_flower.c   | 5 +++++
cd1737
 tc/f_matchall.c | 5 +++++
cd1737
 tc/f_u32.c      | 5 +++++
cd1737
 4 files changed, 20 insertions(+)
cd1737
cd1737
diff --git a/tc/f_bpf.c b/tc/f_bpf.c
cd1737
index df8a259..75c44c0 100644
cd1737
--- a/tc/f_bpf.c
cd1737
+++ b/tc/f_bpf.c
cd1737
@@ -210,6 +210,11 @@ static int bpf_print_opt(struct filter_util *qu, FILE *f,
cd1737
 			fprintf(f, "skip_hw ");
cd1737
 		if (flags & TCA_CLS_FLAGS_SKIP_SW)
cd1737
 			fprintf(f, "skip_sw ");
cd1737
+
cd1737
+		if (flags & TCA_CLS_FLAGS_IN_HW)
cd1737
+			fprintf(f, "in_hw ");
cd1737
+		else if (flags & TCA_CLS_FLAGS_NOT_IN_HW)
cd1737
+			fprintf(f, "not_in_hw ");
cd1737
 	}
cd1737
 
cd1737
 	if (tb[TCA_BPF_OPS] && tb[TCA_BPF_OPS_LEN])
cd1737
diff --git a/tc/f_flower.c b/tc/f_flower.c
cd1737
index 5aac4a0..ebc63ca 100644
cd1737
--- a/tc/f_flower.c
cd1737
+++ b/tc/f_flower.c
cd1737
@@ -1171,6 +1171,11 @@ static int flower_print_opt(struct filter_util *qu, FILE *f,
cd1737
 			fprintf(f, "\n  skip_hw");
cd1737
 		if (flags & TCA_CLS_FLAGS_SKIP_SW)
cd1737
 			fprintf(f, "\n  skip_sw");
cd1737
+
cd1737
+		if (flags & TCA_CLS_FLAGS_IN_HW)
cd1737
+			fprintf(f, "\n  in_hw");
cd1737
+		else if (flags & TCA_CLS_FLAGS_NOT_IN_HW)
cd1737
+			fprintf(f, "\n  not_in_hw");
cd1737
 	}
cd1737
 
cd1737
 	if (tb[TCA_FLOWER_ACT])
cd1737
diff --git a/tc/f_matchall.c b/tc/f_matchall.c
cd1737
index ac48630..5a51e75 100644
cd1737
--- a/tc/f_matchall.c
cd1737
+++ b/tc/f_matchall.c
cd1737
@@ -137,6 +137,11 @@ static int matchall_print_opt(struct filter_util *qu, FILE *f,
cd1737
 			fprintf(f, "\n  skip_hw");
cd1737
 		if (flags & TCA_CLS_FLAGS_SKIP_SW)
cd1737
 			fprintf(f, "\n  skip_sw");
cd1737
+
cd1737
+		if (flags & TCA_CLS_FLAGS_IN_HW)
cd1737
+			fprintf(f, "\n  in_hw");
cd1737
+		else if (flags & TCA_CLS_FLAGS_NOT_IN_HW)
cd1737
+			fprintf(f, "\n  not_in_hw");
cd1737
 	}
cd1737
 
cd1737
 	if (tb[TCA_MATCHALL_ACT])
cd1737
diff --git a/tc/f_u32.c b/tc/f_u32.c
cd1737
index 92c1fcd..ff700e9 100644
cd1737
--- a/tc/f_u32.c
cd1737
+++ b/tc/f_u32.c
cd1737
@@ -1264,6 +1264,11 @@ static int u32_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt,
cd1737
 			fprintf(f, "skip_hw ");
cd1737
 		if (flags & TCA_CLS_FLAGS_SKIP_SW)
cd1737
 			fprintf(f, "skip_sw ");
cd1737
+
cd1737
+		if (flags & TCA_CLS_FLAGS_IN_HW)
cd1737
+			fprintf(f, "in_hw ");
cd1737
+		else if (flags & TCA_CLS_FLAGS_NOT_IN_HW)
cd1737
+			fprintf(f, "not_in_hw ");
cd1737
 	}
cd1737
 
cd1737
 	if (tb[TCA_U32_PCNT]) {
cd1737
-- 
cd1737
1.8.3.1
cd1737