net/bnxt: support bulk free of Tx mbufs
[dpdk.git] / drivers / net / bnxt / bnxt_txq.c
index b9b975e..5a7bfaf 100644 (file)
@@ -69,6 +69,7 @@ void bnxt_tx_queue_release_op(void *tx_queue)
                rte_memzone_free(txq->mz);
                txq->mz = NULL;
 
+               rte_free(txq->free);
                rte_free(txq);
        }
 }
@@ -110,6 +111,16 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
                rc = -ENOMEM;
                goto out;
        }
+
+       txq->free = rte_zmalloc_socket(NULL,
+                                      sizeof(struct rte_mbuf *) * nb_desc,
+                                      RTE_CACHE_LINE_SIZE, socket_id);
+       if (!txq->free) {
+               PMD_DRV_LOG(ERR, "allocation of tx mbuf free array failed!");
+               rte_free(txq);
+               rc = -ENOMEM;
+               goto out;
+       }
        txq->bp = bp;
        txq->nb_tx_desc = nb_desc;
        txq->tx_free_thresh = tx_conf->tx_free_thresh;