Patchwork [net-next,02/14] e1000e: fix flow-control thresholds for jumbo frames on 82579/I217/I218

login
register
mail settings
Submitter Jeff Kirsher
Date Jan. 27, 2013, 10:39 a.m.
Message ID <1359283193-2043-3-git-send-email-jeffrey.t.kirsher@intel.com>
Download mbox | patch
Permalink /patch/215972/
State Accepted
Delegated to: David Miller
Headers show

Comments

Jeff Kirsher - Jan. 27, 2013, 10:39 a.m.
From: Bruce Allan <bruce.w.allan@intel.com>

The previous static flow-control thresholds were causing unnecessary pause
packets to be transmitted when jumbo frames are configured reducing the
throughput.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/e1000e/netdev.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

Patch

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index c15b7e4..8bb5d28 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -3724,14 +3724,17 @@  void e1000e_reset(struct e1000_adapter *adapter)
 		break;
 	case e1000_pch2lan:
 	case e1000_pch_lpt:
-		fc->high_water = 0x05C20;
-		fc->low_water = 0x05048;
-		fc->pause_time = 0x0650;
 		fc->refresh_time = 0x0400;
-		if (adapter->netdev->mtu > ETH_DATA_LEN) {
-			pba = 14;
-			ew32(PBA, pba);
+
+		if (adapter->netdev->mtu <= ETH_DATA_LEN) {
+			fc->high_water = 0x05C20;
+			fc->low_water = 0x05048;
+			fc->pause_time = 0x0650;
+			break;
 		}
+
+		fc->high_water = ((pba << 10) * 9 / 10) & E1000_FCRTH_RTH;
+		fc->low_water = ((pba << 10) * 8 / 10) & E1000_FCRTL_RTL;
 		break;
 	}