aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
diff options
context:
space:
mode:
authorBarak Witkowski <barak@broadcom.com>2012-12-01 23:05:47 -0500
committerDavid S. Miller <davem@davemloft.net>2012-12-02 20:22:59 -0500
commit4c704899328bcb448d9c7fa709777b3e28e05f6a (patch)
tree853fd359986c0169e9852113e4d9a2fe60e7e975 /drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
parentc55e771b7e6274f7e12d5bcaa8e7dec8a1e41c42 (diff)
bnx2x: Management can control PFC/ETS
If configured for PFC/ETS by management, configure chip regardless of the presence of a remote peer which supports DCBX. Signed-off-by: Barak Witkowski <barak@broadcom.com> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
index cba4a16ab86a..c0d9b6947d97 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
@@ -413,8 +413,11 @@ static int bnx2x_dcbx_read_mib(struct bnx2x *bp,
413 413
414static void bnx2x_pfc_set_pfc(struct bnx2x *bp) 414static void bnx2x_pfc_set_pfc(struct bnx2x *bp)
415{ 415{
416 int mfw_configured = SHMEM2_HAS(bp, drv_flags) &&
417 GET_FLAGS(SHMEM2_RD(bp, drv_flags),
418 1 << DRV_FLAGS_DCB_MFW_CONFIGURED);
416 if (bp->dcbx_port_params.pfc.enabled && 419 if (bp->dcbx_port_params.pfc.enabled &&
417 !(bp->dcbx_error & DCBX_REMOTE_MIB_ERROR)) 420 (!(bp->dcbx_error & DCBX_REMOTE_MIB_ERROR) || mfw_configured))
418 /* 421 /*
419 * 1. Fills up common PFC structures if required 422 * 1. Fills up common PFC structures if required
420 * 2. Configure NIG, MAC and BRB via the elink 423 * 2. Configure NIG, MAC and BRB via the elink
@@ -552,10 +555,13 @@ static void bnx2x_dcbx_update_ets_config(struct bnx2x *bp)
552 555
553static void bnx2x_dcbx_update_ets_params(struct bnx2x *bp) 556static void bnx2x_dcbx_update_ets_params(struct bnx2x *bp)
554{ 557{
558 int mfw_configured = SHMEM2_HAS(bp, drv_flags) &&
559 GET_FLAGS(SHMEM2_RD(bp, drv_flags),
560 1 << DRV_FLAGS_DCB_MFW_CONFIGURED);
555 bnx2x_ets_disabled(&bp->link_params, &bp->link_vars); 561 bnx2x_ets_disabled(&bp->link_params, &bp->link_vars);
556 562
557 if (!bp->dcbx_port_params.ets.enabled || 563 if (!bp->dcbx_port_params.ets.enabled ||
558 (bp->dcbx_error & DCBX_REMOTE_MIB_ERROR)) 564 ((bp->dcbx_error & DCBX_REMOTE_MIB_ERROR) && !mfw_configured))
559 return; 565 return;
560 566
561 if (CHIP_IS_E3B0(bp)) 567 if (CHIP_IS_E3B0(bp))
@@ -1802,11 +1808,14 @@ static void bnx2x_dcbx_fw_struct(struct bnx2x *bp,
1802 u8 cos = 0, pri = 0; 1808 u8 cos = 0, pri = 0;
1803 struct priority_cos *tt2cos; 1809 struct priority_cos *tt2cos;
1804 u32 *ttp = bp->dcbx_port_params.app.traffic_type_priority; 1810 u32 *ttp = bp->dcbx_port_params.app.traffic_type_priority;
1811 int mfw_configured = SHMEM2_HAS(bp, drv_flags) &&
1812 GET_FLAGS(SHMEM2_RD(bp, drv_flags),
1813 1 << DRV_FLAGS_DCB_MFW_CONFIGURED);
1805 1814
1806 memset(pfc_fw_cfg, 0, sizeof(*pfc_fw_cfg)); 1815 memset(pfc_fw_cfg, 0, sizeof(*pfc_fw_cfg));
1807 1816
1808 /* to disable DCB - the structure must be zeroed */ 1817 /* to disable DCB - the structure must be zeroed */
1809 if (bp->dcbx_error & DCBX_REMOTE_MIB_ERROR) 1818 if ((bp->dcbx_error & DCBX_REMOTE_MIB_ERROR) && !mfw_configured)
1810 return; 1819 return;
1811 1820
1812 /*shortcut*/ 1821 /*shortcut*/
@@ -2073,8 +2082,12 @@ static u8 bnx2x_dcbnl_set_all(struct net_device *netdev)
2073 "Handling parity error recovery. Try again later\n"); 2082 "Handling parity error recovery. Try again later\n");
2074 return 1; 2083 return 1;
2075 } 2084 }
2076 if (netif_running(bp->dev)) 2085 if (netif_running(bp->dev)) {
2086 bnx2x_update_drv_flags(bp,
2087 1 << DRV_FLAGS_DCB_MFW_CONFIGURED,
2088 1);
2077 bnx2x_dcbx_init(bp, true); 2089 bnx2x_dcbx_init(bp, true);
2090 }
2078 DP(BNX2X_MSG_DCB, "set_dcbx_params done (%d)\n", rc); 2091 DP(BNX2X_MSG_DCB, "set_dcbx_params done (%d)\n", rc);
2079 if (rc) 2092 if (rc)
2080 return 1; 2093 return 1;