aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel
diff options
context:
space:
mode:
authorMatthew Vick <matthew.vick@intel.com>2012-11-07 23:03:58 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2012-11-28 07:13:39 -0500
commitd48507fed960f0a557f811129271829245b607b0 (patch)
treef718357f6e5a27759af89b862850ce1eb8c301d3 /drivers/net/ethernet/intel
parent76f640f147561b99092c0697f9eda4103a8d545b (diff)
igb: Use a 32-bit mask when calculating the flow control watermarks
For some devices, the result of the flow control high watermark gets truncated when programming it into the registers because of the mask used. Switch the mask to 32-bit to prevent this from happening. Signed-off-by: Matthew Vick <matthew.vick@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 0ce145e93545..b85b15a88981 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -1589,8 +1589,7 @@ void igb_reset(struct igb_adapter *adapter)
1589 struct e1000_hw *hw = &adapter->hw; 1589 struct e1000_hw *hw = &adapter->hw;
1590 struct e1000_mac_info *mac = &hw->mac; 1590 struct e1000_mac_info *mac = &hw->mac;
1591 struct e1000_fc_info *fc = &hw->fc; 1591 struct e1000_fc_info *fc = &hw->fc;
1592 u32 pba = 0, tx_space, min_tx_space, min_rx_space; 1592 u32 pba = 0, tx_space, min_tx_space, min_rx_space, hwm;
1593 u16 hwm;
1594 1593
1595 /* Repartition Pba for greater than 9k mtu 1594 /* Repartition Pba for greater than 9k mtu
1596 * To take effect CTRL.RST is required. 1595 * To take effect CTRL.RST is required.
@@ -1665,7 +1664,7 @@ void igb_reset(struct igb_adapter *adapter)
1665 hwm = min(((pba << 10) * 9 / 10), 1664 hwm = min(((pba << 10) * 9 / 10),
1666 ((pba << 10) - 2 * adapter->max_frame_size)); 1665 ((pba << 10) - 2 * adapter->max_frame_size));
1667 1666
1668 fc->high_water = hwm & 0xFFF0; /* 16-byte granularity */ 1667 fc->high_water = hwm & 0xFFFFFFF0; /* 16-byte granularity */
1669 fc->low_water = fc->high_water - 16; 1668 fc->low_water = fc->high_water - 16;
1670 fc->pause_time = 0xFFFF; 1669 fc->pause_time = 0xFFFF;
1671 fc->send_xon = 1; 1670 fc->send_xon = 1;