Skip to content

Commit

Permalink
bnx2x: Prevent "timeout waiting for state X"
Browse files Browse the repository at this point in the history
Current driver release rtnl lock in between DCB re-configuration.
As a result, other flows (e.g., mtu config) may enter in between and fail
due to halted tx path for dcb configuration.

Signed-off-by: Dmitry Kravkov <[email protected]>
Signed-off-by: Yuval Mintz <[email protected]>
Signed-off-by: Ariel Elior <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Dmitry Kravkov authored and davem330 committed Nov 18, 2013
1 parent ffa1cb9 commit 6ffa39f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
1 change: 0 additions & 1 deletion drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,6 @@ enum {
BNX2X_SP_RTNL_RX_MODE,
BNX2X_SP_RTNL_HYPERVISOR_VLAN,
BNX2X_SP_RTNL_TX_STOP,
BNX2X_SP_RTNL_TX_RESUME,
};

struct bnx2x_prev_path_list {
Expand Down
5 changes: 0 additions & 5 deletions drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,11 +778,6 @@ void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state)

/* ets may affect cmng configuration: reinit it in hw */
bnx2x_set_local_cmng(bp);

set_bit(BNX2X_SP_RTNL_TX_RESUME, &bp->sp_rtnl_state);

schedule_delayed_work(&bp->sp_rtnl_task, 0);

return;
case BNX2X_DCBX_STATE_TX_RELEASED:
DP(BNX2X_MSG_DCB, "BNX2X_DCBX_STATE_TX_RELEASED\n");
Expand Down
9 changes: 4 additions & 5 deletions drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5235,18 +5235,18 @@ static void bnx2x_eq_int(struct bnx2x *bp)

case EVENT_RING_OPCODE_STOP_TRAFFIC:
DP(BNX2X_MSG_SP | BNX2X_MSG_DCB, "got STOP TRAFFIC\n");
bnx2x_dcbx_set_params(bp, BNX2X_DCBX_STATE_TX_PAUSED);
if (f_obj->complete_cmd(bp, f_obj,
BNX2X_F_CMD_TX_STOP))
break;
bnx2x_dcbx_set_params(bp, BNX2X_DCBX_STATE_TX_PAUSED);
goto next_spqe;

case EVENT_RING_OPCODE_START_TRAFFIC:
DP(BNX2X_MSG_SP | BNX2X_MSG_DCB, "got START TRAFFIC\n");
bnx2x_dcbx_set_params(bp, BNX2X_DCBX_STATE_TX_RELEASED);
if (f_obj->complete_cmd(bp, f_obj,
BNX2X_F_CMD_TX_START))
break;
bnx2x_dcbx_set_params(bp, BNX2X_DCBX_STATE_TX_RELEASED);
goto next_spqe;

case EVENT_RING_OPCODE_FUNCTION_UPDATE:
Expand Down Expand Up @@ -9714,11 +9714,10 @@ static void bnx2x_sp_rtnl_task(struct work_struct *work)
&bp->sp_rtnl_state))
bnx2x_pf_set_vfs_vlan(bp);

if (test_and_clear_bit(BNX2X_SP_RTNL_TX_STOP, &bp->sp_rtnl_state))
if (test_and_clear_bit(BNX2X_SP_RTNL_TX_STOP, &bp->sp_rtnl_state)) {
bnx2x_dcbx_stop_hw_tx(bp);

if (test_and_clear_bit(BNX2X_SP_RTNL_TX_RESUME, &bp->sp_rtnl_state))
bnx2x_dcbx_resume_hw_tx(bp);
}

/* work which needs rtnl lock not-taken (as it takes the lock itself and
* can be called from other contexts as well)
Expand Down

0 comments on commit 6ffa39f

Please sign in to comment.