From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vlad Buslov Subject: [PATCH iproute2-next] tc: flower: expose hardware offload count Date: Wed, 3 Oct 2018 18:29:50 +0300 Message-ID: <1538580590-4174-1-git-send-email-vladbu@mellanox.com> Cc: Vlad Buslov To: netdev@vger.kernel.org Return-path: Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:47334 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726892AbeJCWSu (ORCPT ); Wed, 3 Oct 2018 18:18:50 -0400 Sender: netdev-owner@vger.kernel.org List-ID: 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 Acked-by: Jiri Pirko --- 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..cbacc664d397 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 %d", 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