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

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