patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
To: <luca.boccassi@gmail.com>
Cc: <stable@dpdk.org>, <xavier.huwei@huawei.com>
Subject: [dpdk-stable] [PATCH 19.11 v2 1/5] net/hns3: remove unnecessary assignments in Tx
Date: Tue, 2 Jun 2020 09:28:03 +0800	[thread overview]
Message-ID: <1591061288-39518-2-git-send-email-xavier.huwei@huawei.com> (raw)
In-Reply-To: <1591061288-39518-1-git-send-email-xavier.huwei@huawei.com>

[ 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) <xavier.huwei@huawei.com>
Signed-off-by: Yisen Zhuang <yisen.zhuang@huawei.com>
---
 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


  reply	other threads:[~2020-06-02  1:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-02  1:28 [dpdk-stable] [PATCH 19.11 v2 0/5] improving I/O backport for hns3 PMD driver Wei Hu (Xavier)
2020-06-02  1:28 ` Wei Hu (Xavier) [this message]
2020-06-02  1:28 ` [dpdk-stable] [PATCH 19.11 v2 2/5] net/hns3: reduce judgements of free Tx ring space Wei Hu (Xavier)
2020-06-02  1:28 ` [dpdk-stable] [PATCH 19.11 v2 3/5] net/hns3: remove one IO barrier in Rx Wei Hu (Xavier)
2020-06-02  1:28 ` [dpdk-stable] [PATCH 19.11 v2 4/5] net/hns3: add free threshold " Wei Hu (Xavier)
2020-06-02  1:28 ` [dpdk-stable] [PATCH 19.11 v2 5/5] net/hns3: replace memory barrier with data dependency order Wei Hu (Xavier)
2020-06-02 13:27 ` [dpdk-stable] [PATCH 19.11 v2 0/5] improving I/O backport for hns3 PMD driver Luca Boccassi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1591061288-39518-2-git-send-email-xavier.huwei@huawei.com \
    --to=xavier.huwei@huawei.com \
    --cc=luca.boccassi@gmail.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).