From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH v4 00/24] Reduce code duplication across Intel NIC drivers
Date: Fri, 20 Dec 2024 14:38:57 +0000 [thread overview]
Message-ID: <20241220143925.609044-1-bruce.richardson@intel.com> (raw)
In-Reply-To: <20241122125418.2857301-1-bruce.richardson@intel.com>
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
next prev parent reply other threads:[~2024-12-20 14:39 UTC|newest]
Thread overview: 127+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-22 12:53 [RFC PATCH 00/21] " Bruce Richardson
2024-11-22 12:53 ` [RFC PATCH 01/21] common/intel_eth: add pkt reassembly fn for intel drivers Bruce Richardson
2024-11-22 12:53 ` [RFC PATCH 02/21] common/intel_eth: provide common Tx entry structures Bruce Richardson
2024-11-22 12:53 ` [RFC PATCH 03/21] common/intel_eth: add Tx mbuf ring replenish fn Bruce Richardson
2024-11-22 12:53 ` [RFC PATCH 04/21] drivers/net: align Tx queue struct field names Bruce Richardson
2024-11-22 12:53 ` [RFC PATCH 05/21] drivers/net: add prefix for driver-specific structs Bruce Richardson
2024-11-22 12:53 ` [RFC PATCH 06/21] common/intel_eth: merge ice and i40e Tx queue struct Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 07/21] net/iavf: use common Tx queue structure Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 08/21] net/ixgbe: convert Tx queue context cache field to ptr Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 09/21] net/ixgbe: use common Tx queue structure Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 10/21] common/intel_eth: pack " Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 11/21] common/intel_eth: add post-Tx buffer free function Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 12/21] common/intel_eth: add Tx buffer free fn for AVX-512 Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 13/21] net/iavf: use common Tx " Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 14/21] net/ice: move Tx queue mbuf cleanup fn to common Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 15/21] net/i40e: use common Tx queue mbuf cleanup fn Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 16/21] net/ixgbe: " Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 17/21] net/iavf: " Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 18/21] net/ice: use vector SW ring for all vector paths Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 19/21] net/i40e: " Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 20/21] net/iavf: " Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 21/21] net/ixgbe: use common Tx backlog entry fn Bruce Richardson
2024-11-25 16:25 ` [RFC PATCH 00/21] Reduce code duplication across Intel NIC drivers David Marchand
2024-11-25 16:31 ` Bruce Richardson
2024-11-26 14:57 ` Thomas Monjalon
2024-11-26 15:27 ` Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 " Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 01/21] net/_common_intel: add pkt reassembly fn for intel drivers Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 02/21] net/_common_intel: provide common Tx entry structures Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 03/21] net/_common_intel: add Tx mbuf ring replenish fn Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 04/21] drivers/net: align Tx queue struct field names Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 05/21] drivers/net: add prefix for driver-specific structs Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 06/21] net/_common_intel: merge ice and i40e Tx queue struct Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 07/21] net/iavf: use common Tx queue structure Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 08/21] net/ixgbe: convert Tx queue context cache field to ptr Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 09/21] net/ixgbe: use common Tx queue structure Bruce Richardson
2024-12-02 13:51 ` Medvedkin, Vladimir
2024-12-02 14:09 ` Bruce Richardson
2024-12-02 15:15 ` Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 10/21] net/_common_intel: pack " Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 11/21] net/_common_intel: add post-Tx buffer free function Bruce Richardson
2024-12-02 12:59 ` David Marchand
2024-12-02 13:12 ` Bruce Richardson
2024-12-02 13:24 ` Bruce Richardson
2024-12-02 13:55 ` David Marchand
2024-12-02 11:24 ` [PATCH v1 12/21] net/_common_intel: add Tx buffer free fn for AVX-512 Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 13/21] net/iavf: use common Tx " Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 14/21] net/ice: move Tx queue mbuf cleanup fn to common Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 15/21] net/i40e: use common Tx queue mbuf cleanup fn Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 16/21] net/ixgbe: " Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 17/21] net/iavf: " Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 18/21] net/ice: use vector SW ring for all vector paths Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 19/21] net/i40e: " Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 20/21] net/iavf: " Bruce Richardson
2024-12-02 11:24 ` [PATCH v1 21/21] net/ixgbe: use common Tx backlog entry fn Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 00/22] Reduce code duplication across Intel NIC drivers Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 01/22] net/_common_intel: add pkt reassembly fn for intel drivers Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 02/22] net/_common_intel: provide common Tx entry structures Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 03/22] net/_common_intel: add Tx mbuf ring replenish fn Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 04/22] drivers/net: align Tx queue struct field names Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 05/22] drivers/net: add prefix for driver-specific structs Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 06/22] net/_common_intel: merge ice and i40e Tx queue struct Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 07/22] net/iavf: use common Tx queue structure Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 08/22] net/ixgbe: convert Tx queue context cache field to ptr Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 09/22] net/ixgbe: use common Tx queue structure Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 10/22] net/_common_intel: pack " Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 11/22] net/_common_intel: add post-Tx buffer free function Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 12/22] net/_common_intel: add Tx buffer free fn for AVX-512 Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 13/22] net/iavf: use common Tx " Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 14/22] net/ice: move Tx queue mbuf cleanup fn to common Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 15/22] net/i40e: use common Tx queue mbuf cleanup fn Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 16/22] net/ixgbe: " Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 17/22] net/iavf: " Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 18/22] net/ice: use vector SW ring for all vector paths Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 19/22] net/i40e: " Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 20/22] net/iavf: " Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 21/22] net/_common_intel: remove unneeded code Bruce Richardson
2024-12-03 16:41 ` [PATCH v2 22/22] net/ixgbe: use common Tx backlog entry fn Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 00/22] Reduce code duplication across Intel NIC drivers Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 01/22] net/_common_intel: add pkt reassembly fn for intel drivers Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 02/22] net/_common_intel: provide common Tx entry structures Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 03/22] net/_common_intel: add Tx mbuf ring replenish fn Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 04/22] drivers/net: align Tx queue struct field names Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 05/22] drivers/net: add prefix for driver-specific structs Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 06/22] net/_common_intel: merge ice and i40e Tx queue struct Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 07/22] net/iavf: use common Tx queue structure Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 08/22] net/ixgbe: convert Tx queue context cache field to ptr Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 09/22] net/ixgbe: use common Tx queue structure Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 10/22] net/_common_intel: pack " Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 11/22] net/_common_intel: add post-Tx buffer free function Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 12/22] net/_common_intel: add Tx buffer free fn for AVX-512 Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 13/22] net/iavf: use common Tx " Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 14/22] net/ice: move Tx queue mbuf cleanup fn to common Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 15/22] net/i40e: use common Tx queue mbuf cleanup fn Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 16/22] net/ixgbe: " Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 17/22] net/iavf: " Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 18/22] net/ice: use vector SW ring for all vector paths Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 19/22] net/i40e: " Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 20/22] net/iavf: " Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 21/22] net/_common_intel: remove unneeded code Bruce Richardson
2024-12-11 17:33 ` [PATCH v3 22/22] net/ixgbe: use common Tx backlog entry fn Bruce Richardson
2024-12-20 14:38 ` Bruce Richardson [this message]
2024-12-20 14:38 ` [PATCH v4 01/24] net/_common_intel: add pkt reassembly fn for intel drivers Bruce Richardson
2024-12-20 16:15 ` Stephen Hemminger
2024-12-20 14:38 ` [PATCH v4 02/24] net/_common_intel: provide common Tx entry structures Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 03/24] net/_common_intel: add Tx mbuf ring replenish fn Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 04/24] drivers/net: align Tx queue struct field names Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 05/24] drivers/net: add prefix for driver-specific structs Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 06/24] net/_common_intel: merge ice and i40e Tx queue struct Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 07/24] net/iavf: use common Tx queue structure Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 08/24] net/ixgbe: convert Tx queue context cache field to ptr Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 09/24] net/ixgbe: use common Tx queue structure Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 10/24] net/_common_intel: pack " Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 11/24] net/_common_intel: add post-Tx buffer free function Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 12/24] net/_common_intel: add Tx buffer free fn for AVX-512 Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 13/24] net/iavf: use common Tx " Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 14/24] net/ice: move Tx queue mbuf cleanup fn to common Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 15/24] net/i40e: use common Tx queue mbuf cleanup fn Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 16/24] net/ixgbe: " Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 17/24] net/iavf: " Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 18/24] net/ice: use vector SW ring for all vector paths Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 19/24] net/i40e: " Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 20/24] net/iavf: " Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 21/24] net/_common_intel: remove unneeded code Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 22/24] net/ixgbe: use common Tx backlog entry fn Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 23/24] net/_common_intel: create common mbuf initializer fn Bruce Richardson
2024-12-20 14:39 ` [PATCH v4 24/24] net/_common_intel: extract common Rx vector criteria Bruce Richardson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241220143925.609044-1-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).