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 AC00545D6F; Fri, 22 Nov 2024 13:56:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 161184341F; Fri, 22 Nov 2024 13:55:10 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by mails.dpdk.org (Postfix) with ESMTP id 107E2433EC for ; Fri, 22 Nov 2024 13:55:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732280105; x=1763816105; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vLTTmNersks39KTIFvp0pc48qyP3aEgHyIxkCOQyjCE=; b=VDPGYgrIpCGT7QLEb4Hkb1gSWeVdY2Ym1L8kgbeKO/a0ZVHfBroZrhsp HqyMOCdnPkMFeQhkJbPbWli454q5lK2HqE5UHn8Iwk+EoXblcpUbdTUc0 DffcCb7PSV+JloZjHCvIQ/PexfjiGikUSk4ODncEj+jU3MgJcIHKkOlNv Li4L3gywglhPKdMpsQmwjDqxLpZtXqOX44oPZeA5DEX7ovNqdLNeMl+6O 7XLQWuB6w+EGiirrXtWvetu/m3ukoKwlJ0EjayhKsoIvgOUbkloi4mulY yX3EhmKj00HKVqkb0UmpDSw69pMom1dFJrSJmP2jNxSHTEsx+PwJdQURy w==; X-CSE-ConnectionGUID: YcUPFyCbRomO8p2l8mATkg== X-CSE-MsgGUID: PzG4UY+xQH+PA9Lu2OuNzQ== X-IronPort-AV: E=McAfee;i="6700,10204,11263"; a="43085386" X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="43085386" 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:55:04 -0800 X-CSE-ConnectionGUID: vWgR3l0sQf+dFxElBTSbvQ== X-CSE-MsgGUID: pcORUnfxSOOrzE6q5ftT0w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,175,1728975600"; d="scan'208";a="90373281" Received: from unknown (HELO silpixa00401385.ir.intel.com) ([10.237.214.25]) by fmviesa007.fm.intel.com with ESMTP; 22 Nov 2024 04:55:03 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , Anatoly Burakov , Vladimir Medvedkin , Wathsala Vithanage , Konstantin Ananyev Subject: [RFC PATCH 16/21] net/ixgbe: use common Tx queue mbuf cleanup fn Date: Fri, 22 Nov 2024 12:54:09 +0000 Message-ID: <20241122125418.2857301-17-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 Update driver to use the common cleanup function. Signed-off-by: Bruce Richardson --- drivers/net/ixgbe/ixgbe_rxtx.c | 22 +++--------------- drivers/net/ixgbe/ixgbe_rxtx.h | 1 - drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 28 ++--------------------- drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 7 ------ drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 7 ------ 5 files changed, 5 insertions(+), 60 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index e80bd6fccc..0d5f4803e5 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -2334,21 +2334,6 @@ ixgbe_recv_pkts_lro_bulk_alloc(void *rx_queue, struct rte_mbuf **rx_pkts, * **********************************************************************/ -static void __rte_cold -ixgbe_tx_queue_release_mbufs(struct ieth_tx_queue *txq) -{ - unsigned i; - - if (txq->sw_ring != NULL) { - for (i = 0; i < txq->nb_tx_desc; i++) { - if (txq->sw_ring[i].mbuf != NULL) { - rte_pktmbuf_free_seg(txq->sw_ring[i].mbuf); - txq->sw_ring[i].mbuf = NULL; - } - } - } -} - static int ixgbe_tx_done_cleanup_full(struct ieth_tx_queue *txq, uint32_t free_cnt) { @@ -2472,7 +2457,7 @@ static void __rte_cold ixgbe_tx_queue_release(struct ieth_tx_queue *txq) { if (txq != NULL && txq->ops != NULL) { - txq->ops->release_mbufs(txq); + ieth_txq_release_all_mbufs(txq); txq->ops->free_swring(txq); rte_memzone_free(txq->mz); rte_free(txq); @@ -2526,7 +2511,6 @@ ixgbe_reset_tx_queue(struct ieth_tx_queue *txq) } static const struct ixgbe_txq_ops def_txq_ops = { - .release_mbufs = ixgbe_tx_queue_release_mbufs, .free_swring = ixgbe_tx_free_swring, .reset = ixgbe_reset_tx_queue, }; @@ -3380,7 +3364,7 @@ ixgbe_dev_clear_queues(struct rte_eth_dev *dev) struct ieth_tx_queue *txq = dev->data->tx_queues[i]; if (txq != NULL) { - txq->ops->release_mbufs(txq); + ieth_txq_release_all_mbufs(txq); txq->ops->reset(txq); dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; } @@ -5654,7 +5638,7 @@ ixgbe_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id) } if (txq->ops != NULL) { - txq->ops->release_mbufs(txq); + ieth_txq_release_all_mbufs(txq); txq->ops->reset(txq); } dev->data->tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STOPPED; diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxtx.h index 5b56e48498..0a990ee1ca 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.h +++ b/drivers/net/ixgbe/ixgbe_rxtx.h @@ -181,7 +181,6 @@ struct ixgbe_advctx_info { }; struct ixgbe_txq_ops { - void (*release_mbufs)(struct ieth_tx_queue *txq); void (*free_swring)(struct ieth_tx_queue *txq); void (*reset)(struct ieth_tx_queue *txq); }; diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h index c2fcc51610..3064b92533 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h @@ -78,32 +78,6 @@ tx_backlog_entry(struct ieth_vec_tx_entry *txep, txep[i].mbuf = tx_pkts[i]; } -static inline void -_ixgbe_tx_queue_release_mbufs_vec(struct ieth_tx_queue *txq) -{ - unsigned int i; - struct ieth_vec_tx_entry *txe; - const uint16_t max_desc = (uint16_t)(txq->nb_tx_desc - 1); - - if (txq->sw_ring == NULL || txq->nb_tx_free == max_desc) - return; - - /* release the used mbufs in sw_ring */ - for (i = txq->tx_next_dd - (txq->tx_rs_thresh - 1); - i != txq->tx_tail; - i = (i + 1) % txq->nb_tx_desc) { - txe = &txq->sw_ring_v[i]; - rte_pktmbuf_free_seg(txe->mbuf); - } - txq->nb_tx_free = max_desc; - - /* reset tx_entry */ - for (i = 0; i < txq->nb_tx_desc; i++) { - txe = &txq->sw_ring_v[i]; - txe->mbuf = NULL; - } -} - static inline void _ixgbe_rx_queue_release_mbufs_vec(struct ixgbe_rx_queue *rxq) { @@ -208,6 +182,8 @@ ixgbe_txq_vec_setup_default(struct ieth_tx_queue *txq, /* leave the first one for overflow */ txq->sw_ring_v = txq->sw_ring_v + 1; txq->ops = txq_ops; + txq->vector_tx = 1; + txq->vector_sw_ring = 1; return 0; } diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c index b51072b294..2336a86dd2 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c @@ -633,12 +633,6 @@ ixgbe_xmit_fixed_burst_vec(void *tx_queue, struct rte_mbuf **tx_pkts, return nb_pkts; } -static void __rte_cold -ixgbe_tx_queue_release_mbufs_vec(struct ieth_tx_queue *txq) -{ - _ixgbe_tx_queue_release_mbufs_vec(txq); -} - void __rte_cold ixgbe_rx_queue_release_mbufs_vec(struct ixgbe_rx_queue *rxq) { @@ -658,7 +652,6 @@ ixgbe_reset_tx_queue(struct ieth_tx_queue *txq) } static const struct ixgbe_txq_ops vec_txq_ops = { - .release_mbufs = ixgbe_tx_queue_release_mbufs_vec, .free_swring = ixgbe_tx_free_swring, .reset = ixgbe_reset_tx_queue, }; diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c index ddba15ad52..9707dd80eb 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c @@ -756,12 +756,6 @@ ixgbe_xmit_fixed_burst_vec(void *tx_queue, struct rte_mbuf **tx_pkts, return nb_pkts; } -static void __rte_cold -ixgbe_tx_queue_release_mbufs_vec(struct ieth_tx_queue *txq) -{ - _ixgbe_tx_queue_release_mbufs_vec(txq); -} - void __rte_cold ixgbe_rx_queue_release_mbufs_vec(struct ixgbe_rx_queue *rxq) { @@ -781,7 +775,6 @@ ixgbe_reset_tx_queue(struct ieth_tx_queue *txq) } static const struct ixgbe_txq_ops vec_txq_ops = { - .release_mbufs = ixgbe_tx_queue_release_mbufs_vec, .free_swring = ixgbe_tx_free_swring, .reset = ixgbe_reset_tx_queue, }; -- 2.43.0