selftests: forwarding: devlink_lib: Split devlink_..._set() into save & set
authorPetr Machata <petrm@nvidia.com>
Wed, 30 Sep 2020 10:49:07 +0000 (12:49 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Sep 2020 21:06:54 +0000 (14:06 -0700)
commit6e0972e0c5d8f78b64274fd1a512136aee404610
treee8c0d47d50569cce45e77da4c6b02dbac5f9f03b
parent611ba7536e7ecb58f766b1315a2f9ef4b10b3572
selftests: forwarding: devlink_lib: Split devlink_..._set() into save & set

Changing pool type from static to dynamic causes reinterpretation of
threshold values. They therefore need to be saved before pool type is
changed, then the pool type can be changed, and then the new values need
to be set up.

For that reason, set cannot subsume save, because it would be saving the
wrong thing, with possibly a nonsensical value, and restore would then fail
to restore the nonsensical value.

Thus extract a _save() from each of the relevant _set()'s. This way it is
possible to save everything up front, then to tweak it, and then restore in
the required order.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/drivers/net/mlxsw/qos_ets_strict.sh
tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh
tools/testing/selftests/drivers/net/mlxsw/sch_ets.sh
tools/testing/selftests/drivers/net/mlxsw/sch_red_core.sh
tools/testing/selftests/net/forwarding/devlink_lib.sh