aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ixgbe
diff options
context:
space:
mode:
authorJohn Fastabend <john.r.fastabend@intel.com>2011-11-11 20:12:16 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-12-05 03:12:30 -0500
commit4909fe979c4863bb748cd35e2cec9aab1e140a10 (patch)
tree3c231abfc986a2a38cdfc205a11f785278b7ed4f /drivers/net/ethernet/intel/ixgbe
parente8c626e9d8e99fdffd8af0e535ed5ac76ed356db (diff)
ixgbe: DCBnl set_all, order of operations fix
The order of operations is important in DCBnl set_all(). When FCoE is configured it uses the up2tc map to learn which queues to configure the hardware offloads on. Therefore we need to setup the map before configuring FCoE. This is only seen when the both up2tc mappings and APP info are configured simultaneously. 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>
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbe')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c77
1 files changed, 29 insertions, 48 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
index 33b93ffb87cb..8c056c06761f 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
@@ -309,6 +309,27 @@ static void ixgbe_dcbnl_get_pfc_cfg(struct net_device *netdev, int priority,
309 *setting = adapter->dcb_cfg.tc_config[priority].dcb_pfc; 309 *setting = adapter->dcb_cfg.tc_config[priority].dcb_pfc;
310} 310}
311 311
312#ifdef IXGBE_FCOE
313static void ixgbe_dcbnl_devreset(struct net_device *dev)
314{
315 struct ixgbe_adapter *adapter = netdev_priv(dev);
316
317 while (test_and_set_bit(__IXGBE_RESETTING, &adapter->state))
318 usleep_range(1000, 2000);
319
320 if (netif_running(dev))
321 dev->netdev_ops->ndo_stop(dev);
322
323 ixgbe_clear_interrupt_scheme(adapter);
324 ixgbe_init_interrupt_scheme(adapter);
325
326 if (netif_running(dev))
327 dev->netdev_ops->ndo_open(dev);
328
329 clear_bit(__IXGBE_RESETTING, &adapter->state);
330}
331#endif
332
312static u8 ixgbe_dcbnl_set_all(struct net_device *netdev) 333static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
313{ 334{
314 struct ixgbe_adapter *adapter = netdev_priv(netdev); 335 struct ixgbe_adapter *adapter = netdev_priv(netdev);
@@ -338,27 +359,6 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
338 if (ret) 359 if (ret)
339 return DCB_NO_HW_CHG; 360 return DCB_NO_HW_CHG;
340 361
341#ifdef IXGBE_FCOE
342 if (up && !(up & (1 << adapter->fcoe.up)))
343 adapter->dcb_set_bitmap |= BIT_APP_UPCHG;
344
345 /*
346 * Only take down the adapter if an app change occurred. FCoE
347 * may shuffle tx rings in this case and this can not be done
348 * without a reset currently.
349 */
350 if (adapter->dcb_set_bitmap & BIT_APP_UPCHG) {
351 while (test_and_set_bit(__IXGBE_RESETTING, &adapter->state))
352 usleep_range(1000, 2000);
353
354 adapter->fcoe.up = ffs(up) - 1;
355
356 if (netif_running(netdev))
357 netdev->netdev_ops->ndo_stop(netdev);
358 ixgbe_clear_interrupt_scheme(adapter);
359 }
360#endif
361
362 if (adapter->dcb_cfg.pfc_mode_enable) { 362 if (adapter->dcb_cfg.pfc_mode_enable) {
363 switch (adapter->hw.mac.type) { 363 switch (adapter->hw.mac.type) {
364 case ixgbe_mac_82599EB: 364 case ixgbe_mac_82599EB:
@@ -385,15 +385,6 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
385 } 385 }
386 } 386 }
387 387
388#ifdef IXGBE_FCOE
389 if (adapter->dcb_set_bitmap & BIT_APP_UPCHG) {
390 ixgbe_init_interrupt_scheme(adapter);
391 if (netif_running(netdev))
392 netdev->netdev_ops->ndo_open(netdev);
393 ret = DCB_HW_CHG_RST;
394 }
395#endif
396
397 if (adapter->dcb_set_bitmap & (BIT_PG_TX|BIT_PG_RX)) { 388 if (adapter->dcb_set_bitmap & (BIT_PG_TX|BIT_PG_RX)) {
398 u16 refill[MAX_TRAFFIC_CLASS], max[MAX_TRAFFIC_CLASS]; 389 u16 refill[MAX_TRAFFIC_CLASS], max[MAX_TRAFFIC_CLASS];
399 u8 bwg_id[MAX_TRAFFIC_CLASS], prio_type[MAX_TRAFFIC_CLASS]; 390 u8 bwg_id[MAX_TRAFFIC_CLASS], prio_type[MAX_TRAFFIC_CLASS];
@@ -442,8 +433,14 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
442 if (adapter->dcb_cfg.pfc_mode_enable) 433 if (adapter->dcb_cfg.pfc_mode_enable)
443 adapter->hw.fc.current_mode = ixgbe_fc_pfc; 434 adapter->hw.fc.current_mode = ixgbe_fc_pfc;
444 435
445 if (adapter->dcb_set_bitmap & BIT_APP_UPCHG) 436#ifdef IXGBE_FCOE
446 clear_bit(__IXGBE_RESETTING, &adapter->state); 437 if (up && !(up & (1 << adapter->fcoe.up))) {
438 adapter->fcoe.up = ffs(up) - 1;
439 ixgbe_dcbnl_devreset(netdev);
440 ret = DCB_HW_CHG_RST;
441 }
442#endif
443
447 adapter->dcb_set_bitmap = 0x00; 444 adapter->dcb_set_bitmap = 0x00;
448 return ret; 445 return ret;
449} 446}
@@ -661,22 +658,6 @@ static int ixgbe_dcbnl_ieee_setpfc(struct net_device *dev,
661 return ixgbe_dcb_hw_pfc_config(&adapter->hw, pfc->pfc_en, prio_tc); 658 return ixgbe_dcb_hw_pfc_config(&adapter->hw, pfc->pfc_en, prio_tc);
662} 659}
663 660
664#ifdef IXGBE_FCOE
665static void ixgbe_dcbnl_devreset(struct net_device *dev)
666{
667 struct ixgbe_adapter *adapter = netdev_priv(dev);
668
669 if (netif_running(dev))
670 dev->netdev_ops->ndo_stop(dev);
671
672 ixgbe_clear_interrupt_scheme(adapter);
673 ixgbe_init_interrupt_scheme(adapter);
674
675 if (netif_running(dev))
676 dev->netdev_ops->ndo_open(dev);
677}
678#endif
679
680static int ixgbe_dcbnl_ieee_setapp(struct net_device *dev, 661static int ixgbe_dcbnl_ieee_setapp(struct net_device *dev,
681 struct dcb_app *app) 662 struct dcb_app *app)
682{ 663{