Skip to content

Commit 4ce3ade

Browse files
spikehkuba-moo
authored andcommitted
io_uring/zcrx: selftests: set hds_thresh to 0
Setting hds_thresh to 0 is required for queue reset. Signed-off-by: David Wei <dw@davidwei.uk> Reviewed-by: Simon Horman <horms@kernel.org> Reviewed-by: Joe Damato <jdamato@fastly.com> Link: https://patch.msgid.link/20250425022049.3474590-3-dw@davidwei.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 43fd005 commit 4ce3ade

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tools/testing/selftests/drivers/net/hw/iou-zcrx.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
from lib.py import bkg, cmd, defer, ethtool, wait_port_listen
99

1010

11-
def _get_rx_ring_entries(cfg):
11+
def _get_current_settings(cfg):
1212
output = ethtool(f"-g {cfg.ifname}", host=cfg.remote).stdout
13-
values = re.findall(r'RX:\s+(\d+)', output)
14-
return int(values[1])
13+
rx_ring = re.findall(r'RX:\s+(\d+)', output)
14+
hds_thresh = re.findall(r'HDS thresh:\s+(\d+)', output)
15+
return (int(rx_ring[1]), int(hds_thresh[1]))
1516

1617

1718
def _get_combined_channels(cfg):
@@ -32,11 +33,12 @@ def test_zcrx(cfg) -> None:
3233
combined_chans = _get_combined_channels(cfg)
3334
if combined_chans < 2:
3435
raise KsftSkipEx('at least 2 combined channels required')
35-
rx_ring = _get_rx_ring_entries(cfg)
36-
36+
(rx_ring, hds_thresh) = _get_current_settings(cfg)
3737

3838
ethtool(f"-G {cfg.ifname} tcp-data-split on", host=cfg.remote)
3939
defer(ethtool, f"-G {cfg.ifname} tcp-data-split auto", host=cfg.remote)
40+
ethtool(f"-G {cfg.ifname} hds-thresh 0", host=cfg.remote)
41+
defer(ethtool, f"-G {cfg.ifname} hds-thresh {hds_thresh}", host=cfg.remote)
4042
ethtool(f"-G {cfg.ifname} rx 64", host=cfg.remote)
4143
defer(ethtool, f"-G {cfg.ifname} rx {rx_ring}", host=cfg.remote)
4244
ethtool(f"-X {cfg.ifname} equal {combined_chans - 1}", host=cfg.remote)
@@ -57,10 +59,12 @@ def test_zcrx_oneshot(cfg) -> None:
5759
combined_chans = _get_combined_channels(cfg)
5860
if combined_chans < 2:
5961
raise KsftSkipEx('at least 2 combined channels required')
60-
rx_ring = _get_rx_ring_entries(cfg)
62+
(rx_ring, hds_thresh) = _get_current_settings(cfg)
6163

6264
ethtool(f"-G {cfg.ifname} tcp-data-split on", host=cfg.remote)
6365
defer(ethtool, f"-G {cfg.ifname} tcp-data-split auto", host=cfg.remote)
66+
ethtool(f"-G {cfg.ifname} hds-thresh 0", host=cfg.remote)
67+
defer(ethtool, f"-G {cfg.ifname} hds-thresh {hds_thresh}", host=cfg.remote)
6468
ethtool(f"-G {cfg.ifname} rx 64", host=cfg.remote)
6569
defer(ethtool, f"-G {cfg.ifname} rx {rx_ring}", host=cfg.remote)
6670
ethtool(f"-X {cfg.ifname} equal {combined_chans - 1}", host=cfg.remote)

0 commit comments

Comments
 (0)