[PATCH v4 00/24] Reduce code duplication across Intel NIC drivers
Bruce Richardson
bruce.richardson at intel.com
Fri Dec 20 15:38:57 CET 2024
This RFC attempts to reduce the amount of code duplication across a
number of Intel NIC drivers, specifically: ixgbe, i40e, iavf, and ice.
The first patch extract a function from the Rx side, otherwise the
majority of the changes are on the Tx side, leading to a converged Tx
queue structure across the 4 drivers, and a large number of common
functions.
v3->v4:
* Add patches 23 & 24 to set, to do a little more dedupliation on
Rx side
v2->v3:
* Fix incorrect/unadjusted memset in patch 8, leading to incorrect
threshold tracking in ixgbe.
v1->v2:
* Fix two additional checkpatch issues that were flagged.
* Added in patch 21, which performs additional cleanup that is possible
once all vector drivers use the same mbuf free/release process.
[This brings the patchset to having over twice as many lines removed
as added (1887 vs 930), and close to having a net removal of 1kloc]
RFC->v1:
* Moved the location of the common code from "common/intel_eth" to
"net/_common_intel", and added only ".." to the driver include path so
that the paths included "_common_intel" in them, to make it clear it's
not driver-local headers.
* Due to change in location, structure/fn prefix changes from "ieth" to
"ci" for "common intel".
* Removed the seeming-arbitrary split of vector and non-vector code -
since much of the code taken from vector files was scalar code which
was used by the vector drivers.
* Split code into separate Rx and Tx files.
* Fixed multiple checkpatch issues (but not all).
* Attempted to improve name standardization, by using "_vec" as a common
suffix for all vector-related fns and data. Previously, some names had
"vec" in the middle, others had just "_v" suffix or full word "vector"
as suffix.
* Other minor changes...
Bruce Richardson (24):
net/_common_intel: add pkt reassembly fn for intel drivers
net/_common_intel: provide common Tx entry structures
net/_common_intel: add Tx mbuf ring replenish fn
drivers/net: align Tx queue struct field names
drivers/net: add prefix for driver-specific structs
net/_common_intel: merge ice and i40e Tx queue struct
net/iavf: use common Tx queue structure
net/ixgbe: convert Tx queue context cache field to ptr
net/ixgbe: use common Tx queue structure
net/_common_intel: pack Tx queue structure
net/_common_intel: add post-Tx buffer free function
net/_common_intel: add Tx buffer free fn for AVX-512
net/iavf: use common Tx free fn for AVX-512
net/ice: move Tx queue mbuf cleanup fn to common
net/i40e: use common Tx queue mbuf cleanup fn
net/ixgbe: use common Tx queue mbuf cleanup fn
net/iavf: use common Tx queue mbuf cleanup fn
net/ice: use vector SW ring for all vector paths
net/i40e: use vector SW ring for all vector paths
net/iavf: use vector SW ring for all vector paths
net/_common_intel: remove unneeded code
net/ixgbe: use common Tx backlog entry fn
net/_common_intel: create common mbuf initializer fn
net/_common_intel: extract common Rx vector criteria
drivers/net/_common_intel/rx.h | 112 ++++++++
drivers/net/_common_intel/tx.h | 249 ++++++++++++++++++
drivers/net/i40e/i40e_ethdev.c | 4 +-
drivers/net/i40e/i40e_ethdev.h | 8 +-
drivers/net/i40e/i40e_fdir.c | 10 +-
.../net/i40e/i40e_recycle_mbufs_vec_common.c | 6 +-
drivers/net/i40e/i40e_rxtx.c | 192 +++++---------
drivers/net/i40e/i40e_rxtx.h | 61 +----
drivers/net/i40e/i40e_rxtx_vec_altivec.c | 30 ++-
drivers/net/i40e/i40e_rxtx_vec_avx2.c | 26 +-
drivers/net/i40e/i40e_rxtx_vec_avx512.c | 144 +---------
drivers/net/i40e/i40e_rxtx_vec_common.h | 198 +-------------
drivers/net/i40e/i40e_rxtx_vec_neon.c | 30 ++-
drivers/net/i40e/i40e_rxtx_vec_sse.c | 30 ++-
drivers/net/i40e/meson.build | 2 +-
drivers/net/iavf/iavf.h | 2 +-
drivers/net/iavf/iavf_ethdev.c | 4 +-
drivers/net/iavf/iavf_rxtx.c | 195 +++++---------
drivers/net/iavf/iavf_rxtx.h | 62 +----
drivers/net/iavf/iavf_rxtx_vec_avx2.c | 47 ++--
drivers/net/iavf/iavf_rxtx_vec_avx512.c | 214 +++------------
drivers/net/iavf/iavf_rxtx_vec_common.h | 178 +------------
drivers/net/iavf/iavf_rxtx_vec_neon.c | 3 +-
drivers/net/iavf/iavf_rxtx_vec_sse.c | 59 ++---
drivers/net/iavf/iavf_vchnl.c | 8 +-
drivers/net/iavf/meson.build | 2 +-
drivers/net/ice/ice_dcf.c | 4 +-
drivers/net/ice/ice_dcf_ethdev.c | 21 +-
drivers/net/ice/ice_diagnose.c | 2 +-
drivers/net/ice/ice_ethdev.c | 2 +-
drivers/net/ice/ice_ethdev.h | 7 +-
drivers/net/ice/ice_rxtx.c | 163 +++++-------
drivers/net/ice/ice_rxtx.h | 52 +---
drivers/net/ice/ice_rxtx_vec_avx2.c | 26 +-
drivers/net/ice/ice_rxtx_vec_avx512.c | 153 +----------
drivers/net/ice/ice_rxtx_vec_common.h | 222 +---------------
drivers/net/ice/ice_rxtx_vec_sse.c | 35 ++-
drivers/net/ice/meson.build | 2 +-
drivers/net/ixgbe/base/ixgbe_osdep.h | 2 +-
drivers/net/ixgbe/ixgbe_ethdev.c | 4 +-
.../ixgbe/ixgbe_recycle_mbufs_vec_common.c | 6 +-
drivers/net/ixgbe/ixgbe_rxtx.c | 139 +++++-----
drivers/net/ixgbe/ixgbe_rxtx.h | 73 +----
drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 156 ++---------
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 40 ++-
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 40 ++-
drivers/net/ixgbe/meson.build | 2 +-
47 files changed, 1000 insertions(+), 2027 deletions(-)
create mode 100644 drivers/net/_common_intel/rx.h
create mode 100644 drivers/net/_common_intel/tx.h
--
2.43.0
More information about the dev
mailing list