Commit 928df435 authored by Sudarsana Reddy Kalluru's avatar Sudarsana Reddy Kalluru Committed by Kleber Sacilotto de Souza

bnx2x: Fix receiving tx-timeout in error or recovery state.

BugLink: https://bugs.launchpad.net/bugs/1792377

[ Upstream commit 484c016d ]

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: default avatarSudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: default avatarAriel Elior <ariel.elior@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 6fc7fa4b
...@@ -1634,6 +1634,7 @@ struct bnx2x { ...@@ -1634,6 +1634,7 @@ struct bnx2x {
struct link_vars link_vars; struct link_vars link_vars;
u32 link_cnt; u32 link_cnt;
struct bnx2x_link_report_data last_reported_link; struct bnx2x_link_report_data last_reported_link;
bool force_link_down;
struct mdio_if_info mdio; struct mdio_if_info mdio;
......
...@@ -1277,6 +1277,11 @@ void __bnx2x_link_report(struct bnx2x *bp) ...@@ -1277,6 +1277,11 @@ void __bnx2x_link_report(struct bnx2x *bp)
{ {
struct bnx2x_link_report_data cur_data; struct bnx2x_link_report_data cur_data;
if (bp->force_link_down) {
bp->link_vars.link_up = 0;
return;
}
/* reread mf_cfg */ /* reread mf_cfg */
if (IS_PF(bp) && !CHIP_IS_E1(bp)) if (IS_PF(bp) && !CHIP_IS_E1(bp))
bnx2x_read_mf_cfg(bp); bnx2x_read_mf_cfg(bp);
...@@ -2840,6 +2845,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) ...@@ -2840,6 +2845,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
bp->pending_max = 0; bp->pending_max = 0;
} }
bp->force_link_down = false;
if (bp->port.pmf) { if (bp->port.pmf) {
rc = bnx2x_initial_phy_init(bp, load_mode); rc = bnx2x_initial_phy_init(bp, load_mode);
if (rc) if (rc)
......
...@@ -10222,6 +10222,12 @@ static void bnx2x_sp_rtnl_task(struct work_struct *work) ...@@ -10222,6 +10222,12 @@ static void bnx2x_sp_rtnl_task(struct work_struct *work)
bp->sp_rtnl_state = 0; bp->sp_rtnl_state = 0;
smp_mb(); smp_mb();
/* Immediately indicate link as down */
bp->link_vars.link_up = 0;
bp->force_link_down = true;
netif_carrier_off(bp->dev);
BNX2X_ERR("Indicating link is down due to Tx-timeout\n");
bnx2x_nic_unload(bp, UNLOAD_NORMAL, true); bnx2x_nic_unload(bp, UNLOAD_NORMAL, true);
bnx2x_nic_load(bp, LOAD_NORMAL); bnx2x_nic_load(bp, LOAD_NORMAL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment