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 - 09:49:08 EST


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?

> That gives here, mean of 3 rounds:
>
> off v2
> TCP, 4 streams, Gb/s 56.1 89.8 +60%
> RX CPU cycles/packet 1172 664 -43%
> TCP, 1 stream, Gb/s 50.4 49.5
> RX CPU cycles/packet 1176 663 -44%
>
> With 4 streams and no prefetch the RX CPU is saturated and drops (about
> 10 million TCP retransmits per 20 s run, 130 thousand with v2). A single
> stream stays at about 50 Gb/s either way, so there the gain shows only
> as RX CPU time.
>
> I can share the scripts I used for both if they help.
>
Yes, this would be useful. I took your kernel and still can't see the
added benefit.
> Ah, one last note: for convenience I run my tests on a single host, with
> the two ports of the CX5 connected to each other and two netns that set
> them apart (but as long as you have enough cores, this shouldn't make a
> difference for us).
>
That's also how I am testing it.

Thanks,
Dragos