diff options
author | Bruce Allan <bruce.w.allan@intel.com> | 2010-09-29 17:39:37 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-30 21:00:17 -0400 |
commit | 828bac87bb074f3366621724fdfbe314f98ccc7e (patch) | |
tree | 8ecc93bdabac266c288894efcc9b426e142a9f8e | |
parent | 3a3b75860527a11ba5035c6aa576079245d09e2a (diff) |
e1000e: 82579 performance improvements
The initial support for 82579 was tuned poorly for performance. Adjust the
packet buffer allocation appropriately for both standard and jumbo frames;
and for jumbo frames increase the receive descriptor pre-fetch, disable
adaptive interrupt moderation and set the DMA latency tolerance.
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/e1000e/e1000.h | 1 | ||||
-rw-r--r-- | drivers/net/e1000e/ich8lan.c | 2 | ||||
-rw-r--r-- | drivers/net/e1000e/netdev.c | 50 |
3 files changed, 46 insertions, 7 deletions
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h index 5ec0af59eeab..cee882dd67bf 100644 --- a/drivers/net/e1000e/e1000.h +++ b/drivers/net/e1000e/e1000.h | |||
@@ -453,6 +453,7 @@ struct e1000_info { | |||
453 | #define FLAG2_HAS_PHY_STATS (1 << 4) | 453 | #define FLAG2_HAS_PHY_STATS (1 << 4) |
454 | #define FLAG2_HAS_EEE (1 << 5) | 454 | #define FLAG2_HAS_EEE (1 << 5) |
455 | #define FLAG2_DMA_BURST (1 << 6) | 455 | #define FLAG2_DMA_BURST (1 << 6) |
456 | #define FLAG2_DISABLE_AIM (1 << 8) | ||
456 | 457 | ||
457 | #define E1000_RX_DESC_PS(R, i) \ | 458 | #define E1000_RX_DESC_PS(R, i) \ |
458 | (&(((union e1000_rx_desc_packet_split *)((R).desc))[i])) | 459 | (&(((union e1000_rx_desc_packet_split *)((R).desc))[i])) |
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index 57b5435599ab..e3374d9a2472 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c | |||
@@ -3986,7 +3986,7 @@ struct e1000_info e1000_pch2_info = { | |||
3986 | | FLAG_APME_IN_WUC, | 3986 | | FLAG_APME_IN_WUC, |
3987 | .flags2 = FLAG2_HAS_PHY_STATS | 3987 | .flags2 = FLAG2_HAS_PHY_STATS |
3988 | | FLAG2_HAS_EEE, | 3988 | | FLAG2_HAS_EEE, |
3989 | .pba = 18, | 3989 | .pba = 26, |
3990 | .max_hw_frame_size = DEFAULT_JUMBO, | 3990 | .max_hw_frame_size = DEFAULT_JUMBO, |
3991 | .get_variants = e1000_get_variants_ich8lan, | 3991 | .get_variants = e1000_get_variants_ich8lan, |
3992 | .mac_ops = &ich8_mac_ops, | 3992 | .mac_ops = &ich8_mac_ops, |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 1aa4228e860a..992b622fe205 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -2290,6 +2290,11 @@ static void e1000_set_itr(struct e1000_adapter *adapter) | |||
2290 | goto set_itr_now; | 2290 | goto set_itr_now; |
2291 | } | 2291 | } |
2292 | 2292 | ||
2293 | if (adapter->flags2 & FLAG2_DISABLE_AIM) { | ||
2294 | new_itr = 0; | ||
2295 | goto set_itr_now; | ||
2296 | } | ||
2297 | |||
2293 | adapter->tx_itr = e1000_update_itr(adapter, | 2298 | adapter->tx_itr = e1000_update_itr(adapter, |
2294 | adapter->tx_itr, | 2299 | adapter->tx_itr, |
2295 | adapter->total_tx_packets, | 2300 | adapter->total_tx_packets, |
@@ -2338,7 +2343,10 @@ set_itr_now: | |||
2338 | if (adapter->msix_entries) | 2343 | if (adapter->msix_entries) |
2339 | adapter->rx_ring->set_itr = 1; | 2344 | adapter->rx_ring->set_itr = 1; |
2340 | else | 2345 | else |
2341 | ew32(ITR, 1000000000 / (new_itr * 256)); | 2346 | if (new_itr) |
2347 | ew32(ITR, 1000000000 / (new_itr * 256)); | ||
2348 | else | ||
2349 | ew32(ITR, 0); | ||
2342 | } | 2350 | } |
2343 | } | 2351 | } |
2344 | 2352 | ||
@@ -2920,7 +2928,7 @@ static void e1000_configure_rx(struct e1000_adapter *adapter) | |||
2920 | 2928 | ||
2921 | /* irq moderation */ | 2929 | /* irq moderation */ |
2922 | ew32(RADV, adapter->rx_abs_int_delay); | 2930 | ew32(RADV, adapter->rx_abs_int_delay); |
2923 | if (adapter->itr_setting != 0) | 2931 | if ((adapter->itr_setting != 0) && (adapter->itr != 0)) |
2924 | ew32(ITR, 1000000000 / (adapter->itr * 256)); | 2932 | ew32(ITR, 1000000000 / (adapter->itr * 256)); |
2925 | 2933 | ||
2926 | ctrl_ext = er32(CTRL_EXT); | 2934 | ctrl_ext = er32(CTRL_EXT); |
@@ -2965,11 +2973,13 @@ static void e1000_configure_rx(struct e1000_adapter *adapter) | |||
2965 | * packet size is equal or larger than the specified value (in 8 byte | 2973 | * packet size is equal or larger than the specified value (in 8 byte |
2966 | * units), e.g. using jumbo frames when setting to E1000_ERT_2048 | 2974 | * units), e.g. using jumbo frames when setting to E1000_ERT_2048 |
2967 | */ | 2975 | */ |
2968 | if (adapter->flags & FLAG_HAS_ERT) { | 2976 | if ((adapter->flags & FLAG_HAS_ERT) || |
2977 | (adapter->hw.mac.type == e1000_pch2lan)) { | ||
2969 | if (adapter->netdev->mtu > ETH_DATA_LEN) { | 2978 | if (adapter->netdev->mtu > ETH_DATA_LEN) { |
2970 | u32 rxdctl = er32(RXDCTL(0)); | 2979 | u32 rxdctl = er32(RXDCTL(0)); |
2971 | ew32(RXDCTL(0), rxdctl | 0x3); | 2980 | ew32(RXDCTL(0), rxdctl | 0x3); |
2972 | ew32(ERT, E1000_ERT_2048 | (1 << 13)); | 2981 | if (adapter->flags & FLAG_HAS_ERT) |
2982 | ew32(ERT, E1000_ERT_2048 | (1 << 13)); | ||
2973 | /* | 2983 | /* |
2974 | * With jumbo frames and early-receive enabled, | 2984 | * With jumbo frames and early-receive enabled, |
2975 | * excessive C-state transition latencies result in | 2985 | * excessive C-state transition latencies result in |
@@ -3232,9 +3242,35 @@ void e1000e_reset(struct e1000_adapter *adapter) | |||
3232 | fc->low_water = 0x05048; | 3242 | fc->low_water = 0x05048; |
3233 | fc->pause_time = 0x0650; | 3243 | fc->pause_time = 0x0650; |
3234 | fc->refresh_time = 0x0400; | 3244 | fc->refresh_time = 0x0400; |
3245 | if (adapter->netdev->mtu > ETH_DATA_LEN) { | ||
3246 | pba = 14; | ||
3247 | ew32(PBA, pba); | ||
3248 | } | ||
3235 | break; | 3249 | break; |
3236 | } | 3250 | } |
3237 | 3251 | ||
3252 | /* | ||
3253 | * Disable Adaptive Interrupt Moderation if 2 full packets cannot | ||
3254 | * fit in receive buffer and early-receive not supported. | ||
3255 | */ | ||
3256 | if (adapter->itr_setting & 0x3) { | ||
3257 | if (((adapter->max_frame_size * 2) > (pba << 10)) && | ||
3258 | !(adapter->flags & FLAG_HAS_ERT)) { | ||
3259 | if (!(adapter->flags2 & FLAG2_DISABLE_AIM)) { | ||
3260 | dev_info(&adapter->pdev->dev, | ||
3261 | "Interrupt Throttle Rate turned off\n"); | ||
3262 | adapter->flags2 |= FLAG2_DISABLE_AIM; | ||
3263 | ew32(ITR, 0); | ||
3264 | } | ||
3265 | } else if (adapter->flags2 & FLAG2_DISABLE_AIM) { | ||
3266 | dev_info(&adapter->pdev->dev, | ||
3267 | "Interrupt Throttle Rate turned on\n"); | ||
3268 | adapter->flags2 &= ~FLAG2_DISABLE_AIM; | ||
3269 | adapter->itr = 20000; | ||
3270 | ew32(ITR, 1000000000 / (adapter->itr * 256)); | ||
3271 | } | ||
3272 | } | ||
3273 | |||
3238 | /* Allow time for pending master requests to run */ | 3274 | /* Allow time for pending master requests to run */ |
3239 | mac->ops.reset_hw(hw); | 3275 | mac->ops.reset_hw(hw); |
3240 | 3276 | ||
@@ -3553,7 +3589,8 @@ static int e1000_open(struct net_device *netdev) | |||
3553 | e1000_update_mng_vlan(adapter); | 3589 | e1000_update_mng_vlan(adapter); |
3554 | 3590 | ||
3555 | /* DMA latency requirement to workaround early-receive/jumbo issue */ | 3591 | /* DMA latency requirement to workaround early-receive/jumbo issue */ |
3556 | if (adapter->flags & FLAG_HAS_ERT) | 3592 | if ((adapter->flags & FLAG_HAS_ERT) || |
3593 | (adapter->hw.mac.type == e1000_pch2lan)) | ||
3557 | pm_qos_add_request(&adapter->netdev->pm_qos_req, | 3594 | pm_qos_add_request(&adapter->netdev->pm_qos_req, |
3558 | PM_QOS_CPU_DMA_LATENCY, | 3595 | PM_QOS_CPU_DMA_LATENCY, |
3559 | PM_QOS_DEFAULT_VALUE); | 3596 | PM_QOS_DEFAULT_VALUE); |
@@ -3662,7 +3699,8 @@ static int e1000_close(struct net_device *netdev) | |||
3662 | if (adapter->flags & FLAG_HAS_AMT) | 3699 | if (adapter->flags & FLAG_HAS_AMT) |
3663 | e1000_release_hw_control(adapter); | 3700 | e1000_release_hw_control(adapter); |
3664 | 3701 | ||
3665 | if (adapter->flags & FLAG_HAS_ERT) | 3702 | if ((adapter->flags & FLAG_HAS_ERT) || |
3703 | (adapter->hw.mac.type == e1000_pch2lan)) | ||
3666 | pm_qos_remove_request(&adapter->netdev->pm_qos_req); | 3704 | pm_qos_remove_request(&adapter->netdev->pm_qos_req); |
3667 | 3705 | ||
3668 | pm_runtime_put_sync(&pdev->dev); | 3706 | pm_runtime_put_sync(&pdev->dev); |