[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c8389982-026a-451f-82c3-0503ecd2f7e4@davidwei.uk>
Date: Sat, 26 Apr 2025 11:00:38 -0700
From: David Wei <dw@...idwei.uk>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Joe Damato <jdamato@...tly.com>, netdev@...r.kernel.org,
Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net-next v1 2/3] io_uring/zcrx: selftests: set hds_thresh
to 0
On 4/25/25 18:42, Jakub Kicinski wrote:
> On Fri, 25 Apr 2025 16:37:26 -0700 David Wei wrote:
>>>> -def _get_rx_ring_entries(cfg):
>>>> +def _get_current_settings(cfg):
>>>> output = ethtool(f"-g {cfg.ifname}", host=cfg.remote).stdout
>>>> - values = re.findall(r'RX:\s+(\d+)', output)
>>>> - return int(values[1])
>>>> + 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]))
>>>
>>> Makes me wonder if both of these values can be parsed from ethtool
>>> JSON output instead of regexing the "regular" output. No reason in
>>> particular; just vaguely feels like parsing JSON is safer somehow.
>>
>> Yeah I agree. JSON output isn't available for these ethtool commands as
>> support for that is quite patchy. If/once there is JSON output I'd be up
>> for switching to that.
>
> Joe is right, gor -g JSON is there, IIRC the only one we use often that
> doesn't have JSON is -l. You could also switch to YNL directly, fewer
> dependencies. But probably not a blocker for this series.
>
Oh, sorry. I'll change to parsing --json output too.
Powered by blists - more mailing lists