diff options
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbe/ixgbe_main.c')
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index c4c526b7f99f..147efec3e002 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -4100,8 +4100,8 @@ static int ixgbe_hpbthresh(struct ixgbe_adapter *adapter, int pb) | |||
4100 | (tc < IXGBE_FCOE_JUMBO_FRAME_SIZE) && | 4100 | (tc < IXGBE_FCOE_JUMBO_FRAME_SIZE) && |
4101 | (pb == ixgbe_fcoe_get_tc(adapter))) | 4101 | (pb == ixgbe_fcoe_get_tc(adapter))) |
4102 | tc = IXGBE_FCOE_JUMBO_FRAME_SIZE; | 4102 | tc = IXGBE_FCOE_JUMBO_FRAME_SIZE; |
4103 | |||
4104 | #endif | 4103 | #endif |
4104 | |||
4105 | /* Calculate delay value for device */ | 4105 | /* Calculate delay value for device */ |
4106 | switch (hw->mac.type) { | 4106 | switch (hw->mac.type) { |
4107 | case ixgbe_mac_X540: | 4107 | case ixgbe_mac_X540: |
@@ -4142,7 +4142,7 @@ static int ixgbe_hpbthresh(struct ixgbe_adapter *adapter, int pb) | |||
4142 | * @adapter: board private structure to calculate for | 4142 | * @adapter: board private structure to calculate for |
4143 | * @pb: packet buffer to calculate | 4143 | * @pb: packet buffer to calculate |
4144 | */ | 4144 | */ |
4145 | static int ixgbe_lpbthresh(struct ixgbe_adapter *adapter) | 4145 | static int ixgbe_lpbthresh(struct ixgbe_adapter *adapter, int pb) |
4146 | { | 4146 | { |
4147 | struct ixgbe_hw *hw = &adapter->hw; | 4147 | struct ixgbe_hw *hw = &adapter->hw; |
4148 | struct net_device *dev = adapter->netdev; | 4148 | struct net_device *dev = adapter->netdev; |
@@ -4152,6 +4152,14 @@ static int ixgbe_lpbthresh(struct ixgbe_adapter *adapter) | |||
4152 | /* Calculate max LAN frame size */ | 4152 | /* Calculate max LAN frame size */ |
4153 | tc = dev->mtu + ETH_HLEN + ETH_FCS_LEN; | 4153 | tc = dev->mtu + ETH_HLEN + ETH_FCS_LEN; |
4154 | 4154 | ||
4155 | #ifdef IXGBE_FCOE | ||
4156 | /* FCoE traffic class uses FCOE jumbo frames */ | ||
4157 | if ((dev->features & NETIF_F_FCOE_MTU) && | ||
4158 | (tc < IXGBE_FCOE_JUMBO_FRAME_SIZE) && | ||
4159 | (pb == netdev_get_prio_tc_map(dev, adapter->fcoe.up))) | ||
4160 | tc = IXGBE_FCOE_JUMBO_FRAME_SIZE; | ||
4161 | #endif | ||
4162 | |||
4155 | /* Calculate delay value for device */ | 4163 | /* Calculate delay value for device */ |
4156 | switch (hw->mac.type) { | 4164 | switch (hw->mac.type) { |
4157 | case ixgbe_mac_X540: | 4165 | case ixgbe_mac_X540: |
@@ -4178,15 +4186,17 @@ static void ixgbe_pbthresh_setup(struct ixgbe_adapter *adapter) | |||
4178 | if (!num_tc) | 4186 | if (!num_tc) |
4179 | num_tc = 1; | 4187 | num_tc = 1; |
4180 | 4188 | ||
4181 | hw->fc.low_water = ixgbe_lpbthresh(adapter); | ||
4182 | |||
4183 | for (i = 0; i < num_tc; i++) { | 4189 | for (i = 0; i < num_tc; i++) { |
4184 | hw->fc.high_water[i] = ixgbe_hpbthresh(adapter, i); | 4190 | hw->fc.high_water[i] = ixgbe_hpbthresh(adapter, i); |
4191 | hw->fc.low_water[i] = ixgbe_lpbthresh(adapter, i); | ||
4185 | 4192 | ||
4186 | /* Low water marks must not be larger than high water marks */ | 4193 | /* Low water marks must not be larger than high water marks */ |
4187 | if (hw->fc.low_water > hw->fc.high_water[i]) | 4194 | if (hw->fc.low_water[i] > hw->fc.high_water[i]) |
4188 | hw->fc.low_water = 0; | 4195 | hw->fc.low_water[i] = 0; |
4189 | } | 4196 | } |
4197 | |||
4198 | for (; i < MAX_TRAFFIC_CLASS; i++) | ||
4199 | hw->fc.high_water[i] = 0; | ||
4190 | } | 4200 | } |
4191 | 4201 | ||
4192 | static void ixgbe_configure_pb(struct ixgbe_adapter *adapter) | 4202 | static void ixgbe_configure_pb(struct ixgbe_adapter *adapter) |