be2net: Cleanup the VF interface handles
authorAjit Khaparde <ajit.khaparde@emulex.com>
Fri, 11 Feb 2011 13:35:56 +0000 (13:35 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 12 Feb 2011 05:14:45 +0000 (21:14 -0800)
The PF needs to cleanup all the interface handles that it created for the VFs.

Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/benet/be_main.c

index 48eef9e2ed94434558a18c82995dc1743d663769..fc119d1f542bb3cdc20aee3f482dbdff4ae6ab58 100644 (file)
@@ -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 */