Subject: Re: [PATCH net 5/5] selftests: drv-net: rss_ctx: check for all-zero keys

From: Petr Machata <[email-masked]>
Date: Fri, 26 Jul 2024 13:25:06 +0200

Jakub Kicinski <[email-masked]> writes:

> We had a handful of bugs relating to key being either all 0
> or just reported incorrectly as all 0. Check for this in
> the tests.
>
> Signed-off-by: Jakub Kicinski <[email-masked]>

Reviewed-by: Petr Machata <[email-masked]>

> +def _rss_key_check(cfg, data=None, context=0):
> +    if data is None:
> +        data = get_rss(cfg, context=context)
> +    if 'rss-hash-key' not in data:
> +        return
> +    non_zero = [x for x in data['rss-hash-key'] if x != 0]
> +    ksft_eq(bool(non_zero), True, comment=f"RSS key is all zero {data['rss-hash-key']}")

If there's a v2, consider changing this to len(non_zero) > 0, or
non_zero != [].