aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAmir Hanania <amir.hanania@intel.com>2012-12-03 22:03:03 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2013-02-01 00:27:11 -0500
commitd1d18b30f099fdfd688a34325a02a806ea86c5a2 (patch)
tree3a4476d30da7a1cd459ce5ce93b25d39ce351bcc /drivers/net
parent58d7553d5593292e1bdbfd6423b44caaca0799bd (diff)
ixgbe: Reset the NIC if up2tc has changed
Check for up2tc change and call ixgbe_dcbnl_devreset() if the mapping has changed but the number of TC's in use has not changed. Signed-off-by: Amir Hanania <amir.hanania@intel.com> Tested-by: Jack Morgan <jack.morgan@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
index 6718fb42ce1a..c261333438bf 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
@@ -302,7 +302,6 @@ static void ixgbe_dcbnl_get_pfc_cfg(struct net_device *netdev, int priority,
302 *setting = adapter->dcb_cfg.tc_config[priority].dcb_pfc; 302 *setting = adapter->dcb_cfg.tc_config[priority].dcb_pfc;
303} 303}
304 304
305#ifdef IXGBE_FCOE
306static void ixgbe_dcbnl_devreset(struct net_device *dev) 305static void ixgbe_dcbnl_devreset(struct net_device *dev)
307{ 306{
308 struct ixgbe_adapter *adapter = netdev_priv(dev); 307 struct ixgbe_adapter *adapter = netdev_priv(dev);
@@ -321,7 +320,6 @@ static void ixgbe_dcbnl_devreset(struct net_device *dev)
321 320
322 clear_bit(__IXGBE_RESETTING, &adapter->state); 321 clear_bit(__IXGBE_RESETTING, &adapter->state);
323} 322}
324#endif
325 323
326static u8 ixgbe_dcbnl_set_all(struct net_device *netdev) 324static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
327{ 325{
@@ -542,6 +540,7 @@ static int ixgbe_dcbnl_ieee_setets(struct net_device *dev,
542 int max_frame = dev->mtu + ETH_HLEN + ETH_FCS_LEN; 540 int max_frame = dev->mtu + ETH_HLEN + ETH_FCS_LEN;
543 int i, err = 0; 541 int i, err = 0;
544 __u8 max_tc = 0; 542 __u8 max_tc = 0;
543 __u8 map_chg = 0;
545 544
546 if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_IEEE)) 545 if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_IEEE))
547 return -EINVAL; 546 return -EINVAL;
@@ -551,15 +550,22 @@ static int ixgbe_dcbnl_ieee_setets(struct net_device *dev,
551 GFP_KERNEL); 550 GFP_KERNEL);
552 if (!adapter->ixgbe_ieee_ets) 551 if (!adapter->ixgbe_ieee_ets)
553 return -ENOMEM; 552 return -ENOMEM;
554 }
555 553
556 memcpy(adapter->ixgbe_ieee_ets, ets, sizeof(*adapter->ixgbe_ieee_ets)); 554 /* initialize UP2TC mappings to invalid value */
555 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++)
556 adapter->ixgbe_ieee_ets->prio_tc[i] =
557 IEEE_8021QAZ_MAX_TCS;
558 }
557 559
558 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) { 560 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
559 if (ets->prio_tc[i] > max_tc) 561 if (ets->prio_tc[i] > max_tc)
560 max_tc = ets->prio_tc[i]; 562 max_tc = ets->prio_tc[i];
563 if (ets->prio_tc[i] != adapter->ixgbe_ieee_ets->prio_tc[i])
564 map_chg = 1;
561 } 565 }
562 566
567 memcpy(adapter->ixgbe_ieee_ets, ets, sizeof(*adapter->ixgbe_ieee_ets));
568
563 if (max_tc) 569 if (max_tc)
564 max_tc++; 570 max_tc++;
565 571
@@ -568,6 +574,8 @@ static int ixgbe_dcbnl_ieee_setets(struct net_device *dev,
568 574
569 if (max_tc != netdev_get_num_tc(dev)) 575 if (max_tc != netdev_get_num_tc(dev))
570 err = ixgbe_setup_tc(dev, max_tc); 576 err = ixgbe_setup_tc(dev, max_tc);
577 else if (map_chg)
578 ixgbe_dcbnl_devreset(dev);
571 579
572 if (err) 580 if (err)
573 goto err_out; 581 goto err_out;