Skip to content

Commit 2b5ea29

Browse files
committed
Merge branch 'bnxt_en-Bug-fixes'
Michael Chan says: ===================== bnxt_en: Bug fixes 3 patches that fix some issues in the firmware reset logic, starting with a small patch to refactor the code that re-enables SRIOV. The last patch fixes a TC queue mapping issue. ==================== Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 14b41a2 + 18e4960 commit 2b5ea29

File tree

1 file changed

+24
-13
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+24
-13
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7893,7 +7893,7 @@ static void bnxt_setup_msix(struct bnxt *bp)
78937893
int tcs, i;
78947894

78957895
tcs = netdev_get_num_tc(dev);
7896-
if (tcs > 1) {
7896+
if (tcs) {
78977897
int i, off, count;
78987898

78997899
for (i = 0; i < tcs; i++) {
@@ -9241,6 +9241,17 @@ void bnxt_half_close_nic(struct bnxt *bp)
92419241
bnxt_free_mem(bp, false);
92429242
}
92439243

9244+
static void bnxt_reenable_sriov(struct bnxt *bp)
9245+
{
9246+
if (BNXT_PF(bp)) {
9247+
struct bnxt_pf_info *pf = &bp->pf;
9248+
int n = pf->active_vfs;
9249+
9250+
if (n)
9251+
bnxt_cfg_hw_sriov(bp, &n, true);
9252+
}
9253+
}
9254+
92449255
static int bnxt_open(struct net_device *dev)
92459256
{
92469257
struct bnxt *bp = netdev_priv(dev);
@@ -9259,15 +9270,10 @@ static int bnxt_open(struct net_device *dev)
92599270
bnxt_hwrm_if_change(bp, false);
92609271
} else {
92619272
if (test_and_clear_bit(BNXT_STATE_FW_RESET_DET, &bp->state)) {
9262-
if (BNXT_PF(bp)) {
9263-
struct bnxt_pf_info *pf = &bp->pf;
9264-
int n = pf->active_vfs;
9265-
9266-
if (n)
9267-
bnxt_cfg_hw_sriov(bp, &n, true);
9268-
}
9269-
if (!test_bit(BNXT_STATE_IN_FW_RESET, &bp->state))
9273+
if (!test_bit(BNXT_STATE_IN_FW_RESET, &bp->state)) {
92709274
bnxt_ulp_start(bp, 0);
9275+
bnxt_reenable_sriov(bp);
9276+
}
92719277
}
92729278
bnxt_hwmon_open(bp);
92739279
}
@@ -9307,10 +9313,6 @@ static void __bnxt_close_nic(struct bnxt *bp, bool irq_re_init,
93079313
bnxt_debug_dev_exit(bp);
93089314
bnxt_disable_napi(bp);
93099315
del_timer_sync(&bp->timer);
9310-
if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state) &&
9311-
pci_is_enabled(bp->pdev))
9312-
pci_disable_device(bp->pdev);
9313-
93149316
bnxt_free_skbs(bp);
93159317

93169318
/* Save ring stats before shutdown */
@@ -10096,9 +10098,16 @@ static void bnxt_reset(struct bnxt *bp, bool silent)
1009610098
static void bnxt_fw_reset_close(struct bnxt *bp)
1009710099
{
1009810100
bnxt_ulp_stop(bp);
10101+
/* When firmware is fatal state, disable PCI device to prevent
10102+
* any potential bad DMAs before freeing kernel memory.
10103+
*/
10104+
if (test_bit(BNXT_STATE_FW_FATAL_COND, &bp->state))
10105+
pci_disable_device(bp->pdev);
1009910106
__bnxt_close_nic(bp, true, false);
1010010107
bnxt_clear_int_mode(bp);
1010110108
bnxt_hwrm_func_drv_unrgtr(bp);
10109+
if (pci_is_enabled(bp->pdev))
10110+
pci_disable_device(bp->pdev);
1010210111
bnxt_free_ctx_mem(bp);
1010310112
kfree(bp->ctx);
1010410113
bp->ctx = NULL;
@@ -10831,6 +10840,8 @@ static void bnxt_fw_reset_task(struct work_struct *work)
1083110840
smp_mb__before_atomic();
1083210841
clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
1083310842
bnxt_ulp_start(bp, rc);
10843+
if (!rc)
10844+
bnxt_reenable_sriov(bp);
1083410845
bnxt_dl_health_recovery_done(bp);
1083510846
bnxt_dl_health_status_update(bp, true);
1083610847
rtnl_unlock();

0 commit comments

Comments
 (0)