[PATCH iproute2-next v2] tc: flower: expose hardware offload count

Subsystems: the rest

STALE2908d REVIEWED: 1 (0M)

1 review trailer.

2 messages, 2 authors, 2018-10-08 · open the first message on its own page

[PATCH iproute2-next v2] tc: flower: expose hardware offload count

From: Vlad Buslov <hidden>
Date: 2018-10-04 03:34:56

Recently flower classifier was updated to expose count of devices that
filter is offloaded to. Add support to print this counter as 'in_hw_count'.

Signed-off-by: Vlad Buslov <redacted>
Acked-by: Jiri Pirko <redacted>
---
Changes from V1 to V2:
- Change print format string to "%u"

 tc/f_flower.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/tc/f_flower.c b/tc/f_flower.c
index 59e5f572c542..ab7ea3e32f69 100644
--- a/tc/f_flower.c
+++ b/tc/f_flower.c
@@ -1585,8 +1585,16 @@ static int flower_print_opt(struct filter_util *qu, FILE *f,
 		if (flags & TCA_CLS_FLAGS_SKIP_SW)
 			print_bool(PRINT_ANY, "skip_sw", "\n  skip_sw", true);
 
-		if (flags & TCA_CLS_FLAGS_IN_HW)
+		if (flags & TCA_CLS_FLAGS_IN_HW) {
 			print_bool(PRINT_ANY, "in_hw", "\n  in_hw", true);
+
+			if (tb[TCA_FLOWER_IN_HW_COUNT]) {
+				__u32 count = rta_getattr_u32(tb[TCA_FLOWER_IN_HW_COUNT]);
+
+				print_uint(PRINT_ANY, "in_hw_count",
+					   " in_hw_count %u", count);
+			}
+		}
 		else if (flags & TCA_CLS_FLAGS_NOT_IN_HW)
 			print_bool(PRINT_ANY, "not_in_hw", "\n  not_in_hw", true);
 	}
-- 
2.7.5

Re: [PATCH iproute2-next v2] tc: flower: expose hardware offload count

From: David Ahern <hidden>
Date: 2018-10-08 00:23:15

On 10/3/18 2:44 PM, Vlad Buslov wrote:
Recently flower classifier was updated to expose count of devices that
filter is offloaded to. Add support to print this counter as 'in_hw_count'.

Signed-off-by: Vlad Buslov <redacted>
Acked-by: Jiri Pirko <redacted>
---
Changes from V1 to V2:
- Change print format string to "%u"

 tc/f_flower.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
applied to iproute2-next. Thanks
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help