public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Damato <jdamato@fastly.com>
To: David Wei <dw@davidwei.uk>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH net-next v1 2/2] io_uring/zcrx: selftests: parse json from ethtool -g
Date: Mon, 28 Apr 2025 10:11:58 -0700	[thread overview]
Message-ID: <aA-23k3znQtfxebM@LQ3V64L9R2> (raw)
In-Reply-To: <20250426195525.1906774-3-dw@davidwei.uk>

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@davidwei.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@fastly.com>

  reply	other threads:[~2025-04-28 17:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-26 19:55 [PATCH net-next v1 0/2] io_uring/zcrx: selftests: more cleanups David Wei
2025-04-26 19:55 ` [PATCH net-next v1 1/2] io_uring/zcrx: selftests: use rand_port() David Wei
2025-04-28 17:11   ` Joe Damato
2025-04-26 19:55 ` [PATCH net-next v1 2/2] io_uring/zcrx: selftests: parse json from ethtool -g David Wei
2025-04-28 17:11   ` Joe Damato [this message]
2025-04-28 17:13 ` [PATCH net-next v1 0/2] io_uring/zcrx: selftests: more cleanups Joe Damato
2025-04-29 18:20 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aA-23k3znQtfxebM@LQ3V64L9R2 \
    --to=jdamato@fastly.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dw@davidwei.uk \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox