Commit 6fbb4d3f authored by David Wei's avatar David Wei Committed by Jakub Kicinski
Browse files

io_uring/zcrx: selftests: parse json from ethtool -g



Parse JSON from ethtool -g instead of parsing text output.

Signed-off-by: default avatarDavid Wei <dw@davidwei.uk>
Reviewed-by: default avatarJoe Damato <jdamato@fastly.com>
Link: https://patch.msgid.link/20250426195525.1906774-3-dw@davidwei.uk


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 187e0216
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -9,10 +9,8 @@ from lib.py import bkg, cmd, defer, ethtool, rand_port, wait_port_listen


def _get_current_settings(cfg):
    output = ethtool(f"-g {cfg.ifname}", host=cfg.remote).stdout
    rx_ring = re.findall(r'RX:\s+(\d+)', output)
    hds_thresh = re.findall(r'HDS thresh:\s+(\d+)', output)
    return (int(rx_ring[1]), int(hds_thresh[1]))
    output = ethtool(f"-g {cfg.ifname}", json=True, host=cfg.remote)[0]
    return (output['rx'], output['hds-thresh'])


def _get_combined_channels(cfg):