aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorYaniv Rosner <yanivr@broadcom.com>2012-04-03 21:28:54 -0400
committerDavid S. Miller <davem@davemloft.net>2012-04-04 18:24:22 -0400
commit27d9129f5ae830cc031a898e0c220e1cdda69b34 (patch)
tree10055562856cae3abbdbf90471f9a4d9e1e8f145 /drivers
parent857504d06d565ad5b401d505937932775ddf1c47 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c18
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h1
2 files changed, 18 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index efa557b76ac7..7e2ebbad7587 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -1371,7 +1371,14 @@ static void bnx2x_update_pfc_xmac(struct link_params *params,
1371 pfc1_val |= XMAC_PFC_CTRL_HI_REG_PFC_REFRESH_EN | 1371 pfc1_val |= XMAC_PFC_CTRL_HI_REG_PFC_REFRESH_EN |
1372 XMAC_PFC_CTRL_HI_REG_PFC_STATS_EN | 1372 XMAC_PFC_CTRL_HI_REG_PFC_STATS_EN |
1373 XMAC_PFC_CTRL_HI_REG_RX_PFC_EN | 1373 XMAC_PFC_CTRL_HI_REG_RX_PFC_EN |
1374 XMAC_PFC_CTRL_HI_REG_TX_PFC_EN; 1374 XMAC_PFC_CTRL_HI_REG_TX_PFC_EN |
1375 XMAC_PFC_CTRL_HI_REG_FORCE_PFC_XON;
1376 /* Write pause and PFC registers */
1377 REG_WR(bp, xmac_base + XMAC_REG_PAUSE_CTRL, pause_val);
1378 REG_WR(bp, xmac_base + XMAC_REG_PFC_CTRL, pfc0_val);
1379 REG_WR(bp, xmac_base + XMAC_REG_PFC_CTRL_HI, pfc1_val);
1380 pfc1_val &= ~XMAC_PFC_CTRL_HI_REG_FORCE_PFC_XON;
1381
1375 } 1382 }
1376 1383
1377 /* Write pause and PFC registers */ 1384 /* Write pause and PFC registers */
@@ -6843,6 +6850,12 @@ int bnx2x_link_update(struct link_params *params, struct link_vars *vars)
6843 SINGLE_MEDIA_DIRECT(params)) && 6850 SINGLE_MEDIA_DIRECT(params)) &&
6844 (phy_vars[active_external_phy].fault_detected == 0)); 6851 (phy_vars[active_external_phy].fault_detected == 0));
6845 6852
6853 /* Update the PFC configuration in case it was changed */
6854 if (params->feature_config_flags & FEATURE_CONFIG_PFC_ENABLED)
6855 vars->link_status |= LINK_STATUS_PFC_ENABLED;
6856 else
6857 vars->link_status &= ~LINK_STATUS_PFC_ENABLED;
6858
6846 if (vars->link_up) 6859 if (vars->link_up)
6847 rc = bnx2x_update_link_up(params, vars, link_10g_plus); 6860 rc = bnx2x_update_link_up(params, vars, link_10g_plus);
6848 else 6861 else
@@ -12049,6 +12062,9 @@ int bnx2x_phy_init(struct link_params *params, struct link_vars *vars)
12049 12062
12050 bnx2x_emac_init(params, vars); 12063 bnx2x_emac_init(params, vars);
12051 12064
12065 if (params->feature_config_flags & FEATURE_CONFIG_PFC_ENABLED)
12066 vars->link_status |= LINK_STATUS_PFC_ENABLED;
12067
12052 if (params->num_phys == 0) { 12068 if (params->num_phys == 0) {
12053 DP(NETIF_MSG_LINK, "No phy found for initialization !!\n"); 12069 DP(NETIF_MSG_LINK, "No phy found for initialization !!\n");
12054 return -EINVAL; 12070 return -EINVAL;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
index ab0a250f95fa..ecc7fa6a6ca5 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
@@ -5354,6 +5354,7 @@
5354#define XMAC_CTRL_REG_TX_EN (0x1<<0) 5354#define XMAC_CTRL_REG_TX_EN (0x1<<0)
5355#define XMAC_PAUSE_CTRL_REG_RX_PAUSE_EN (0x1<<18) 5355#define XMAC_PAUSE_CTRL_REG_RX_PAUSE_EN (0x1<<18)
5356#define XMAC_PAUSE_CTRL_REG_TX_PAUSE_EN (0x1<<17) 5356#define XMAC_PAUSE_CTRL_REG_TX_PAUSE_EN (0x1<<17)
5357#define XMAC_PFC_CTRL_HI_REG_FORCE_PFC_XON (0x1<<1)
5357#define XMAC_PFC_CTRL_HI_REG_PFC_REFRESH_EN (0x1<<0) 5358#define XMAC_PFC_CTRL_HI_REG_PFC_REFRESH_EN (0x1<<0)
5358#define XMAC_PFC_CTRL_HI_REG_PFC_STATS_EN (0x1<<3) 5359#define XMAC_PFC_CTRL_HI_REG_PFC_STATS_EN (0x1<<3)
5359#define XMAC_PFC_CTRL_HI_REG_RX_PFC_EN (0x1<<4) 5360#define XMAC_PFC_CTRL_HI_REG_RX_PFC_EN (0x1<<4)