Use a put() rather than a free() in the optimized case.
Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
---
doc/guides/nics/features/ionic.ini | 1 +
doc/guides/rel_notes/release_22_11.rst | 1 +
drivers/net/ionic/ionic_ethdev.c | 2 +-
drivers/net/ionic/ionic_lif.h | 1 +
drivers/net/ionic/ionic_rxtx.c | 9 ++++++++-
5 files changed, 12 insertions(+), 2 deletions(-)
@@ -7,6 +7,7 @@
Speed capabilities = Y
Link status = Y
Link status event = Y
+Fast mbuf free = Y
Queue start/stop = Y
MTU update = Y
Scattered Rx = Y
@@ -84,6 +84,7 @@ New Features
* Updated to reflect that Pensando has been acquired by AMD.
* Enhanced data path to provide substantial performance improvements.
+ * Added support for mbuf fast free.
Removed Items
-------------
@@ -396,7 +396,7 @@ ionic_dev_info_get(struct rte_eth_dev *eth_dev,
*/
dev_info->rx_queue_offload_capa = 0;
- dev_info->tx_queue_offload_capa = 0;
+ dev_info->tx_queue_offload_capa = RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;
/*
* Per-port capabilities
@@ -50,6 +50,7 @@ struct ionic_rx_stats {
#define IONIC_QCQ_F_CSUM_L3 BIT(7)
#define IONIC_QCQ_F_CSUM_UDP BIT(8)
#define IONIC_QCQ_F_CSUM_TCP BIT(9)
+#define IONIC_QCQ_F_FAST_FREE BIT(10)
/* Queue / Completion Queue */
struct ionic_qcq {
@@ -94,6 +94,8 @@ ionic_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
qinfo->nb_desc = q->num_descs;
qinfo->conf.offloads = dev->data->dev_conf.txmode.offloads;
+ if (txq->flags & IONIC_QCQ_F_FAST_FREE)
+ qinfo->conf.offloads |= RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;
qinfo->conf.tx_deferred_start = txq->flags & IONIC_QCQ_F_DEFERRED;
}
@@ -136,7 +138,10 @@ ionic_tx_flush(struct ionic_tx_qcq *txq)
if (!txm)
break;
- rte_pktmbuf_free_seg(txm);
+ if (txq->flags & IONIC_QCQ_F_FAST_FREE)
+ rte_mempool_put(txm->pool, txm);
+ else
+ rte_pktmbuf_free_seg(txm);
info[i] = NULL;
}
@@ -240,6 +245,8 @@ ionic_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id,
txq->flags |= IONIC_QCQ_F_CSUM_TCP;
if (offloads & RTE_ETH_TX_OFFLOAD_UDP_CKSUM)
txq->flags |= IONIC_QCQ_F_CSUM_UDP;
+ if (offloads & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE)
+ txq->flags |= IONIC_QCQ_F_FAST_FREE;
eth_dev->data->tx_queues[tx_queue_id] = txq;