Subject: Re: [PATCH net 8/9] selftests: drv-net: pp_alloc_fail: lower traffic expectations

From: Simon Horman <[email-masked]>
Date: Sat, 4 Oct 2025 17:44:05 +0100

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 <[email-masked]>