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. Open question: * How should common code across drivers within a single device class be managed? - For now, I've created an "intel_eth" folder within the "common" driver directory, thinking about it after, it implies to me that it is common across driver classes. - Would it be better to create an "intel_common" directory within the "net" folder? Bruce Richardson (21): common/intel_eth: add pkt reassembly fn for intel drivers common/intel_eth: provide common Tx entry structures common/intel_eth: add Tx mbuf ring replenish fn drivers/net: align Tx queue struct field names drivers/net: add prefix for driver-specific structs common/intel_eth: 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 common/intel_eth: pack Tx queue structure common/intel_eth: add post-Tx buffer free function common/intel_eth: 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/ixgbe: use common Tx backlog entry fn drivers/common/intel_eth/ieth_rxtx.h | 153 +++++++++++ .../common/intel_eth/ieth_rxtx_vec_common.h | 260 ++++++++++++++++++ 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 | 194 +++++-------- drivers/net/i40e/i40e_rxtx.h | 61 +--- drivers/net/i40e/i40e_rxtx_vec_altivec.c | 26 +- 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 | 144 +--------- drivers/net/i40e/i40e_rxtx_vec_neon.c | 26 +- drivers/net/i40e/i40e_rxtx_vec_sse.c | 26 +- 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 | 180 +++++------- drivers/net/iavf/iavf_rxtx.h | 61 +--- drivers/net/iavf/iavf_rxtx_vec_avx2.c | 46 ++-- drivers/net/iavf/iavf_rxtx_vec_avx512.c | 213 +++----------- drivers/net/iavf/iavf_rxtx_vec_common.h | 160 +---------- drivers/net/iavf/iavf_rxtx_vec_sse.c | 57 ++-- drivers/net/iavf/iavf_vchnl.c | 6 +- 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 | 164 +++++------ 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 | 190 +------------ drivers/net/ice/ice_rxtx_vec_sse.c | 30 +- 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 | 137 ++++----- drivers/net/ixgbe/ixgbe_rxtx.h | 73 +---- drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 119 +------- drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 33 +-- drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 33 +-- drivers/net/ixgbe/meson.build | 2 +- 46 files changed, 1008 insertions(+), 1875 deletions(-) create mode 100644 drivers/common/intel_eth/ieth_rxtx.h create mode 100644 drivers/common/intel_eth/ieth_rxtx_vec_common.h -- 2.43.0