[2/3] net/ice: reduce redundant store operation

Message ID 20211220055039.4035627-3-feifei.wang2@arm.com (mailing list archive)
State Superseded, archived
Headers
Series reduce redundant store operation for Tx free |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Feifei Wang Dec. 20, 2021, 5:50 a.m. UTC
  For free buffer in ice 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/ice/ice_rxtx.c | 2 --
 1 file changed, 2 deletions(-)
  

Patch

diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index f6d8564ab8..e043335bad 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -2893,12 +2893,10 @@  ice_tx_free_bufs(struct ice_tx_queue *txq)
 	if (txq->offloads & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE) {
 		for (i = 0; i < txq->tx_rs_thresh; ++i, ++txep) {
 			rte_mempool_put(txep->mbuf->pool, txep->mbuf);
-			txep->mbuf = NULL;
 		}
 	} else {
 		for (i = 0; i < txq->tx_rs_thresh; ++i, ++txep) {
 			rte_pktmbuf_free_seg(txep->mbuf);
-			txep->mbuf = NULL;
 		}
 	}