[Intel-wired-lan] [PATCH net-next v3] i40e: xsk: use xdp_build_skb_from_zc() for XDP_PASS

Loktionov, Aleksandr aleksandr.loktionov at intel.com
Fri Jul 31 05:46:05 UTC 2026



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf
> Of Chenguang Zhao
> Sent: Friday, July 31, 2026 4:08 AM
> To: Nguyen, Anthony L <anthony.l.nguyen at intel.com>; Kitszel,
> Przemyslaw <przemyslaw.kitszel at intel.com>; andrew+netdev at lunn.ch;
> davem at davemloft.net; edumazet at google.com; kuba at kernel.org;
> pabeni at redhat.com
> Cc: intel-wired-lan at lists.osuosl.org; netdev at vger.kernel.org;
> chenguang.zhao at linux.dev; kerneljasonxing at gmail.com; Chenguang Zhao
> <zhaochenguang at kylinos.cn>
> Subject: [Intel-wired-lan] [PATCH net-next v3] i40e: xsk: use
> xdp_build_skb_from_zc() for XDP_PASS
> 
> From: Chenguang Zhao <zhaochenguang at kylinos.cn>
> 
> Replace the driver-local i40e_construct_skb_zc() with the common
> helper xdp_build_skb_from_zc(). On failure, free the xdp buff in the
> caller.
> 
> xdp_build_skb_from_zc() already calls skb_record_rx_queue() and
> eth_type_trans(), so pull the remaining descriptor field setup into
> __i40e_process_skb_fields() and use that on the XDP_PASS path.
> 
> Signed-off-by: Chenguang Zhao <zhaochenguang at kylinos.cn>
> ---
> v3:
>  As suggested by Larysa:
>  - Drop eth_skb_pad() on the XDP_PASS path, along with the
>    temporary __skb_push()/__skb_pull() around it. The stack
>    handles short skbs and other vendors do not pad on Rx.
> 
> v2:
>  - https://lore.kernel.org/all/20260729054916.720750-1-
> chenguang.zhao at linux.dev/
> 
> v1:
>  - https://lore.kernel.org/all/20260724020125.246333-1-
> chenguang.zhao at linux.dev/
> ---
>  drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 32 ++++++--
>  .../ethernet/intel/i40e/i40e_txrx_common.h    |  2 +
>  drivers/net/ethernet/intel/i40e/i40e_xsk.c    | 79 ++----------------
> -
>  3 files changed, 33 insertions(+), 80 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> index ef5e657816f0..87553b14d34a 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> @@ -1833,17 +1833,17 @@ static inline void i40e_rx_hash(struct
> i40e_ring *ring,  }
> 
>  /**

...

>  		napi_gro_receive(&rx_ring->q_vector->napi, skb);
>  		return;
>  	}
> --
> 2.25.1

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov at intel.com>


More information about the Intel-wired-lan mailing list