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

"Loktionov, Aleksandr" <[email protected]> Fri, 31 Jul 2026 05:46:05 +0000
Newsgroups org.osuosl.intel-wired-lan,org.kernel.vger.netdev
Message-ID <IA3PR11MB8986E45BA1B67EBA5DB67EAEE5C82@IA3PR11MB8986.namprd11.prod.outlook.com>

> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf
> Of Chenguang Zhao
> Sent: Friday, July 31, 2026 4:08 AM
> To: Nguyen, Anthony L <[email protected]>; Kitszel,
> Przemyslaw <[email protected]>; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]
> Cc: [email protected]; [email protected];
> [email protected]; [email protected]; Chenguang Zhao
> <[email protected]>
> Subject: [Intel-wired-lan] [PATCH net-next v3] i40e: xsk: use
> xdp_build_skb_from_zc() for XDP_PASS
>=20
> From: Chenguang Zhao <[email protected]>
>=20
> 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.
>=20
> 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.
>=20
> Signed-off-by: Chenguang Zhao <[email protected]>
> ---
> 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.
>=20
> v2:
>  - https://lore.kernel.org/all/20260729054916.720750-1-
> [email protected]/
>=20
> v1:
>  - https://lore.kernel.org/all/20260724020125.246333-1-
> [email protected]/
> ---
>  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(-)
>=20
> 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,  }
>=20
>  /**

...

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

Reviewed-by: Aleksandr Loktionov <[email protected]>