aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe
diff options
context:
space:
mode:
authorJohn Fastabend <john.r.fastabend@intel.com>2011-06-18 03:39:52 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-06-25 03:15:24 -0400
commit9372453e87560f1602815bf08b9e2af0f5136a61 (patch)
tree6a175089177426737ef58b3ecc31ed61911b8689 /drivers/net/ixgbe
parent7555e83df399ef35e031b137442eac2b1894b993 (diff)
ixgbe: complete FCoE initialization from setapp() routine
Commit, commit c8ca76ebc6e50752c5311b92bb9aef7edb324577 Author: John Fastabend <john.r.fastabend@intel.com> Date: Sat Mar 12 03:50:53 2011 +0000 ixgbe: DCB, further cleanups to app configuration Removed the getapp() routines from ixgbe because they are no longer needed. It also allowed the set hardware routines to use both IEEE 802.1Qaz app types and CEE app types. This added code to do bit shifting in the IEEE case. This patch reverts the checks and handles the IEEE case from the setapp entry point. I prefer this because it keeps the two paths from having to be aware of the DCB mode. This resolves a bug where I missed setting the selector bit in the IEEE spec value and left it in the CEE value. Now that they are separate routines these types of errors should not occur. 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/ixgbe')
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_nl.c38
1 files changed, 25 insertions, 13 deletions
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index bd2d75265389..db659df6b50e 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -330,24 +330,20 @@ static void ixgbe_dcbnl_get_pfc_cfg(struct net_device *netdev, int priority,
330static u8 ixgbe_dcbnl_set_all(struct net_device *netdev) 330static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
331{ 331{
332 struct ixgbe_adapter *adapter = netdev_priv(netdev); 332 struct ixgbe_adapter *adapter = netdev_priv(netdev);
333 int ret;
334#ifdef IXGBE_FCOE
333 struct dcb_app app = { 335 struct dcb_app app = {
334 .selector = DCB_APP_IDTYPE_ETHTYPE, 336 .selector = DCB_APP_IDTYPE_ETHTYPE,
335 .protocol = ETH_P_FCOE, 337 .protocol = ETH_P_FCOE,
336 }; 338 };
337 u8 up = dcb_getapp(netdev, &app); 339 u8 up = dcb_getapp(netdev, &app);
338 int ret; 340#endif
339 341
340 ret = ixgbe_copy_dcb_cfg(&adapter->temp_dcb_cfg, &adapter->dcb_cfg, 342 ret = ixgbe_copy_dcb_cfg(&adapter->temp_dcb_cfg, &adapter->dcb_cfg,
341 MAX_TRAFFIC_CLASS); 343 MAX_TRAFFIC_CLASS);
342 if (ret) 344 if (ret)
343 return DCB_NO_HW_CHG; 345 return DCB_NO_HW_CHG;
344 346
345 /* In IEEE mode app data must be parsed into DCBX format for
346 * hardware routines.
347 */
348 if (adapter->dcbx_cap & DCB_CAP_DCBX_VER_IEEE)
349 up = (1 << up);
350
351#ifdef IXGBE_FCOE 347#ifdef IXGBE_FCOE
352 if (up && (up != (1 << adapter->fcoe.up))) 348 if (up && (up != (1 << adapter->fcoe.up)))
353 adapter->dcb_set_bitmap |= BIT_APP_UPCHG; 349 adapter->dcb_set_bitmap |= BIT_APP_UPCHG;
@@ -678,18 +674,34 @@ static int ixgbe_dcbnl_ieee_setapp(struct net_device *dev,
678 struct dcb_app *app) 674 struct dcb_app *app)
679{ 675{
680 struct ixgbe_adapter *adapter = netdev_priv(dev); 676 struct ixgbe_adapter *adapter = netdev_priv(dev);
677 int err = -EINVAL;
681 678
682 if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_IEEE)) 679 if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_IEEE))
683 return -EINVAL; 680 return err;
684 681
685 dcb_setapp(dev, app); 682 err = dcb_ieee_setapp(dev, app);
686 683
687#ifdef IXGBE_FCOE 684#ifdef IXGBE_FCOE
688 if (app->selector == 1 && app->protocol == ETH_P_FCOE && 685 if (!err && app->selector == IEEE_8021QAZ_APP_SEL_ETHERTYPE &&
689 adapter->fcoe.tc == app->priority) 686 app->protocol == ETH_P_FCOE) {
690 ixgbe_dcbnl_set_all(dev); 687 u8 app_mask = dcb_ieee_getapp_mask(dev, app);
688
689 if (app_mask & (1 << adapter->fcoe.up))
690 return err;
691
692 adapter->fcoe.up = app->priority;
693
694 if (netif_running(dev))
695 dev->netdev_ops->ndo_stop(dev);
696
697 ixgbe_clear_interrupt_scheme(adapter);
698 ixgbe_init_interrupt_scheme(adapter);
699
700 if (netif_running(dev))
701 dev->netdev_ops->ndo_open(dev);
702 }
691#endif 703#endif
692 return 0; 704 return err;
693} 705}
694 706
695static u8 ixgbe_dcbnl_getdcbx(struct net_device *dev) 707static u8 ixgbe_dcbnl_getdcbx(struct net_device *dev)