Skip to content

Commit ac98100

Browse files
Alexander DuyckJeff Kirsher
authored andcommitted
fm10k: Only trigger data path reset if fabric is up
This change makes it so that we only trigger the data path reset if the fabric is ready to handle traffic. The general idea is to avoid triggering the reset unless the switch API is ready for us. Otherwise we can just postpone the reset until we receive a switch ready notification. Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent 95f4f8d commit ac98100

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/net/ethernet/intel/fm10k/fm10k_pf.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ static s32 fm10k_reset_hw_pf(struct fm10k_hw *hw)
5959
if (reg & (FM10K_DMA_CTRL_TX_ACTIVE | FM10K_DMA_CTRL_RX_ACTIVE))
6060
return FM10K_ERR_DMA_PENDING;
6161

62+
/* verify the switch is ready for reset */
63+
reg = fm10k_read_reg(hw, FM10K_DMA_CTRL2);
64+
if (!(reg & FM10K_DMA_CTRL2_SWITCH_READY))
65+
goto out;
66+
6267
/* Inititate data path reset */
6368
reg |= FM10K_DMA_CTRL_DATAPATH_RESET;
6469
fm10k_write_reg(hw, FM10K_DMA_CTRL, reg);
@@ -72,6 +77,7 @@ static s32 fm10k_reset_hw_pf(struct fm10k_hw *hw)
7277
if (!(reg & FM10K_IP_NOTINRESET))
7378
err = FM10K_ERR_RESET_FAILED;
7479

80+
out:
7581
return err;
7682
}
7783

0 commit comments

Comments
 (0)