On device close or startup errors, the transmit descriptor pool
was being left behind.
Fixes:
4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
failed:
PMD_INIT_LOG(NOTICE, "device init failed");
+ hn_tx_pool_uninit(eth_dev);
hn_detach(hv);
return err;
}
eth_dev->rx_pkt_burst = NULL;
hn_detach(hv);
+ hn_tx_pool_uninit(eth_dev);
rte_vmbus_chan_close(hv->primary->chan);
rte_free(hv->primary);
rte_eth_dev_owner_delete(hv->owner.id);
return 0;
}
+void
+hn_tx_pool_uninit(struct rte_eth_dev *dev)
+{
+ struct hn_data *hv = dev->data->dev_private;
+
+ if (hv->tx_pool) {
+ rte_mempool_free(hv->tx_pool);
+ hv->tx_pool = NULL;
+ }
+}
+
static void hn_reset_txagg(struct hn_tx_queue *txq)
{
txq->agg_szleft = txq->agg_szmax;
uint16_t nb_pkts);
int hn_tx_pool_init(struct rte_eth_dev *dev);
+void hn_tx_pool_uninit(struct rte_eth_dev *dev);
int hn_dev_link_update(struct rte_eth_dev *dev, int wait);
int hn_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
uint16_t nb_desc, unsigned int socket_id,