Re: [RFC 2/2] xdp: Delegate fast path return decision to page_pool

From: Dragos Tatulea
Date: Mon Dec 01 2025 - 05:13:26 EST




[...]
>> And then you can run thus command:
>> sudo ./xdp-bench redirect-map --load-egress mlx5p1 mlx5p1
>>
> Ah, yes! I was ignorant about the egress part of the program.
> That did the trick. The drop happens before reaching the tx
> queue of the second netdev and the mentioned code in devmem.c
> is reached.
>
> Sender is xdp-trafficgen with 3 threads pushing enough on one RX queue
> to saturate the CPU.
>
> Here's what I got:
>
> * before:
>
> eth2->eth3 16,153,328 rx/s 16,153,329 err,drop/s 0 xmit/s
> xmit eth2->eth3 0 xmit/s 16,153,329 drop/s 0 drv_err/s 16.00 bulk-avg
> eth2->eth3 16,152,538 rx/s 16,152,546 err,drop/s 0 xmit/s
> xmit eth2->eth3 0 xmit/s 16,152,546 drop/s 0 drv_err/s 16.00 bulk-avg
> eth2->eth3 16,156,331 rx/s 16,156,337 err,drop/s 0 xmit/s
> xmit eth2->eth3 0 xmit/s 16,156,337 drop/s 0 drv_err/s 16.00 bulk-avg
>
> * after:
>
> eth2->eth3 16,105,461 rx/s 16,105,469 err,drop/s 0 xmit/s
> xmit eth2->eth3 0 xmit/s 16,105,469 drop/s 0 drv_err/s 16.00 bulk-avg
> eth2->eth3 16,119,550 rx/s 16,119,541 err,drop/s 0 xmit/s
> xmit eth2->eth3 0 xmit/s 16,119,541 drop/s 0 drv_err/s 16.00 bulk-avg
> eth2->eth3 16,092,145 rx/s 16,092,154 err,drop/s 0 xmit/s
> xmit eth2->eth3 0 xmit/s 16,092,154 drop/s 0 drv_err/s 16.00 bulk-avg
>
> So slightly worse... I don't fully trust the measurements though as I
> saw the inverse situation in other tests as well: higher rate after the
> patch.
I had a chance to re-run this on a more stable system and the conclusion
is the same. Performance is ~2 % worse:

* before:
eth2->eth3 13,746,431 rx/s 13,746,471 err,drop/s 0 xmit/s
xmit eth2->eth3 0 xmit/s 13,746,471 drop/s 0 drv_err/s 16.00 bulk-avg

* after:
eth2->eth3 13,437,277 rx/s 13,437,259 err,drop/s 0 xmit/s
xmit eth2->eth3 0 xmit/s 13,437,259 drop/s 0 drv_err/s 16.00 bulk-avg

After this experiment it doesn't seem like this direction is worth
proceeding with... I was more optimistic at the start.

>>> Toke (and I) will appreciate if you added code for this to xdp-bench.
>> Supporting a --program-mode like 'redirect-cpu' does.
>>
>>
> Ok. I will add it.
>
Added it here:
https://github.com/xdp-project/xdp-tools/pull/532

Thanks,
Dragos