From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 30FB9A04EF for ; Tue, 2 Jun 2020 03:33:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E336F1BF44; Tue, 2 Jun 2020 03:33:45 +0200 (CEST) Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) by dpdk.org (Postfix) with ESMTP id E1E171BF44 for ; Tue, 2 Jun 2020 03:33:43 +0200 (CEST) Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 239C34B4D74B687D1F1B for ; Tue, 2 Jun 2020 09:29:46 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Tue, 2 Jun 2020 09:29:37 +0800 From: "Wei Hu (Xavier)" To: CC: , Date: Tue, 2 Jun 2020 09:28:03 +0800 Message-ID: <1591061288-39518-2-git-send-email-xavier.huwei@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1591061288-39518-1-git-send-email-xavier.huwei@huawei.com> References: <1591061288-39518-1-git-send-email-xavier.huwei@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-stable] [PATCH 19.11 v2 1/5] net/hns3: remove unnecessary assignments in Tx X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" [ upstream commit 27f97077853de6f6f55f3d9411657d57809f0123 ] This patch removes the unnecessary assignment in the '.tx_pkt_burst' ops implementation function to avoid performance loss. Signed-off-by: Wei Hu (Xavier) Signed-off-by: Yisen Zhuang --- drivers/net/hns3/hns3_rxtx.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index a0fcb4c..44e883e 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -1686,8 +1686,7 @@ hns3_tx_free_useless_buffer(struct hns3_tx_queue *txq) (tx_next_use != tx_next_clean || tx_bd_ready < tx_bd_max)) { mbuf = tx_bak_pkt->mbuf; if (mbuf) { - mbuf->next = NULL; - rte_pktmbuf_free(mbuf); + rte_pktmbuf_free_seg(mbuf); tx_bak_pkt->mbuf = NULL; } @@ -2105,9 +2104,7 @@ hns3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) struct rte_mbuf *new_pkt; struct rte_mbuf *tx_pkt; struct rte_mbuf *m_seg; - struct rte_mbuf *temp; uint32_t nb_hold = 0; - uint16_t tx_next_clean; uint16_t tx_next_use; uint16_t tx_bd_ready; uint16_t tx_pkt_num; @@ -2122,11 +2119,8 @@ hns3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) if (tx_bd_ready == 0) return 0; - tx_next_clean = txq->next_to_clean; tx_next_use = txq->next_to_use; tx_bd_max = txq->nb_tx_desc; - tx_bak_pkt = &txq->sw_ring[tx_next_clean]; - tx_pkt_num = (tx_bd_ready < nb_pkts) ? tx_bd_ready : nb_pkts; /* send packets */ @@ -2181,9 +2175,8 @@ hns3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) i = 0; do { fill_desc(txq, tx_next_use, m_seg, (i == 0), 0); - temp = m_seg->next; tx_bak_pkt->mbuf = m_seg; - m_seg = temp; + m_seg = m_seg->next; tx_next_use++; tx_bak_pkt++; if (tx_next_use >= tx_bd_max) { @@ -2202,7 +2195,6 @@ hns3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) if (likely(nb_tx)) { hns3_queue_xmit(txq, nb_hold); - txq->next_to_clean = tx_next_clean; txq->tx_bd_ready = tx_bd_ready - nb_hold; } -- 2.7.4