Skip to content

Commit 21fe14f

Browse files
Sudarsana Reddy Kallurugregkh
authored andcommitted
bnx2x: Fix receiving tx-timeout in error or recovery state.
[ Upstream commit 484c016 ] 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]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3b8eeae commit 21fe14f

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
@@ -1529,6 +1529,7 @@ struct bnx2x {
15291529
struct link_vars link_vars;
15301530
u32 link_cnt;
15311531
struct bnx2x_link_report_data last_reported_link;
1532+
bool force_link_down;
15321533

15331534
struct mdio_if_info mdio;
15341535

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,6 +1265,11 @@ void __bnx2x_link_report(struct bnx2x *bp)
12651265
{
12661266
struct bnx2x_link_report_data cur_data;
12671267

1268+
if (bp->force_link_down) {
1269+
bp->link_vars.link_up = 0;
1270+
return;
1271+
}
1272+
12681273
/* reread mf_cfg */
12691274
if (IS_PF(bp) && !CHIP_IS_E1(bp))
12701275
bnx2x_read_mf_cfg(bp);
@@ -2822,6 +2827,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
28222827
bp->pending_max = 0;
28232828
}
28242829

2830+
bp->force_link_down = false;
28252831
if (bp->port.pmf) {
28262832
rc = bnx2x_initial_phy_init(bp, load_mode);
28272833
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
bnx2x_nic_load(bp, LOAD_NORMAL);
1028410290

0 commit comments

Comments
 (0)