Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c27931da authored by John Fastabend's avatar John Fastabend Committed by Jeff Kirsher
Browse files

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: default avatarJohn Fastabend <john.r.fastabend@intel.com>
Tested-by: default avatarRoss Brattain <ross.b.brattain@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 17049d30
Loading
Loading
Loading
Loading
+20 −10
Original line number Original line Diff line number Diff line
@@ -3658,23 +3658,33 @@ static void ixgbe_configure_dcb(struct ixgbe_adapter *adapter)
	if (hw->mac.type == ixgbe_mac_82598EB)
	if (hw->mac.type == ixgbe_mac_82598EB)
		netif_set_gso_max_size(adapter->netdev, 32768);
		netif_set_gso_max_size(adapter->netdev, 32768);



	/* Enable VLAN tag insert/strip */
	adapter->netdev->features |= NETIF_F_HW_VLAN_RX;

	hw->mac.ops.set_vfta(&adapter->hw, 0, 0, true);

	/* reconfigure the hardware */
	if (adapter->dcbx_cap & (DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_CEE)) {
#ifdef CONFIG_FCOE
#ifdef CONFIG_FCOE
		if (adapter->netdev->features & NETIF_F_FCOE_MTU)
		if (adapter->netdev->features & NETIF_F_FCOE_MTU)
			max_frame = max(max_frame, IXGBE_FCOE_JUMBO_FRAME_SIZE);
			max_frame = max(max_frame, IXGBE_FCOE_JUMBO_FRAME_SIZE);
#endif
#endif

		ixgbe_dcb_calculate_tc_credits(hw, &adapter->dcb_cfg, max_frame,
		ixgbe_dcb_calculate_tc_credits(hw, &adapter->dcb_cfg, max_frame,
						DCB_TX_CONFIG);
						DCB_TX_CONFIG);
		ixgbe_dcb_calculate_tc_credits(hw, &adapter->dcb_cfg, max_frame,
		ixgbe_dcb_calculate_tc_credits(hw, &adapter->dcb_cfg, max_frame,
						DCB_RX_CONFIG);
						DCB_RX_CONFIG);

	/* Enable VLAN tag insert/strip */
	adapter->netdev->features |= NETIF_F_HW_VLAN_RX;

	hw->mac.ops.set_vfta(&adapter->hw, 0, 0, true);

	/* reconfigure the hardware */
		ixgbe_dcb_hw_config(hw, &adapter->dcb_cfg);
		ixgbe_dcb_hw_config(hw, &adapter->dcb_cfg);
	} else {
		struct net_device *dev = adapter->netdev;

		if (adapter->ixgbe_ieee_ets)
			dev->dcbnl_ops->ieee_setets(dev,
						    adapter->ixgbe_ieee_ets);
		if (adapter->ixgbe_ieee_pfc)
			dev->dcbnl_ops->ieee_setpfc(dev,
						    adapter->ixgbe_ieee_pfc);
	}


	/* Enable RSS Hash per TC */
	/* Enable RSS Hash per TC */
	if (hw->mac.type != ixgbe_mac_82598EB) {
	if (hw->mac.type != ixgbe_mac_82598EB) {