[PATCH v4 22/25] net/ixgbe: use common Rx rearm code
Bruce Richardson
bruce.richardson at intel.com
Wed Jun 4 11:40:15 CEST 2025
On Fri, May 30, 2025 at 02:57:18PM +0100, Anatoly Burakov wrote:
> The ixgbe driver has implementations of vectorized mbuf rearm code that
> is identical to the ones in the common code, so just use those.
>
> Since ixgbe Rx descriptors are always 16-byte wide, force using 16-byte
> definitions in the common headers with a define flag.
>
> While we're at it, also make sure to use common definitions for things like
> burst size, rearm threshold, and descriptors per loop, which is currently
> defined separately in each driver.
>
> Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
> ---
>
> Notes:
> v3 -> v4:
> - Use the common descriptor format instead of constant propagation
> - Use some definitional hackery to work around IXGBE descriptors always being 16-byte
> - Use the new unified definitions for burst size, rearm threshold, and descriptors per loop
>
> drivers/net/intel/ixgbe/ixgbe_rxtx.h | 21 ++++-
> drivers/net/intel/ixgbe/ixgbe_rxtx_vec_neon.c | 67 +---------------
> drivers/net/intel/ixgbe/ixgbe_rxtx_vec_sse.c | 76 +------------------
> 3 files changed, 26 insertions(+), 138 deletions(-)
>
> diff --git a/drivers/net/intel/ixgbe/ixgbe_rxtx.h b/drivers/net/intel/ixgbe/ixgbe_rxtx.h
> index d1847a33dd..0640336156 100644
> --- a/drivers/net/intel/ixgbe/ixgbe_rxtx.h
> +++ b/drivers/net/intel/ixgbe/ixgbe_rxtx.h
> @@ -5,9 +5,24 @@
> #ifndef _IXGBE_RXTX_H_
> #define _IXGBE_RXTX_H_
>
> +/*
> + * For IXGBE, descriptor size is always 16 bytes, so in order to have all
> + * vectorized and common code building correctly and with proper offsets, force
> + * the common parts to consider IXGBE descriptors to be 16-bytes in size.
> + */
> +#ifndef RTE_NET_INTEL_USE_16BYTE_DESC
> +#define IXGBE_FORCE_16BYTE_DESC
> +#define RTE_NET_INTEL_USE_16BYTE_DESC
> +#endif
> +
> #include "../common/rx.h"
> #include "../common/tx.h"
>
> +#ifdef IXGBE_FORCE_16BYTE_DESC
> +#undef RTE_NET_INTEL_USE_16BYTE_DESC
> +#undef IXGBE_FORCE_16BYTE_DESC
> +#endif
> +
Is there a reason why we need to track the forced nature of the define and
#undef it afterwards, or is it just for code hygiene?
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
More information about the dev
mailing list