[dpdk-dev,RFC,V3,2/5] i40e: release vmdq vsi's in dev_close
diff mbox

Message ID 1433924825-3717-3-git-send-email-bernard.iremonger@intel.com
State Superseded, archived
Headers show

Commit Message

Iremonger, Bernard June 10, 2015, 8:27 a.m. UTC
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

Patch
diff mbox

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7bf9532..55fee6b 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1037,6 +1037,7 @@  i40e_dev_close(struct rte_eth_dev *dev)
 	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint32_t reg;
+	int i;
 
 	PMD_INIT_FUNC_TRACE();
 
@@ -1054,6 +1055,14 @@  i40e_dev_close(struct rte_eth_dev *dev)
 	i40e_fdir_teardown(pf);
 	i40e_vsi_release(pf->main_vsi);
 
+	for (i = 0; i < pf->nb_cfg_vmdq_vsi; i++) {
+		i40e_vsi_release(pf->vmdq[i].vsi);
+		pf->vmdq[i].vsi = NULL;
+	}
+
+	rte_free(pf->vmdq);
+	pf->vmdq = NULL;
+
 	/* shutdown the adminq */
 	i40e_aq_queue_shutdown(hw, true);
 	i40e_shutdown_adminq(hw);