mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-11 09:46:46 +07:00
bnx2x: PFC fix
Fix a problem in which PFC frames are not honored, due to incorrect link attributes synchronization following PMF migration, and verify PFC XON is not stuck from previous link change. Signed-off-by: Yaniv Rosner <yanivr@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
857504d06d
commit
27d9129f5a
@ -1371,7 +1371,14 @@ static void bnx2x_update_pfc_xmac(struct link_params *params,
|
||||
pfc1_val |= XMAC_PFC_CTRL_HI_REG_PFC_REFRESH_EN |
|
||||
XMAC_PFC_CTRL_HI_REG_PFC_STATS_EN |
|
||||
XMAC_PFC_CTRL_HI_REG_RX_PFC_EN |
|
||||
XMAC_PFC_CTRL_HI_REG_TX_PFC_EN;
|
||||
XMAC_PFC_CTRL_HI_REG_TX_PFC_EN |
|
||||
XMAC_PFC_CTRL_HI_REG_FORCE_PFC_XON;
|
||||
/* Write pause and PFC registers */
|
||||
REG_WR(bp, xmac_base + XMAC_REG_PAUSE_CTRL, pause_val);
|
||||
REG_WR(bp, xmac_base + XMAC_REG_PFC_CTRL, pfc0_val);
|
||||
REG_WR(bp, xmac_base + XMAC_REG_PFC_CTRL_HI, pfc1_val);
|
||||
pfc1_val &= ~XMAC_PFC_CTRL_HI_REG_FORCE_PFC_XON;
|
||||
|
||||
}
|
||||
|
||||
/* Write pause and PFC registers */
|
||||
@ -6843,6 +6850,12 @@ int bnx2x_link_update(struct link_params *params, struct link_vars *vars)
|
||||
SINGLE_MEDIA_DIRECT(params)) &&
|
||||
(phy_vars[active_external_phy].fault_detected == 0));
|
||||
|
||||
/* Update the PFC configuration in case it was changed */
|
||||
if (params->feature_config_flags & FEATURE_CONFIG_PFC_ENABLED)
|
||||
vars->link_status |= LINK_STATUS_PFC_ENABLED;
|
||||
else
|
||||
vars->link_status &= ~LINK_STATUS_PFC_ENABLED;
|
||||
|
||||
if (vars->link_up)
|
||||
rc = bnx2x_update_link_up(params, vars, link_10g_plus);
|
||||
else
|
||||
@ -12049,6 +12062,9 @@ int bnx2x_phy_init(struct link_params *params, struct link_vars *vars)
|
||||
|
||||
bnx2x_emac_init(params, vars);
|
||||
|
||||
if (params->feature_config_flags & FEATURE_CONFIG_PFC_ENABLED)
|
||||
vars->link_status |= LINK_STATUS_PFC_ENABLED;
|
||||
|
||||
if (params->num_phys == 0) {
|
||||
DP(NETIF_MSG_LINK, "No phy found for initialization !!\n");
|
||||
return -EINVAL;
|
||||
|
@ -5354,6 +5354,7 @@
|
||||
#define XMAC_CTRL_REG_TX_EN (0x1<<0)
|
||||
#define XMAC_PAUSE_CTRL_REG_RX_PAUSE_EN (0x1<<18)
|
||||
#define XMAC_PAUSE_CTRL_REG_TX_PAUSE_EN (0x1<<17)
|
||||
#define XMAC_PFC_CTRL_HI_REG_FORCE_PFC_XON (0x1<<1)
|
||||
#define XMAC_PFC_CTRL_HI_REG_PFC_REFRESH_EN (0x1<<0)
|
||||
#define XMAC_PFC_CTRL_HI_REG_PFC_STATS_EN (0x1<<3)
|
||||
#define XMAC_PFC_CTRL_HI_REG_RX_PFC_EN (0x1<<4)
|
||||
|
Loading…
Reference in New Issue
Block a user