aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
diff options
context:
space:
mode:
authorMichael Chan <michael.chan@broadcom.com>2019-08-29 23:54:56 -0400
committerDavid S. Miller <davem@davemloft.net>2019-08-30 14:02:19 -0700
commit3bc7d4a352efe5b596883ef16b769055320db1f6 (patch)
tree684345372254205bd5517393872ed8cb02c7304b /drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
parentbnxt_en: Enable health monitoring. (diff)
downloadlinux-dev-3bc7d4a352efe5b596883ef16b769055320db1f6.tar.xz
linux-dev-3bc7d4a352efe5b596883ef16b769055320db1f6.zip
bnxt_en: Add BNXT_STATE_IN_FW_RESET state.
The new flag will be set in subsequent patches when firmware is going through reset. If bnxt_close() is called while the new flag is set, the FW reset sequence will have to be aborted because the NIC is prematurely closed before FW reset has completed. We also reject SRIOV configurations while FW reset is in progress. v2: No longer drop rtnl_lock() in close and wait for FW reset to complete. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c')
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
index ac890ca9feb1..4aacfc33a8cc 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
@@ -828,6 +828,11 @@ int bnxt_sriov_configure(struct pci_dev *pdev, int num_vfs)
rtnl_unlock();
return 0;
}
+ if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state)) {
+ netdev_warn(dev, "Reject SRIOV config request when FW reset is in progress\n");
+ rtnl_unlock();
+ return 0;
+ }
bp->sriov_cfg = true;
rtnl_unlock();