be2net: Issue COMMON_RESET_FUNCTION cmd during driver unload
authorSomnath Kotur <somnath.kotur@broadcom.com>
Wed, 7 Sep 2016 14:27:50 +0000 (19:57 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Sep 2016 05:44:55 +0000 (22:44 -0700)
As per SLI guideline, drivers need to issue COMMON_RESET_FUNCTION SLI
cmd during driver unload to clean up any non-persistent state
information.
Issue this cmd only if VFs are not assigned to VMs as it is possible
for PF driver to unload while it\'s VF remains functional and assigned
to a VM.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be_main.c

index 3be5d61aa8753f8d14f74f2b08fb5a9ccc15ab14..95d2fa3de0351e7cbc803c53e35817aece431f7c 100644 (file)
@@ -5706,6 +5706,9 @@ static void be_remove(struct pci_dev *pdev)
 
        be_clear(adapter);
 
+       if (!pci_vfs_assigned(adapter->pdev))
+               be_cmd_reset_function(adapter);
+
        /* tell fw we're done with firing cmds */
        be_cmd_fw_clean(adapter);