Re: [PATCH net-next v2] net/mlx5e: Prefetch the packet a few strides ahead in the linear MPWQE path

From: Dragos Tatulea

Date: Wed Dec 02 2026 - 14:32:04 EST


On 02.12.26 15:48, Dragos Tatulea wrote:
> Hi Antonio,
>
> On 01.12.26 15:11, Antonio Quartulli wrote:
>> Hi Dragos,
>>
>> On 01/12/2026 12:20, Dragos Tatulea wrote:
>>> I was trying to reproduce this and am not able to see such a large diff.
>>> Any steps on how to reproduce this?
>>>
>>> I ran 3 ovpn tunnels over a single queue, one TCP stream per queue and
>>> was a very small diff.
>>
>> Thanks a lot for trying ovpn out :-)
>> I re-measured today and found why: my numbers were taken with the ovpn
>> code we are working on, not with the ovpn in net-next, and the two
>> behave very differently herei (we are testing GRO/GSO and other
>> techniques to squeeze every single Bps out of it!).
>>
>> Same setup as before (Ryzen 9 9950X, ConnectX-5, MTU 1500, stock ring
>> and coalescing, one RX queue with its IRQ on a dedicated CPU, AES-GCM,
>> mean of 3 rounds), Gb/s:
>>
>> off v2 v2 w/o shinfo
>> net-next ovpn, 1 tunnel 17.8 17.9 17.9
>> net-next ovpn, 3 tunnels 18.0 20.5 19.7
>> ovpn perf branch, 1 tunnel 33.0 44.9 37.5
>> ovpn perf branch, 3 tunnels 30.8 41.3 38.1
>>
>> ("3 tunnels" is your layout: 3 tunnels over a single queue, one TCP
>> stream each.)
>>
>> With the net-next ovpn the sender is the bottleneck: without GSO, every
>> packet is encrypted in the sending application's context, which caps a
>> tunnel at about 18 Gb/s. The receiver gets cheaper with v2, but that
>> doesn't show as throughput. That's the small difference you saw.
>>
>> Our perf branch adds UDP GSO/GRO batching to ovpn (Ralf Lici's series on
>> openvpn-devel) and other RX/TX work, which makes the receiving CPU the
>> bottleneck. There v2 gives +34-36%, also with your layout. The
>> skb_shared_info line is worth +20% of that with one tunnel and +8% with
>> three; my earlier "+4-5% without it" came from an older version of our
>> GRO code and is outdated.
>>
>> If you want to try it: the branch is antonio/ovpn-perf-next at
>> https://github.com/mandelbitdev/ovpn-net-next (4a8182fa1798). It needs
>> its own kernel (it changes UDP GRO too); the tunnels can be set up with
>> the ovpn-cli of its selftests.
>>
>> The quickest way to see the throughput effect without ovpn is plain TCP
>> with several flows on one RX queue, the application on another CPU:
>>
>> receiver: ethtool -L <if> combined 1
>> echo <cpuA> > /proc/irq/<mlx5_comp0 IRQ>/smp_affinity_list
>> taskset -c <cpuB> iperf3 -s
>> sender: iperf3 -c <receiver> -P 4 -t 20
>>
> Is cpuB on same L3 cache domain with cpuB?
>
Answering my own question: it's a different one. Now I see the case
where the shinfo prefetch works with your WIP kernel:

┌─────────────────────────────────────┬───────┬───────┬───────┬────────────┬───────────┐
│ iperf3 servers │ base │ v2 │ noS │ v2 vs base │ noS vs v2 │
├─────────────────────────────────────┼───────┼───────┼───────┼────────────┼───────────┤
│ cpuB same L3 as cpuA │ 25.62 │ 30.88 │ 31.07 │ +20.5% │ +0.6% │
├─────────────────────────────────────┼───────┼───────┼───────┼────────────┼───────────┤
│ cpuB other L3 than cpuA (same NUMA) │ 19.48 │ 24.04 │ 19.78 │ +23.4% │ -17.7% * │
└─────────────────────────────────────┴───────┴───────┴───────┴────────────┴───────────┘

The noS (no shinfo prefetch) vs v2 (your patch) shows that a lot of perf
is lost in that specific case without the prefetch.

>From my end, finally:
Reviewed-by: Dragos Tatulea <dtatulea@xxxxxxxxxx>

Thanks for this great patch!

Thanks,
Dragos