From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B51D345D6F; Fri, 22 Nov 2024 13:54:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 49CC943375; Fri, 22 Nov 2024 13:54:33 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by mails.dpdk.org (Postfix) with ESMTP id 51C5442FB2 for ; Fri, 22 Nov 2024 13:54:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732280071; x=1763816071; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=J5t5au8aSwaoDV+i6hqLYdnaCyMy9sHyPU1cxAdq08Q=; b=XgXeuH6giZKcpyDbk+OCw+jMQXUWCnSuPQuui9xcvNTq54b3JXB5lFRz jbRUnEo1CMmQ2gwJnE5ImMC1prSLrsmplx3/9ylKMgLIY0ezwaDXZJfHi 6KPE+/XBrXkda97n2YTlmlj0d3ma440+9OoxacnARpV13/vHSDclenLh8 Rj8S8Oa424xSSiXB70mKf7ezZJQnCNTSHf/1wu7ywG7kd5nB45gNP1yVd dAsAu4/GBpPTHd3o5I60pT8e6bSPDO4RMwPxZQRhCMLoIAmvB5TrbirpC lM7EcA0Lu52099am8EAVytvkmeW1jDu9hqQsJ9tjCDEW0lAtwQ2dcjjX1 w==; X-CSE-ConnectionGUID: w9mkex+DS4ad79T+P40+qg== X-CSE-MsgGUID: JOxcH0++Sa6EPgLtFdB2IA== X-IronPort-AV: E=McAfee;i="6700,10204,11263"; a="43085328" X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="43085328" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2024 04:54:30 -0800 X-CSE-ConnectionGUID: FG65VR/kTwmJZtDqCwW2lw== X-CSE-MsgGUID: kb3u3GldQIOx27Qb0Njbsg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="90373144" Received: from unknown (HELO silpixa00401385.ir.intel.com) ([10.237.214.25]) by fmviesa007.fm.intel.com with ESMTP; 22 Nov 2024 04:54:29 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [RFC PATCH 00/21] Reduce code duplication across Intel NIC drivers Date: Fri, 22 Nov 2024 12:53:53 +0000 Message-ID: <20241122125418.2857301-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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