Skip to content

Commit 772d05c

Browse files
bwallanJeff Kirsher
authored andcommitted
e1000e: slow performance between two 82579 connected via 10Mbit hub
Two 82579 LOMs connected via a 10Mb hub experience extraordinarily low performance. This is because 82579 is excessively aggressive on transmit at 10Mb half-duplex and will not provide sufficient time for the link partner to transmit. When the link partner is also 82579, the result is a lot of collisions (and corresponding re-transmits) that cause the poor performance. To work-around this issue, significantly increase the IPG in the MAC to allow enough gap for the link partner to transmit and reduce the Rx latency in the analog PHY to 0 to reduce the number of collisions. Signed-off-by: Bruce Allan <[email protected]> Tested-by: Jeff Pieper <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent bb03451 commit 772d05c

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

drivers/net/ethernet/intel/e1000e/defines.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@
236236
#define E1000_STATUS_FUNC_SHIFT 2
237237
#define E1000_STATUS_FUNC_1 0x00000004 /* Function 1 */
238238
#define E1000_STATUS_TXOFF 0x00000010 /* transmission paused */
239+
#define E1000_STATUS_SPEED_MASK 0x000000C0
239240
#define E1000_STATUS_SPEED_10 0x00000000 /* Speed 10Mb/s */
240241
#define E1000_STATUS_SPEED_100 0x00000040 /* Speed 100Mb/s */
241242
#define E1000_STATUS_SPEED_1000 0x00000080 /* Speed 1000Mb/s */

drivers/net/ethernet/intel/e1000e/ich8lan.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,34 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
871871
return ret_val;
872872
}
873873

874+
/* When connected at 10Mbps half-duplex, 82579 parts are excessively
875+
* aggressive resulting in many collisions. To avoid this, increase
876+
* the IPG and reduce Rx latency in the PHY.
877+
*/
878+
if ((hw->mac.type == e1000_pch2lan) && link) {
879+
u32 reg;
880+
reg = er32(STATUS);
881+
if (!(reg & (E1000_STATUS_FD | E1000_STATUS_SPEED_MASK))) {
882+
reg = er32(TIPG);
883+
reg &= ~E1000_TIPG_IPGT_MASK;
884+
reg |= 0xFF;
885+
ew32(TIPG, reg);
886+
887+
/* Reduce Rx latency in analog PHY */
888+
ret_val = hw->phy.ops.acquire(hw);
889+
if (ret_val)
890+
return ret_val;
891+
892+
ret_val =
893+
e1000_write_emi_reg_locked(hw, I82579_RX_CONFIG, 0);
894+
895+
hw->phy.ops.release(hw);
896+
897+
if (ret_val)
898+
return ret_val;
899+
}
900+
}
901+
874902
/* Work-around I218 hang issue */
875903
if ((hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPTLP_I218_LM) ||
876904
(hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPTLP_I218_V)) {

drivers/net/ethernet/intel/e1000e/ich8lan.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@
211211
#define I82579_MSE_THRESHOLD 0x084F /* 82579 Mean Square Error Threshold */
212212
#define I82577_MSE_THRESHOLD 0x0887 /* 82577 Mean Square Error Threshold */
213213
#define I82579_MSE_LINK_DOWN 0x2411 /* MSE count before dropping link */
214+
#define I82579_RX_CONFIG 0x3412 /* Receive configuration */
214215
#define I82579_EEE_PCS_STATUS 0x182D /* IEEE MMD Register 3.1 >> 8 */
215216
#define I82579_EEE_CAPABILITY 0x0410 /* IEEE MMD Register 3.20 */
216217
#define I82579_EEE_ADVERTISEMENT 0x040E /* IEEE MMD Register 7.60 */

0 commit comments

Comments
 (0)