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.wa...@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.w...@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 via email to