From b9c0dea24beb4b893e88d93c1b52481003ff8999 Mon Sep 17 00:00:00 2001 From: Tonghao Zhang Date: Tue, 10 Apr 2018 21:34:28 -0700 Subject: [PATCH] net/bonding: free mempool used in mode 6 When creating bond device with mode6, dpdk will create mempool for arp packets. If free the bond device and create it with same name, there will be an error. Because the mempool is not freed when destroying bond device. Fixes: 06fe78b98ccd ("bond: add mode 6") Fixes: ea0c20ea95fd ("apps: use helper to create mbuf pools") Cc: stable@dpdk.org Signed-off-by: Tonghao Zhang Reviewed-by: Ferruh Yigit --- drivers/net/bonding/rte_eth_bond_pmd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 8847d20c23..815e0e4c70 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -3145,6 +3145,10 @@ bond_remove(struct rte_vdev_device *dev) eth_dev->tx_pkt_burst = NULL; internals = eth_dev->data->dev_private; + /* Try to release mempool used in mode6. If the bond + * device is not mode6, free the NULL is not problem. + */ + rte_mempool_free(internals->mode6.mempool); rte_bitmap_free(internals->vlan_filter_bmp); rte_free(internals->vlan_filter_bmpmem); rte_free(eth_dev->data->dev_private); -- 2.20.1