Skip to content

Commit 484c016

Browse files
Sudarsana Reddy Kallurudavem330
authored andcommitted
bnx2x: Fix receiving tx-timeout in error or recovery state.
Driver performs the internal reload when it receives tx-timeout event from the OS. Internal reload might fail in some scenarios e.g., fatal HW issues. In such cases OS still see the link, which would result in undesirable functionalities such as re-generation of tx-timeouts. The patch addresses this issue by indicating the link-down to OS when tx-timeout is detected, and keeping the link in down state till the internal reload is successful. Please consider applying it to 'net' branch. Signed-off-by: Sudarsana Reddy Kalluru <[email protected]> Signed-off-by: Ariel Elior <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5037c62 commit 484c016

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

drivers/net/ethernet/broadcom/bnx2x/bnx2x.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,6 +1533,7 @@ struct bnx2x {
15331533
struct link_vars link_vars;
15341534
u32 link_cnt;
15351535
struct bnx2x_link_report_data last_reported_link;
1536+
bool force_link_down;
15361537

15371538
struct mdio_if_info mdio;
15381539

drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,11 @@ void __bnx2x_link_report(struct bnx2x *bp)
12611261
{
12621262
struct bnx2x_link_report_data cur_data;
12631263

1264+
if (bp->force_link_down) {
1265+
bp->link_vars.link_up = 0;
1266+
return;
1267+
}
1268+
12641269
/* reread mf_cfg */
12651270
if (IS_PF(bp) && !CHIP_IS_E1(bp))
12661271
bnx2x_read_mf_cfg(bp);
@@ -2817,6 +2822,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
28172822
bp->pending_max = 0;
28182823
}
28192824

2825+
bp->force_link_down = false;
28202826
if (bp->port.pmf) {
28212827
rc = bnx2x_initial_phy_init(bp, load_mode);
28222828
if (rc)

drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10279,6 +10279,12 @@ static void bnx2x_sp_rtnl_task(struct work_struct *work)
1027910279
bp->sp_rtnl_state = 0;
1028010280
smp_mb();
1028110281

10282+
/* Immediately indicate link as down */
10283+
bp->link_vars.link_up = 0;
10284+
bp->force_link_down = true;
10285+
netif_carrier_off(bp->dev);
10286+
BNX2X_ERR("Indicating link is down due to Tx-timeout\n");
10287+
1028210288
bnx2x_nic_unload(bp, UNLOAD_NORMAL, true);
1028310289
/* When ret value shows failure of allocation failure,
1028410290
* the nic is rebooted again. If open still fails, a error

0 commit comments

Comments
 (0)