Subject: Re: [PATCH bpf-next V1] igc: enable and fix RX hash usage by netstack

From: Alexander Lobakin <[email-masked]>
Date: Mon, 27 Feb 2023 15:24:30 +0100

From: Alexander Lobakin <[email-masked]>
Date: Fri, 24 Feb 2023 17:41:58 +0100

> From: Jesper Dangaard Brouer <[email-masked]>
> Date: Wed, 22 Feb 2023 16:00:30 +0100

[...]

>>>>> Why define those empty if you could do a bound check in the code
>>>>> instead? E.g. `if (unlikely(bigger_than_9)) return PKT_HASH_TYPE_L2`.
>>>>
>>>> Having a branch for this is likely slower.  On godbolt I see that this
>>>> generates suboptimal and larger code.

BTW, it's funny that when I proposed an optimization, you said "it makes
no sense on 2.5G NICs", but when you omit bounds checking and just
extend the array with zero fields, it suddenly starts making sense to
save a couple instructions :D

(just an observation)

>>>
>>> But you have to verify HW output anyway, right? Or would like to rely on
>>> that on some weird revision it won't spit BIT(69) on you?
[...]

Thanks,
Olek