[PATCH 2/3] net/ice: reduce redundant store operation
Feifei Wang
feifei.wang2 at arm.com
Mon Dec 20 06:50:38 CET 2021
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 at arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang at arm.com>
---
drivers/net/ice/ice_rxtx.c | 2 --
1 file changed, 2 deletions(-)
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;
}
}
--
2.25.1
More information about the dev
mailing list