aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohn Fastabend <john.r.fastabend@intel.com>2011-02-23 00:58:25 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-03-12 07:13:20 -0500
commitc27931da83bc486e192c8dfdab903ba51e176c54 (patch)
treebd9374768b0d1a6ee6249170f31fbc435872e94e /drivers
parent17049d30c2dec6f26d6165cc135578f9e41d53d3 (diff)
ixgbe: DCB during ifup use correct CEE or IEEE mode
DCB settings are cleared in the hardware across link events during ifup ixgbe reprograms the hardware for DCB if it is enabled. Now that we have two modes CEE or IEEE we need to use the correct set of configuration data. This patch checks the dcbx_cap bits and then enables the device in the correct mode. 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')
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index be2e145646bf..38f9758c4c44 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -3658,15 +3658,6 @@ static void ixgbe_configure_dcb(struct ixgbe_adapter *adapter)
3658 if (hw->mac.type == ixgbe_mac_82598EB) 3658 if (hw->mac.type == ixgbe_mac_82598EB)
3659 netif_set_gso_max_size(adapter->netdev, 32768); 3659 netif_set_gso_max_size(adapter->netdev, 32768);
3660 3660
3661#ifdef CONFIG_FCOE
3662 if (adapter->netdev->features & NETIF_F_FCOE_MTU)
3663 max_frame = max(max_frame, IXGBE_FCOE_JUMBO_FRAME_SIZE);
3664#endif
3665
3666 ixgbe_dcb_calculate_tc_credits(hw, &adapter->dcb_cfg, max_frame,
3667 DCB_TX_CONFIG);
3668 ixgbe_dcb_calculate_tc_credits(hw, &adapter->dcb_cfg, max_frame,
3669 DCB_RX_CONFIG);
3670 3661
3671 /* Enable VLAN tag insert/strip */ 3662 /* Enable VLAN tag insert/strip */
3672 adapter->netdev->features |= NETIF_F_HW_VLAN_RX; 3663 adapter->netdev->features |= NETIF_F_HW_VLAN_RX;
@@ -3674,7 +3665,26 @@ static void ixgbe_configure_dcb(struct ixgbe_adapter *adapter)
3674 hw->mac.ops.set_vfta(&adapter->hw, 0, 0, true); 3665 hw->mac.ops.set_vfta(&adapter->hw, 0, 0, true);
3675 3666
3676 /* reconfigure the hardware */ 3667 /* reconfigure the hardware */
3677 ixgbe_dcb_hw_config(hw, &adapter->dcb_cfg); 3668 if (adapter->dcbx_cap & (DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_CEE)) {
3669#ifdef CONFIG_FCOE
3670 if (adapter->netdev->features & NETIF_F_FCOE_MTU)
3671 max_frame = max(max_frame, IXGBE_FCOE_JUMBO_FRAME_SIZE);
3672#endif
3673 ixgbe_dcb_calculate_tc_credits(hw, &adapter->dcb_cfg, max_frame,
3674 DCB_TX_CONFIG);
3675 ixgbe_dcb_calculate_tc_credits(hw, &adapter->dcb_cfg, max_frame,
3676 DCB_RX_CONFIG);
3677 ixgbe_dcb_hw_config(hw, &adapter->dcb_cfg);
3678 } else {
3679 struct net_device *dev = adapter->netdev;
3680
3681 if (adapter->ixgbe_ieee_ets)
3682 dev->dcbnl_ops->ieee_setets(dev,
3683 adapter->ixgbe_ieee_ets);
3684 if (adapter->ixgbe_ieee_pfc)
3685 dev->dcbnl_ops->ieee_setpfc(dev,
3686 adapter->ixgbe_ieee_pfc);
3687 }
3678 3688
3679 /* Enable RSS Hash per TC */ 3689 /* Enable RSS Hash per TC */
3680 if (hw->mac.type != ixgbe_mac_82598EB) { 3690 if (hw->mac.type != ixgbe_mac_82598EB) {