From: Dimitri Daskalakis <redacted>
_hds_reset() only restores tcp-data-split if the reported value
changed. Drivers may report the current HDS state rather than the
configured value, so an explicit setting made by a test can be
indistinguishable from the original "unknown" config.
bnxt reports enabled or disabled based on whether aggregation rings
are in use. mlx5 will report enabled or disabled based on whether
SHAMPO is active, and an explicit "disabled" keeps HW-GRO off. After
set_hds_disable on a default mlx5 device the reset is skipped, leaving
tcp-data-split disabled and HW-GRO unable to be enabled.
Always reset tcp-data-split to "unknown" when it was reported.
Signed-off-by: Dimitri Daskalakis <redacted>
---
tools/testing/selftests/drivers/net/hds.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/drivers/net/hds.py b/tools/testing/selftests/drivers/net/hds.py
index 606e26d75951..af34dc9ce749 100755
--- a/tools/testing/selftests/drivers/net/hds.py
+++ b/tools/testing/selftests/drivers/net/hds.py
@@ -65,13 +65,13 @@ def _hds_reset(cfg, netnl, rings) -> None:
cur = netnl.rings_get({'header': {'dev-index': cfg.ifindex}})
arg = {'header': {'dev-index': cfg.ifindex}}
- if cur.get('tcp-data-split') != rings.get('tcp-data-split'):
+ if 'tcp-data-split' in rings:
# Try to reset to "unknown" first, we don't know if the setting
# was the default or user chose it. Default seems more likely.
arg['tcp-data-split'] = "unknown"
netnl.rings_set(arg)
cur = netnl.rings_get({'header': {'dev-index': cfg.ifindex}})
- if cur['tcp-data-split'] == rings['tcp-data-split']:
+ if cur.get('tcp-data-split') == rings['tcp-data-split']:
del arg['tcp-data-split']
else:
# Try the explicit setting--
2.52.0