Re: [PATCH net-next 04/16] libeth: add XSk helpers

Alexander Lobakin
2025-03-12T17:04:07Z

From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Date: Fri, 7 Mar 2025 11:15:56 +0100

> On Wed, Mar 05, 2025 at 05:21:20PM +0100, Alexander Lobakin wrote:
>> Add the following counterparts of functions from libeth_xdp which need
>> special care on XSk path:
>>
>> * building &xdp_buff (head and frags);
>> * running XDP prog and managing all possible verdicts;
>> * xmit (with S/G and metadata support);
>> * wakeup via CSD/IPI;
>> * FQ init/deinit and refilling.
>>
>> Xmit by default unrolls loops by 8 when filling Tx DMA descriptors.
>> XDP_REDIRECT verdict is considered default/likely(). Rx frags are
>> considered unlikely().
>> It is assumed that Tx/completion queues are not mapped to any
>> interrupts, thus we clean them only when needed (=> 3/4 of
>> descriptors is busy) and keep need_wakeup set.
>> IPI for XSk wakeup showed better performance than triggering an SW
>> NIC interrupt, though it doesn't respect NIC's interrupt affinity.
>
> Maybe introduce this with xsk support on idpf (i suppose when set after
> this one) ?
>
> Otherwise, what is the reason to have this included? I didn't check
> in-depth if there are any functions used from this patch on drivers side.

I did split libeth_xdp into two commits only to ease reviewing a bit.
There's also stuff from Michał in progress which converts ice to
libeth_xdp and adds XDP to iavf... I don't want to block it by idpf,
who knows which one will go first :>

>
>>
>> Suggested-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> # lots of stuff
>> Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
>> ---
>> drivers/net/ethernet/intel/libeth/Kconfig | 2 +-
>> drivers/net/ethernet/intel/libeth/Makefile | 1 +
>> drivers/net/ethernet/intel/libeth/priv.h | 11 +
>> include/net/libeth/tx.h | 10 +-
>> include/net/libeth/xdp.h | 90 ++-
>> include/net/libeth/xsk.h | 685 +++++++++++++++++++++
>> drivers/net/ethernet/intel/libeth/tx.c | 5 +-
>> drivers/net/ethernet/intel/libeth/xdp.c | 26 +-
>> drivers/net/ethernet/intel/libeth/xsk.c | 269 ++++++++
>> 9 files changed, 1067 insertions(+), 32 deletions(-)
>> create mode 100644 include/net/libeth/xsk.h
>> create mode 100644 drivers/net/ethernet/intel/libeth/xsk.c

Thanks,
Olek