aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Fastabend <john.r.fastabend@intel.com>2011-01-22 01:07:05 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-02-11 11:54:35 -0500
commitd43f5c21d6bab7f58cb6723a57a66883cee0a905 (patch)
tree7261fb616d12e73f4d7d824ce07208b6825128b2
parentd033d526a465c4bb8a499a0b5df65b3e7cf4da6f (diff)
ixgbe: DCB, do not reset on CEE pg changes
The 82599 and 82598 devices do not require hardware resets to configure CEE pg settings. This patch changes DCB configuration to set the CEE pg values directly from the dcbnl ops routine. This reduces the number of resets seen on the wire and allows LLDP to reach a steady state faster. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb.h4
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_nl.c48
2 files changed, 39 insertions, 13 deletions
diff --git a/drivers/net/ixgbe/ixgbe_dcb.h b/drivers/net/ixgbe/ixgbe_dcb.h
index 4e4a641f3d53..e5935114815e 100644
--- a/drivers/net/ixgbe/ixgbe_dcb.h
+++ b/drivers/net/ixgbe/ixgbe_dcb.h
@@ -148,6 +148,10 @@ struct ixgbe_dcb_config {
148 148
149/* DCB driver APIs */ 149/* DCB driver APIs */
150void ixgbe_dcb_unpack_pfc(struct ixgbe_dcb_config *cfg, u8 *pfc_en); 150void ixgbe_dcb_unpack_pfc(struct ixgbe_dcb_config *cfg, u8 *pfc_en);
151void ixgbe_dcb_unpack_refill(struct ixgbe_dcb_config *, int, u16 *);
152void ixgbe_dcb_unpack_max(struct ixgbe_dcb_config *, u16 *);
153void ixgbe_dcb_unpack_bwgid(struct ixgbe_dcb_config *, int, u8 *);
154void ixgbe_dcb_unpack_prio(struct ixgbe_dcb_config *, int, u8 *);
151 155
152/* DCB credits calculation */ 156/* DCB credits calculation */
153s32 ixgbe_ieee_credits(__u8 *bw, __u16 *refill, __u16 *max, int max_frame); 157s32 ixgbe_ieee_credits(__u8 *bw, __u16 *refill, __u16 *max, int max_frame);
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index e75a3c91198d..b3a8d24afdd0 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -225,10 +225,8 @@ static void ixgbe_dcbnl_set_pg_tc_cfg_tx(struct net_device *netdev, int tc,
225 (adapter->temp_dcb_cfg.tc_config[tc].path[0].bwg_percent != 225 (adapter->temp_dcb_cfg.tc_config[tc].path[0].bwg_percent !=
226 adapter->dcb_cfg.tc_config[tc].path[0].bwg_percent) || 226 adapter->dcb_cfg.tc_config[tc].path[0].bwg_percent) ||
227 (adapter->temp_dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap != 227 (adapter->temp_dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap !=
228 adapter->dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap)) { 228 adapter->dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap))
229 adapter->dcb_set_bitmap |= BIT_PG_TX; 229 adapter->dcb_set_bitmap |= BIT_PG_TX;
230 adapter->dcb_set_bitmap |= BIT_RESETLINK;
231 }
232} 230}
233 231
234static void ixgbe_dcbnl_set_pg_bwg_cfg_tx(struct net_device *netdev, int bwg_id, 232static void ixgbe_dcbnl_set_pg_bwg_cfg_tx(struct net_device *netdev, int bwg_id,
@@ -239,10 +237,8 @@ static void ixgbe_dcbnl_set_pg_bwg_cfg_tx(struct net_device *netdev, int bwg_id,
239 adapter->temp_dcb_cfg.bw_percentage[0][bwg_id] = bw_pct; 237 adapter->temp_dcb_cfg.bw_percentage[0][bwg_id] = bw_pct;
240 238
241 if (adapter->temp_dcb_cfg.bw_percentage[0][bwg_id] != 239 if (adapter->temp_dcb_cfg.bw_percentage[0][bwg_id] !=
242 adapter->dcb_cfg.bw_percentage[0][bwg_id]) { 240 adapter->dcb_cfg.bw_percentage[0][bwg_id])
243 adapter->dcb_set_bitmap |= BIT_PG_TX; 241 adapter->dcb_set_bitmap |= BIT_PG_TX;
244 adapter->dcb_set_bitmap |= BIT_RESETLINK;
245 }
246} 242}
247 243
248static void ixgbe_dcbnl_set_pg_tc_cfg_rx(struct net_device *netdev, int tc, 244static void ixgbe_dcbnl_set_pg_tc_cfg_rx(struct net_device *netdev, int tc,
@@ -269,10 +265,8 @@ static void ixgbe_dcbnl_set_pg_tc_cfg_rx(struct net_device *netdev, int tc,
269 (adapter->temp_dcb_cfg.tc_config[tc].path[1].bwg_percent != 265 (adapter->temp_dcb_cfg.tc_config[tc].path[1].bwg_percent !=
270 adapter->dcb_cfg.tc_config[tc].path[1].bwg_percent) || 266 adapter->dcb_cfg.tc_config[tc].path[1].bwg_percent) ||
271 (adapter->temp_dcb_cfg.tc_config[tc].path[1].up_to_tc_bitmap != 267 (adapter->temp_dcb_cfg.tc_config[tc].path[1].up_to_tc_bitmap !=
272 adapter->dcb_cfg.tc_config[tc].path[1].up_to_tc_bitmap)) { 268 adapter->dcb_cfg.tc_config[tc].path[1].up_to_tc_bitmap))
273 adapter->dcb_set_bitmap |= BIT_PG_RX; 269 adapter->dcb_set_bitmap |= BIT_PG_RX;
274 adapter->dcb_set_bitmap |= BIT_RESETLINK;
275 }
276} 270}
277 271
278static void ixgbe_dcbnl_set_pg_bwg_cfg_rx(struct net_device *netdev, int bwg_id, 272static void ixgbe_dcbnl_set_pg_bwg_cfg_rx(struct net_device *netdev, int bwg_id,
@@ -283,10 +277,8 @@ static void ixgbe_dcbnl_set_pg_bwg_cfg_rx(struct net_device *netdev, int bwg_id,
283 adapter->temp_dcb_cfg.bw_percentage[1][bwg_id] = bw_pct; 277 adapter->temp_dcb_cfg.bw_percentage[1][bwg_id] = bw_pct;
284 278
285 if (adapter->temp_dcb_cfg.bw_percentage[1][bwg_id] != 279 if (adapter->temp_dcb_cfg.bw_percentage[1][bwg_id] !=
286 adapter->dcb_cfg.bw_percentage[1][bwg_id]) { 280 adapter->dcb_cfg.bw_percentage[1][bwg_id])
287 adapter->dcb_set_bitmap |= BIT_PG_RX; 281 adapter->dcb_set_bitmap |= BIT_PG_RX;
288 adapter->dcb_set_bitmap |= BIT_RESETLINK;
289 }
290} 282}
291 283
292static void ixgbe_dcbnl_get_pg_tc_cfg_tx(struct net_device *netdev, int tc, 284static void ixgbe_dcbnl_get_pg_tc_cfg_tx(struct net_device *netdev, int tc,
@@ -421,7 +413,9 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
421 ixgbe_up(adapter); 413 ixgbe_up(adapter);
422 } 414 }
423 ret = DCB_HW_CHG_RST; 415 ret = DCB_HW_CHG_RST;
424 } else if (adapter->dcb_set_bitmap & BIT_PFC) { 416 }
417
418 if (adapter->dcb_set_bitmap & BIT_PFC) {
425 u8 pfc_en; 419 u8 pfc_en;
426 ixgbe_dcb_unpack_pfc(&adapter->dcb_cfg, &pfc_en); 420 ixgbe_dcb_unpack_pfc(&adapter->dcb_cfg, &pfc_en);
427 421
@@ -431,6 +425,34 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
431 ixgbe_dcb_config_pfc_82599(&adapter->hw, pfc_en); 425 ixgbe_dcb_config_pfc_82599(&adapter->hw, pfc_en);
432 ret = DCB_HW_CHG; 426 ret = DCB_HW_CHG;
433 } 427 }
428
429 if (adapter->dcb_set_bitmap & (BIT_PG_TX|BIT_PG_RX)) {
430 u16 refill[MAX_TRAFFIC_CLASS], max[MAX_TRAFFIC_CLASS];
431 u8 bwg_id[MAX_TRAFFIC_CLASS], prio_type[MAX_TRAFFIC_CLASS];
432 int max_frame = adapter->netdev->mtu + ETH_HLEN + ETH_FCS_LEN;
433
434#ifdef CONFIG_FCOE
435 if (adapter->netdev->features & NETIF_F_FCOE_MTU)
436 max_frame = max(max_frame, IXGBE_FCOE_JUMBO_FRAME_SIZE);
437#endif
438
439 ixgbe_dcb_calculate_tc_credits(&adapter->hw, &adapter->dcb_cfg,
440 max_frame, DCB_TX_CONFIG);
441 ixgbe_dcb_calculate_tc_credits(&adapter->hw, &adapter->dcb_cfg,
442 max_frame, DCB_RX_CONFIG);
443
444 ixgbe_dcb_unpack_refill(&adapter->dcb_cfg,
445 DCB_TX_CONFIG, refill);
446 ixgbe_dcb_unpack_max(&adapter->dcb_cfg, max);
447 ixgbe_dcb_unpack_bwgid(&adapter->dcb_cfg,
448 DCB_TX_CONFIG, bwg_id);
449 ixgbe_dcb_unpack_prio(&adapter->dcb_cfg,
450 DCB_TX_CONFIG, prio_type);
451
452 ixgbe_dcb_hw_ets_config(&adapter->hw, refill, max,
453 bwg_id, prio_type);
454 }
455
434 if (adapter->dcb_cfg.pfc_mode_enable) 456 if (adapter->dcb_cfg.pfc_mode_enable)
435 adapter->hw.fc.current_mode = ixgbe_fc_pfc; 457 adapter->hw.fc.current_mode = ixgbe_fc_pfc;
436 458