From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vlad Buslov Subject: Re: [PATCH iproute2-next] tc: flower: expose hardware offload count Date: Wed, 3 Oct 2018 16:25:00 +0000 Message-ID: References: <1538580590-4174-1-git-send-email-vladbu@mellanox.com> <9e205b2676a409c7f586f28ce1a26aa26ae119d0.camel@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "netdev@vger.kernel.org" To: Davide Caratti Return-path: Received: from mail-db5eur01on0064.outbound.protection.outlook.com ([104.47.2.64]:21280 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726811AbeJCXOJ (ORCPT ); Wed, 3 Oct 2018 19:14:09 -0400 In-Reply-To: <9e205b2676a409c7f586f28ce1a26aa26ae119d0.camel@redhat.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On Wed 03 Oct 2018 at 16:08, Davide Caratti wrote: > On Wed, 2018-10-03 at 18:29 +0300, 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_coun= t'. >>=20 >> Signed-off-by: Vlad Buslov >> Acked-by: Jiri Pirko >> --- >> tc/f_flower.c | 10 +++++++++- >> 1 file changed, 9 insertions(+), 1 deletion(-) >>=20 >> diff --git a/tc/f_flower.c b/tc/f_flower.c >> index 59e5f572c542..cbacc664d397 100644 > > hello Vlad! > >> --- a/tc/f_flower.c >> +++ b/tc/f_flower.c >> @@ -1585,8 +1585,16 @@ static int flower_print_opt(struct filter_util *q= u, FILE *f, >> if (flags & TCA_CLS_FLAGS_SKIP_SW) >> print_bool(PRINT_ANY, "skip_sw", "\n skip_sw", true); >> =20 >> - 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 =3D rta_getattr_u32(tb[TCA_FLOWER_IN_HW_COUNT]); >> + >> + print_uint(PRINT_ANY, "in_hw_count", >> + " in_hw_count %d", count); > ^^ maybe using %u in the format is better? > > thanks! Hello Davide! Sure. I'll send V2 with "%u". Thanks, Vlad