[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aA-23k3znQtfxebM@LQ3V64L9R2>
Date: Mon, 28 Apr 2025 10:11:58 -0700
From: Joe Damato <jdamato@...tly.com>
To: David Wei <dw@...idwei.uk>
Cc: netdev@...r.kernel.org, Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net-next v1 2/2] io_uring/zcrx: selftests: parse json
from ethtool -g
On Sat, Apr 26, 2025 at 12:55:25PM -0700, David Wei wrote:
> Parse JSON from ethtool -g instead of parsing text output.
>
> Signed-off-by: David Wei <dw@...idwei.uk>
> ---
> tools/testing/selftests/drivers/net/hw/iou-zcrx.py | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/tools/testing/selftests/drivers/net/hw/iou-zcrx.py b/tools/testing/selftests/drivers/net/hw/iou-zcrx.py
> index 3962bf002ab6..5b2770cacd39 100755
> --- a/tools/testing/selftests/drivers/net/hw/iou-zcrx.py
> +++ b/tools/testing/selftests/drivers/net/hw/iou-zcrx.py
> @@ -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'])
Thanks for doing this.
Reviewed-by: Joe Damato <jdamato@...tly.com>
Powered by blists - more mailing lists