+/*
+ * Transmit completion function for use when DEV_TX_OFFLOAD_MBUF_FAST_FREE
+ * is enabled.
+ */
+static void bnxt_tx_cmp_fast(struct bnxt_tx_queue *txq, int nr_pkts)
+{
+ struct bnxt_tx_ring_info *txr = txq->tx_ring;
+ struct bnxt_ring *ring = txr->tx_ring_struct;
+ struct rte_mbuf **free = txq->free;
+ uint16_t raw_cons = txr->tx_raw_cons;
+ unsigned int blk = 0;
+ int i, j;
+
+ for (i = 0; i < nr_pkts; i++) {
+ struct rte_mbuf **tx_buf;
+ unsigned short nr_bds;
+
+ tx_buf = &txr->tx_buf_ring[RING_IDX(ring, raw_cons)];
+ nr_bds = (*tx_buf)->nb_segs +
+ bnxt_xmit_need_long_bd(*tx_buf, txq);
+ for (j = 0; j < nr_bds; j++) {
+ if (*tx_buf) {
+ /* Add mbuf to the bulk free array */
+ free[blk++] = *tx_buf;
+ *tx_buf = NULL;
+ }
+ raw_cons = RING_NEXT(raw_cons);
+ tx_buf = &txr->tx_buf_ring[RING_IDX(ring, raw_cons)];
+ }
+ }
+ if (blk)
+ rte_mempool_put_bulk(free[0]->pool, (void *)free, blk);
+
+ txr->tx_raw_cons = raw_cons;
+}
+