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 B36BC45D6F; Fri, 22 Nov 2024 13:56:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5CE3443400; Fri, 22 Nov 2024 13:54:58 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by mails.dpdk.org (Postfix) with ESMTP id 893E242FB2 for ; Fri, 22 Nov 2024 13:54:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732280094; x=1763816094; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GSSaVniHBJ/m+DGkYRPFzB5LOLItYfuIiRlOW/F6xVA=; b=O4tbsfzLkz1FABXfj04w0PGD0pUIh7XHXgivZWexoTVFkRlz/rl2LCJz HfPI/j6iO+DEzFAY88Ekj6k5IPWPp9yVJCESpM25wWeZEl+9wAUBa+UQF DjJjnYMV4lk+VrLpVRbGQZjyha7DpzoMT7SH6NttusDVbXUWQdhPpOWM1 /oAiIvFlzIDcRFQj6wXtV3C0xBF9qfVZg5+ApQHcG3P6/9eJKtW9EkoS5 09hPmRUo6fnjjMy4mwB6//c6PrH0HQ2Bg53CQPh21gPf5iZLVYo5q0tNo lVp0f13HMR3EUiAW4Agx4cJV7cbg4vkVLukrdCNxxUQkeW3+pelIFsQZI w==; X-CSE-ConnectionGUID: hc6DrvxUS0i3ezzh1P61+g== X-CSE-MsgGUID: SGwkXQ+STDi/Bk3hFb8A9A== X-IronPort-AV: E=McAfee;i="6700,10204,11263"; a="43085366" X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="43085366" 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:54 -0800 X-CSE-ConnectionGUID: hBLpuRngQ8y818qAXsa+Iw== X-CSE-MsgGUID: 0GcC1NGUQ3qrAlaKiu3AcA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="90373229" Received: from unknown (HELO silpixa00401385.ir.intel.com) ([10.237.214.25]) by fmviesa007.fm.intel.com with ESMTP; 22 Nov 2024 04:54:52 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , Ian Stokes , Anatoly Burakov Subject: [RFC PATCH 10/21] common/intel_eth: pack Tx queue structure Date: Fri, 22 Nov 2024 12:54:03 +0000 Message-ID: <20241122125418.2857301-11-bruce.richardson@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241122125418.2857301-1-bruce.richardson@intel.com> References: <20241122125418.2857301-1-bruce.richardson@intel.com> 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 Move some fields about to better pack the Tx queue structure and make sure all data used by the vector codepaths is on the first cacheline of the structure. Checking with "pahole" on 64-bit build, only one 6-byte hole is left in the structure - on second cacheline - after this patch. As part of the reordering, move the p/h/wthresh values to the ixgbe-specific part of the union. That is the only driver which actually uses those values. i40e and ice drivers just record the values for later return, so we can drop them from the Tx queue structure for those drivers and just report the defaults in all cases. Signed-off-by: Bruce Richardson --- drivers/common/intel_eth/ieth_rxtx.h | 12 +++++------- drivers/net/i40e/i40e_rxtx.c | 9 +++------ drivers/net/ice/ice_rxtx.c | 9 +++------ 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/drivers/common/intel_eth/ieth_rxtx.h b/drivers/common/intel_eth/ieth_rxtx.h index 9f8a1d7141..c336ec81b3 100644 --- a/drivers/common/intel_eth/ieth_rxtx.h +++ b/drivers/common/intel_eth/ieth_rxtx.h @@ -42,7 +42,6 @@ struct ieth_tx_queue { struct ieth_tx_entry *sw_ring; /* virtual address of SW ring */ struct ieth_vec_tx_entry *sw_ring_v; }; - rte_iova_t tx_ring_dma; /* TX ring DMA address */ uint16_t nb_tx_desc; /* number of TX descriptors */ uint16_t tx_tail; /* current value of tail register */ uint16_t nb_tx_used; /* number of TX desc used since RS bit set */ @@ -56,16 +55,14 @@ struct ieth_tx_queue { uint16_t tx_free_thresh; /* Number of TX descriptors to use before RS bit is set. */ uint16_t tx_rs_thresh; - uint8_t pthresh; /**< Prefetch threshold register. */ - uint8_t hthresh; /**< Host threshold register. */ - uint8_t wthresh; /**< Write-back threshold reg. */ uint16_t port_id; /* Device port identifier. */ uint16_t queue_id; /* TX queue index. */ uint16_t reg_idx; - uint64_t offloads; uint16_t tx_next_dd; uint16_t tx_next_rs; + uint64_t offloads; uint64_t mbuf_errors; + rte_iova_t tx_ring_dma; /* TX ring DMA address */ _Bool tx_deferred_start; /* don't start this queue in dev start */ _Bool q_set; /* indicate if tx queue has been configured */ union { /* the VSI this queue belongs to */ @@ -97,9 +94,10 @@ struct ieth_tx_queue { const struct ixgbe_txq_ops *ops; struct ixgbe_advctx_info *ctx_cache; uint32_t ctx_curr; -#ifdef RTE_LIB_SECURITY + uint8_t pthresh; /**< Prefetch threshold register. */ + uint8_t hthresh; /**< Host threshold register. */ + uint8_t wthresh; /**< Write-back threshold reg. */ uint8_t using_ipsec; /**< indicates that IPsec TX feature is in use */ -#endif }; }; }; diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index fce3f5ec2a..29df978019 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -2539,9 +2539,6 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev *dev, txq->nb_tx_desc = nb_desc; txq->tx_rs_thresh = tx_rs_thresh; txq->tx_free_thresh = tx_free_thresh; - txq->pthresh = tx_conf->tx_thresh.pthresh; - txq->hthresh = tx_conf->tx_thresh.hthresh; - txq->wthresh = tx_conf->tx_thresh.wthresh; txq->queue_id = queue_idx; txq->reg_idx = reg_idx; txq->port_id = dev->data->port_id; @@ -3310,9 +3307,9 @@ i40e_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, qinfo->nb_desc = txq->nb_tx_desc; - qinfo->conf.tx_thresh.pthresh = txq->pthresh; - qinfo->conf.tx_thresh.hthresh = txq->hthresh; - qinfo->conf.tx_thresh.wthresh = txq->wthresh; + qinfo->conf.tx_thresh.pthresh = I40E_DEFAULT_TX_PTHRESH; + qinfo->conf.tx_thresh.hthresh = I40E_DEFAULT_TX_HTHRESH; + qinfo->conf.tx_thresh.wthresh = I40E_DEFAULT_TX_WTHRESH; qinfo->conf.tx_free_thresh = txq->tx_free_thresh; qinfo->conf.tx_rs_thresh = txq->tx_rs_thresh; diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index 20ebda68c7..9606ac7862 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -1492,9 +1492,6 @@ ice_tx_queue_setup(struct rte_eth_dev *dev, txq->nb_tx_desc = nb_desc; txq->tx_rs_thresh = tx_rs_thresh; txq->tx_free_thresh = tx_free_thresh; - txq->pthresh = tx_conf->tx_thresh.pthresh; - txq->hthresh = tx_conf->tx_thresh.hthresh; - txq->wthresh = tx_conf->tx_thresh.wthresh; txq->queue_id = queue_idx; txq->reg_idx = vsi->base_queue + queue_idx; @@ -1583,9 +1580,9 @@ ice_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, qinfo->nb_desc = txq->nb_tx_desc; - qinfo->conf.tx_thresh.pthresh = txq->pthresh; - qinfo->conf.tx_thresh.hthresh = txq->hthresh; - qinfo->conf.tx_thresh.wthresh = txq->wthresh; + qinfo->conf.tx_thresh.pthresh = ICE_DEFAULT_TX_PTHRESH; + qinfo->conf.tx_thresh.hthresh = ICE_DEFAULT_TX_HTHRESH; + qinfo->conf.tx_thresh.wthresh = ICE_DEFAULT_TX_WTHRESH; qinfo->conf.tx_free_thresh = txq->tx_free_thresh; qinfo->conf.tx_rs_thresh = txq->tx_rs_thresh; -- 2.43.0