Skip to content

Commit 268d089

Browse files
Michael Chandavem330
authored andcommitted
bnxt_en: Don't proceed in .ndo_set_rx_mode() when device is not in open state.
Check the BNXT_STATE_OPEN flag instead of netif_running() in bnxt_set_rx_mode(). If the driver is going through any reset, such as firmware reset or even TX timeout, it may not be ready to set the RX mode and may crash. The new rx mode settings will be picked up when the device is opened again later. Fixes: 230d1f0 ("bnxt_en: Handle firmware reset.") Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8f7baad commit 268d089

File tree

1 file changed

+5
-3
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9557,14 +9557,16 @@ static bool bnxt_uc_list_updated(struct bnxt *bp)
95579557
static void bnxt_set_rx_mode(struct net_device *dev)
95589558
{
95599559
struct bnxt *bp = netdev_priv(dev);
9560-
struct bnxt_vnic_info *vnic = &bp->vnic_info[0];
9561-
u32 mask = vnic->rx_mask;
9560+
struct bnxt_vnic_info *vnic;
95629561
bool mc_update = false;
95639562
bool uc_update;
9563+
u32 mask;
95649564

9565-
if (!netif_running(dev))
9565+
if (!test_bit(BNXT_STATE_OPEN, &bp->state))
95669566
return;
95679567

9568+
vnic = &bp->vnic_info[0];
9569+
mask = vnic->rx_mask;
95689570
mask &= ~(CFA_L2_SET_RX_MASK_REQ_MASK_PROMISCUOUS |
95699571
CFA_L2_SET_RX_MASK_REQ_MASK_MCAST |
95709572
CFA_L2_SET_RX_MASK_REQ_MASK_ALL_MCAST |

0 commit comments

Comments
 (0)