]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: flower: expose hardware offload count
authorVlad Buslov <vladbu@mellanox.com>
Wed, 3 Oct 2018 20:44:48 +0000 (23:44 +0300)
committerDavid Ahern <dsahern@gmail.com>
Sun, 7 Oct 2018 17:14:09 +0000 (10:14 -0700)
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 <vladbu@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
tc/f_flower.c

index 4a8fb984a35adabd408e1f6ed03e21c84bc01f1e..65fca04303bad63783f66a4279d3a51ed76a60e6 100644 (file)
@@ -1867,8 +1867,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);
        }