Patchwork [net-next,06/15] be2net: Cleanup the VF interface handles

login
register
mail settings
Submitter Ajit Khaparde
Date Feb. 11, 2011, 11:35 p.m.
Message ID <20110211233556.GA18372@akhaparde-VBox>
Download mbox | patch
Permalink /patch/82860/
State Accepted
Delegated to: David Miller
Headers show

Comments

Ajit Khaparde - Feb. 11, 2011, 11:35 p.m.
The PF needs to cleanup all the interface handles that it created for the VFs.

Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
---
 drivers/net/benet/be_main.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

Patch

diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 48eef9e..fc119d1 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -2340,6 +2340,8 @@  do_none:
 
 static int be_clear(struct be_adapter *adapter)
 {
+	int vf;
+
 	if (be_physfn(adapter) && adapter->sriov_enabled)
 		be_vf_eth_addr_rem(adapter);
 
@@ -2347,6 +2349,13 @@  static int be_clear(struct be_adapter *adapter)
 	be_rx_queues_destroy(adapter);
 	be_tx_queues_destroy(adapter);
 
+	if (be_physfn(adapter) && adapter->sriov_enabled)
+		for (vf = 0; vf < num_vfs; vf++)
+			if (adapter->vf_cfg[vf].vf_if_handle)
+				be_cmd_if_destroy(adapter,
+					adapter->vf_cfg[vf].vf_if_handle,
+					vf + 1);
+
 	be_cmd_if_destroy(adapter, adapter->if_handle,  0);
 
 	/* tell fw we're done with firing cmds */