mbox series

[net-next,0/3] Implement stats_update callback for pedit and skbedit

Message ID cover.1585255467.git.petrm@mellanox.com
Headers show
Series Implement stats_update callback for pedit and skbedit | expand

Message

Petr Machata March 26, 2020, 8:45 p.m. UTC
The stats_update callback is used for adding HW counters to the SW ones.
Both skbedit and pedit actions are actually recognized by flow_offload.h,
but do not implement these callbacks. As a consequence, the reported values
are only the SW ones, even where there is a HW counter available.

Patch #1 adds the callback to action skbedit, patch #2 adds it to action
pedit. Patch #3 tweaks an skbedit selftest with a check that would have
caught this problem.

The pedit test is not likewise tweaked, because the iproute2 pedit action
currently does not support JSON dumping. This will be addressed later.

Petr Machata (3):
  sched: act_skbedit: Implement stats_update callback
  sched: act_pedit: Implement stats_update callback
  selftests: skbedit_priority: Test counters at the skbedit rule

 net/sched/act_pedit.c                                 | 11 +++++++++++
 net/sched/act_skbedit.c                               | 11 +++++++++++
 .../selftests/net/forwarding/skbedit_priority.sh      |  9 +++++++--
 3 files changed, 29 insertions(+), 2 deletions(-)

Comments

Alexander Petrovskiy March 27, 2020, 12:01 a.m. UTC | #1
On 26.03.2020, 23:46, "Petr Machata" <petrm@mellanox.com> wrote:

>The stats_update callback is used for adding HW counters to the SW ones.
>Both skbedit and pedit actions are actually recognized by flow_offload.h,
>but do not implement these callbacks. As a consequence, the reported values
>are only the SW ones, even where there is a HW counter available.
>
>Patch #1 adds the callback to action skbedit, patch #2 adds it to action
>pedit. Patch #3 tweaks an skbedit selftest with a check that would have
>caught this problem.
>
>The pedit test is not likewise tweaked, because the iproute2 pedit action
>currently does not support JSON dumping. This will be addressed later.
>
>Petr Machata (3):
>  sched: act_skbedit: Implement stats_update callback
>  sched: act_pedit: Implement stats_update callback
>  selftests: skbedit_priority: Test counters at the skbedit rule
>
> net/sched/act_pedit.c                                 | 11 +++++++++++
> net/sched/act_skbedit.c                               | 11 +++++++++++
> .../selftests/net/forwarding/skbedit_priority.sh      |  9 +++++++--
> 3 files changed, 29 insertions(+), 2 deletions(-)
>
>-- 
>2.20.1

Tested-by: Alexander Petrovskiy <alexpe@mellanox.com>
David Miller March 27, 2020, 2:20 a.m. UTC | #2
From: Petr Machata <petrm@mellanox.com>
Date: Thu, 26 Mar 2020 22:45:54 +0200

> The stats_update callback is used for adding HW counters to the SW ones.
> Both skbedit and pedit actions are actually recognized by flow_offload.h,
> but do not implement these callbacks. As a consequence, the reported values
> are only the SW ones, even where there is a HW counter available.
> 
> Patch #1 adds the callback to action skbedit, patch #2 adds it to action
> pedit. Patch #3 tweaks an skbedit selftest with a check that would have
> caught this problem.
> 
> The pedit test is not likewise tweaked, because the iproute2 pedit action
> currently does not support JSON dumping. This will be addressed later.

Series applied, thanks Petr.