[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251004164405.GE3060232@horms.kernel.org>
Date: Sat, 4 Oct 2025 17:44:05 +0100
From: Simon Horman <horms@...nel.org>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
pabeni@...hat.com, andrew+netdev@...n.ch, bpf@...r.kernel.org,
shuah@...nel.org, johndale@...co.com,
linux-kselftest@...r.kernel.org
Subject: Re: [PATCH net 8/9] selftests: drv-net: pp_alloc_fail: lower traffic
expectations
On Fri, Oct 03, 2025 at 04:30:24PM -0700, Jakub Kicinski wrote:
...
> @@ -91,9 +92,14 @@ from lib.py import cmd, tool, GenerateTraffic
>
> if s2['rx-alloc-fail'] - s1['rx-alloc-fail'] < 1:
> raise KsftSkipEx("Allocation failures not increasing")
> - if s2['rx-alloc-fail'] - s1['rx-alloc-fail'] < 100:
> - raise KsftSkipEx("Allocation increasing too slowly", s2['rx-alloc-fail'] - s1['rx-alloc-fail'],
> - "packets:", s2['rx-packets'] - s1['rx-packets'])
> + pkts = s2['rx-packets'] - s1['rx-packets']
> + # Expecting one failure per 512 buffers, 3.1x safety margin
> + want_fails = math.floor(pkts / 512 / 3.1)
> + seen_fails = s2['rx-alloc-fail'] - s1['rx-alloc-fail']
> + if s2['rx-alloc-fail'] - s1['rx-alloc-fail'] < want_fails:
I guess this could be as follows.
(Completely untested!)
if seen_fails < want_fails:
> + raise KsftSkipEx("Allocation increasing too slowly", seen_fails,
> + "packets:", pkts)
> + ksft_pr(f"Seen: pkts:{pkts} fails:{seen_fails} (pass thrs:{want_fails})")
>
> # Basic failures are fine, try to wobble some settings to catch extra failures
> check_traffic_flowing()
The nit above withstanding, this looks good to me.
Reviewed-by: Simon Horman <horms@...nel.org>
Powered by blists - more mailing lists