DPDK patches and discussions
 help / color / mirror / Atom feed
From: Feifei Wang <feifei.wang2@arm.com>
To: Beilei Xing <beilei.xing@intel.com>
Cc: dev@dpdk.org, nd@arm.com, Feifei Wang <feifei.wang2@arm.com>,
	Ruifeng Wang <ruifeng.wang@arm.com>
Subject: [PATCH 1/3] net/i40e: reduce redundant store operation
Date: Mon, 20 Dec 2021 13:50:37 +0800	[thread overview]
Message-ID: <20211220055039.4035627-2-feifei.wang2@arm.com> (raw)
In-Reply-To: <20211220055039.4035627-1-feifei.wang2@arm.com>

For free buffer operation in i40e driver, it is unnecessary to store
'NULL' into txep.mbuf. This is because when putting mbuf into Tx queue,
tx_tail is the sentinel. And when doing tx_free, tx_next_dd is the
sentinel. In all processes, mbuf==NULL is not a condition in check.
Thus reset of mbuf is unnecessary and can be omitted.

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 drivers/net/i40e/i40e_rxtx.c            | 3 ---
 drivers/net/i40e/i40e_rxtx_vec_common.h | 1 -
 2 files changed, 4 deletions(-)

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index e4cb33dc3c..4de2be53e6 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -1344,7 +1344,6 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq)
 			for (j = 0; j != k; j += RTE_I40E_TX_MAX_FREE_BUF_SZ) {
 				for (i = 0; i < RTE_I40E_TX_MAX_FREE_BUF_SZ; ++i, ++txep) {
 					free[i] = txep->mbuf;
-					txep->mbuf = NULL;
 				}
 				rte_mempool_put_bulk(free[0]->pool, (void **)free,
 						RTE_I40E_TX_MAX_FREE_BUF_SZ);
@@ -1354,14 +1353,12 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq)
 		if (m) {
 			for (i = 0; i < m; ++i, ++txep) {
 				free[i] = txep->mbuf;
-				txep->mbuf = NULL;
 			}
 			rte_mempool_put_bulk(free[0]->pool, (void **)free, m);
 		}
 	} else {
 		for (i = 0; i < txq->tx_rs_thresh; ++i, ++txep) {
 			rte_pktmbuf_free_seg(txep->mbuf);
-			txep->mbuf = NULL;
 		}
 	}
 
diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h b/drivers/net/i40e/i40e_rxtx_vec_common.h
index f9a7f46550..26deb59fc4 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_common.h
+++ b/drivers/net/i40e/i40e_rxtx_vec_common.h
@@ -103,7 +103,6 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq)
 	if (txq->offloads & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE) {
 		for (i = 0; i < n; i++) {
 			free[i] = txep[i].mbuf;
-			txep[i].mbuf = NULL;
 		}
 		rte_mempool_put_bulk(free[0]->pool, (void **)free, n);
 		goto done;
-- 
2.25.1


  reply	other threads:[~2021-12-20  5:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20  5:50 [PATCH 0/3] reduce redundant store operation for Tx free Feifei Wang
2021-12-20  5:50 ` Feifei Wang [this message]
2021-12-20  5:50 ` [PATCH 2/3] net/ice: reduce redundant store operation Feifei Wang
2021-12-20  5:50 ` [PATCH 3/3] net/ixgbe: " Feifei Wang
2021-12-20  7:24   ` Wang, Haiyue
2021-12-21  6:55     ` 回复: " Feifei Wang
2022-01-27  7:40 ` [PATCH v3] net/i40e: reduce redundant reset operation Feifei Wang
2022-01-28  6:54   ` Zhang, Qi Z

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=20211220055039.4035627-2-feifei.wang2@arm.com \
    --to=feifei.wang2@arm.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=nd@arm.com \
    --cc=ruifeng.wang@arm.com \
    /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).