* [PATCH iproute2-next] tc: flower: expose hardware offload count
@ 2018-10-03 15:29 Vlad Buslov
2018-10-03 16:08 ` Davide Caratti
0 siblings, 1 reply; 3+ messages in thread
From: Vlad Buslov @ 2018-10-03 15:29 UTC (permalink / raw)
To: netdev; +Cc: Vlad Buslov
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 | 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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH iproute2-next] tc: flower: expose hardware offload count
2018-10-03 15:29 [PATCH iproute2-next] tc: flower: expose hardware offload count Vlad Buslov
@ 2018-10-03 16:08 ` Davide Caratti
2018-10-03 16:25 ` Vlad Buslov
0 siblings, 1 reply; 3+ messages in thread
From: Davide Caratti @ 2018-10-03 16:08 UTC (permalink / raw)
To: Vlad Buslov, netdev
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_count'.
>
> Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
> Acked-by: Jiri Pirko <jiri@mellanox.com>
> ---
> 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
hello Vlad!
> --- 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);
^^ maybe using %u in the format is better?
thanks!
--
davide
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH iproute2-next] tc: flower: expose hardware offload count
2018-10-03 16:08 ` Davide Caratti
@ 2018-10-03 16:25 ` Vlad Buslov
0 siblings, 0 replies; 3+ messages in thread
From: Vlad Buslov @ 2018-10-03 16:25 UTC (permalink / raw)
To: Davide Caratti; +Cc: netdev
On Wed 03 Oct 2018 at 16:08, Davide Caratti <dcaratti@redhat.com> 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_count'.
>>
>> Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
>> Acked-by: Jiri Pirko <jiri@mellanox.com>
>> ---
>> 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
>
> hello Vlad!
>
>> --- 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);
> ^^ maybe using %u in the format is better?
>
> thanks!
Hello Davide!
Sure. I'll send V2 with "%u".
Thanks,
Vlad
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-03 23:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-03 15:29 [PATCH iproute2-next] tc: flower: expose hardware offload count Vlad Buslov
2018-10-03 16:08 ` Davide Caratti
2018-10-03 16:25 ` Vlad Buslov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.