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