[dpdk-dev,1/2] net/bonding: free mempool used in mode6

Message ID 1523421269-7394-1-git-send-email-xiangxia.m.yue@gmail.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Tonghao Zhang April 11, 2018, 4:34 a.m. UTC
  From: Tonghao Zhang <xiangxia.m.yue@gmail.com>

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: 06fe78b9 ("bond: add mode 6")
Fixes: ea0c20ea ("apps: use helper to create mbuf pools")
Cc: stable@dpdk.org
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Ferruh Yigit April 13, 2018, 5:25 p.m. UTC | #1
On 4/11/2018 5:34 AM, xiangxia.m.yue@gmail.com wrote:
> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> 
> 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: 06fe78b9 ("bond: add mode 6")
> Fixes: ea0c20ea ("apps: use helper to create mbuf pools")
> Cc: stable@dpdk.org
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>

For series,
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Ferruh Yigit April 13, 2018, 5:26 p.m. UTC | #2
On 4/13/2018 6:25 PM, Ferruh Yigit wrote:
> On 4/11/2018 5:34 AM, xiangxia.m.yue@gmail.com wrote:
>> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
>>
>> 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: 06fe78b9 ("bond: add mode 6")
>> Fixes: ea0c20ea ("apps: use helper to create mbuf pools")
>> Cc: stable@dpdk.org
>> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> 
> For series,
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Series applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 9b02850..4bc2a01 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3127,6 +3127,10 @@  struct bwg_slave {
 	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);