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 243DFA034C; Tue, 22 Feb 2022 23:48:29 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C947240DF6; Tue, 22 Feb 2022 23:48:28 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 6E8FF40DF4 for ; Tue, 22 Feb 2022 23:48:27 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B66FB139F; Tue, 22 Feb 2022 14:48:26 -0800 (PST) Received: from n1sdp-1.usa.Arm.com (n1sdp-1.usa.arm.com [10.118.91.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A54543F66F; Tue, 22 Feb 2022 14:48:26 -0800 (PST) From: Kathleen Capella To: Bruce Richardson , Konstantin Ananyev , Jingjing Wu , Beilei Xing Cc: dev@dpdk.org, nd@arm.com, honnappa.nagarahalli@arm.com, Kathleen Capella Subject: [PATCH] net/iavf: remove extra check in iavf vector Tx Date: Tue, 22 Feb 2022 22:48:18 +0000 Message-Id: <20220222224818.8612-1-kathleen.capella@arm.com> X-Mailer: git-send-email 2.17.1 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 In the vector Tx path, the function iavf_xmit_pkts_vec_xxx compares nb_pkts and the txq->rs_thresh and passes the minimum of these as an argument to iavf_xmit_fixed_burst_vec_xxx. Inside iavf_xmit_fixed_burst_vec_xxx, the same check is performed again. This patch removes the redundant check from the iavf_xmit_fixed_burst_vec_xxx function. Signed-off-by: Kathleen Capella Reviewed-by: Honnappa Nagarahalli --- drivers/net/iavf/iavf_rxtx_vec_avx2.c | 4 +--- drivers/net/iavf/iavf_rxtx_vec_avx512.c | 4 +--- drivers/net/iavf/iavf_rxtx_vec_sse.c | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/net/iavf/iavf_rxtx_vec_avx2.c b/drivers/net/iavf/iavf_rxtx_vec_avx2.c index b6ef1aea77..d6243b96e2 100644 --- a/drivers/net/iavf/iavf_rxtx_vec_avx2.c +++ b/drivers/net/iavf/iavf_rxtx_vec_avx2.c @@ -1450,9 +1450,6 @@ iavf_xmit_fixed_burst_vec_avx2(void *tx_queue, struct rte_mbuf **tx_pkts, uint64_t flags = IAVF_TX_DESC_CMD_EOP | IAVF_TX_DESC_CMD_ICRC; uint64_t rs = IAVF_TX_DESC_CMD_RS | flags; - /* cross rx_thresh boundary is not allowed */ - nb_pkts = RTE_MIN(nb_pkts, txq->rs_thresh); - if (txq->nb_free < txq->free_thresh) iavf_tx_free_bufs(txq); @@ -1516,6 +1513,7 @@ iavf_xmit_pkts_vec_avx2(void *tx_queue, struct rte_mbuf **tx_pkts, while (nb_pkts) { uint16_t ret, num; + /* cross rs_thresh boundary is not allowed */ num = (uint16_t)RTE_MIN(nb_pkts, txq->rs_thresh); ret = iavf_xmit_fixed_burst_vec_avx2(tx_queue, &tx_pkts[nb_tx], num); diff --git a/drivers/net/iavf/iavf_rxtx_vec_avx512.c b/drivers/net/iavf/iavf_rxtx_vec_avx512.c index 6ff38ac368..7319d4cb65 100644 --- a/drivers/net/iavf/iavf_rxtx_vec_avx512.c +++ b/drivers/net/iavf/iavf_rxtx_vec_avx512.c @@ -1907,9 +1907,6 @@ iavf_xmit_fixed_burst_vec_avx512(void *tx_queue, struct rte_mbuf **tx_pkts, uint64_t flags = IAVF_TX_DESC_CMD_EOP | IAVF_TX_DESC_CMD_ICRC; uint64_t rs = IAVF_TX_DESC_CMD_RS | flags; - /* cross rx_thresh boundary is not allowed */ - nb_pkts = RTE_MIN(nb_pkts, txq->rs_thresh); - if (txq->nb_free < txq->free_thresh) iavf_tx_free_bufs_avx512(txq); @@ -1975,6 +1972,7 @@ iavf_xmit_pkts_vec_avx512_cmn(void *tx_queue, struct rte_mbuf **tx_pkts, while (nb_pkts) { uint16_t ret, num; + /* cross rs_thresh boundary is not allowed */ num = (uint16_t)RTE_MIN(nb_pkts, txq->rs_thresh); ret = iavf_xmit_fixed_burst_vec_avx512(tx_queue, &tx_pkts[nb_tx], num, offload); diff --git a/drivers/net/iavf/iavf_rxtx_vec_sse.c b/drivers/net/iavf/iavf_rxtx_vec_sse.c index d582a36326..717a227b2c 100644 --- a/drivers/net/iavf/iavf_rxtx_vec_sse.c +++ b/drivers/net/iavf/iavf_rxtx_vec_sse.c @@ -1120,9 +1120,6 @@ iavf_xmit_fixed_burst_vec(void *tx_queue, struct rte_mbuf **tx_pkts, uint64_t rs = IAVF_TX_DESC_CMD_RS | flags; int i; - /* cross rx_thresh boundary is not allowed */ - nb_pkts = RTE_MIN(nb_pkts, txq->rs_thresh); - if (txq->nb_free < txq->free_thresh) iavf_tx_free_bufs(txq); @@ -1189,6 +1186,7 @@ iavf_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts, while (nb_pkts) { uint16_t ret, num; + /* cross rs_thresh boundary is not allowed */ num = (uint16_t)RTE_MIN(nb_pkts, txq->rs_thresh); ret = iavf_xmit_fixed_burst_vec(tx_queue, &tx_pkts[nb_tx], num); nb_tx += ret; -- 2.27.0