mbox series

[net-next,0/4] selftests: Use busywait() in a couple places

Message ID cover.1583170249.git.petrm@mellanox.com
Headers show
Series selftests: Use busywait() in a couple places | expand

Message

Petr Machata March 2, 2020, 5:56 p.m. UTC
From: Petr Machata <petrm@mellanox.com>

Two helper function for active waiting for an event were recently
introduced: busywait() as the active-waiting tool, and until_counter_is()
as a configurable predicate that can be plugged into busywait(). Use these
in tc_common and mlxsw's qos_defprio instead of hand-coding equivalents.

Patches #1 and #2 extend lib.sh facilities to make the transition possible.
Patch #3 converts tc_common, and patch #4 qos_defprio.

Petr Machata (4):
  selftests: forwarding: lib: Add tc_rule_handle_stats_get()
  selftests: forwarding: Convert until_counter_is() to take expression
  selftests: forwarding: tc_common: Convert to use busywait
  selftests: mlxsw: qos_defprio: Use until_counter_is

 .../drivers/net/mlxsw/qos_defprio.sh          | 18 +++--------
 .../drivers/net/mlxsw/sch_red_core.sh         |  6 ++--
 tools/testing/selftests/net/forwarding/lib.sh | 17 ++++++++--
 .../selftests/net/forwarding/tc_common.sh     | 32 +++----------------
 4 files changed, 25 insertions(+), 48 deletions(-)

Comments

David Miller March 4, 2020, 1:04 a.m. UTC | #1
From: Petr Machata <me@pmachata.org>
Date: Mon,  2 Mar 2020 19:56:01 +0200

> From: Petr Machata <petrm@mellanox.com>
> 
> Two helper function for active waiting for an event were recently
> introduced: busywait() as the active-waiting tool, and until_counter_is()
> as a configurable predicate that can be plugged into busywait(). Use these
> in tc_common and mlxsw's qos_defprio instead of hand-coding equivalents.
> 
> Patches #1 and #2 extend lib.sh facilities to make the transition possible.
> Patch #3 converts tc_common, and patch #4 qos_defprio.

Series applied, thanks.