]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
e1000e: disable Early Receive DMA on ICH LOMs
authorBruce Allan <bruce.w.allan@intel.com>
Fri, 16 Dec 2011 00:46:27 +0000 (00:46 +0000)
committerJoe Jin <joe.jin@oracle.com>
Thu, 17 May 2012 07:06:19 +0000 (15:06 +0800)
Internal stress testing with jumbo frames shows the reliability of ICH9 and
ICH10D devices is improved in certain corner cases by disabling the Early
Receive feature. To reduce the performance impact caused by disabling this
feature, the packet buffer sizes and relevant flow control settings are
modified accordingly.

(cherry picked from commit 79d4e9087a6ecd6bf2103bf378bf8e0d79278b5a)
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/e1000e/e1000.h
drivers/net/e1000e/ich8lan.c
drivers/net/e1000e/netdev.c

index ef96e3727eb1de559116025f4b3b685ef04cb03c..bf2ffa7271f6b6d916681ad454ef0705a76b6b8d 100644 (file)
@@ -420,7 +420,7 @@ struct e1000_info {
 #define FLAG_HAS_FLASH                    (1 << 1)
 #define FLAG_HAS_HW_VLAN_FILTER           (1 << 2)
 #define FLAG_HAS_WOL                      (1 << 3)
-#define FLAG_HAS_ERT                      (1 << 4)
+/* reserved bit4 */
 #define FLAG_HAS_CTRLEXT_ON_LOAD          (1 << 5)
 #define FLAG_HAS_SWSM_ON_LOAD             (1 << 6)
 #define FLAG_HAS_JUMBO_FRAMES             (1 << 7)
index efa3c1c7378c6d7d1d4650acbe1a09a41afb8087..d034703916209c09de7d3b3209324d83a44d598a 100644 (file)
@@ -4103,7 +4103,6 @@ struct e1000_info e1000_ich9_info = {
                                  | FLAG_HAS_WOL
                                  | FLAG_HAS_CTRLEXT_ON_LOAD
                                  | FLAG_HAS_AMT
-                                 | FLAG_HAS_ERT
                                  | FLAG_HAS_FLASH
                                  | FLAG_APME_IN_WUC,
        .pba                    = 10,
@@ -4121,7 +4120,6 @@ struct e1000_info e1000_ich10_info = {
                                  | FLAG_HAS_WOL
                                  | FLAG_HAS_CTRLEXT_ON_LOAD
                                  | FLAG_HAS_AMT
-                                 | FLAG_HAS_ERT
                                  | FLAG_HAS_FLASH
                                  | FLAG_APME_IN_WUC,
        .pba                    = 10,
index 35038592b3b6d8844d9b4a87e39840eceede5fbb..fb08c7520e535606e8a17201d824f6a810ac0e8b 100644 (file)
@@ -2935,8 +2935,7 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
         * per packet.
         */
        pages = PAGE_USE_COUNT(adapter->netdev->mtu);
-       if (!(adapter->flags & FLAG_HAS_ERT) && (pages <= 3) &&
-           (PAGE_SIZE <= 16384) && (rctl & E1000_RCTL_LPE))
+       if ((pages <= 3) && (PAGE_SIZE <= 16384) && (rctl & E1000_RCTL_LPE))
                adapter->rx_ps_pages = pages;
        else
                adapter->rx_ps_pages = 0;
@@ -3083,23 +3082,14 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
        }
        ew32(RXCSUM, rxcsum);
 
-       /*
-        * Enable early receives on supported devices, only takes effect when
-        * packet size is equal or larger than the specified value (in 8 byte
-        * units), e.g. using jumbo frames when setting to E1000_ERT_2048
-        */
-       if ((adapter->flags & FLAG_HAS_ERT) ||
-           (adapter->hw.mac.type == e1000_pch2lan)) {
+       if (adapter->hw.mac.type == e1000_pch2lan) {
+               /*
+                * With jumbo frames, excessive C-state transition
+                * latencies result in dropped transactions.
+                */
                if (adapter->netdev->mtu > ETH_DATA_LEN) {
                        u32 rxdctl = er32(RXDCTL(0));
                        ew32(RXDCTL(0), rxdctl | 0x3);
-                       if (adapter->flags & FLAG_HAS_ERT)
-                               ew32(ERT, E1000_ERT_2048 | (1 << 13));
-                       /*
-                        * With jumbo frames and early-receive enabled,
-                        * excessive C-state transition latencies result in
-                        * dropped transactions.
-                        */
                        pm_qos_update_request(&adapter->netdev->pm_qos_req, 55);
                } else {
                        pm_qos_update_request(&adapter->netdev->pm_qos_req,
@@ -3410,9 +3400,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
                         * if short on Rx space, Rx wins and must trump Tx
                         * adjustment or use Early Receive if available
                         */
-                       if ((pba < min_rx_space) &&
-                           (!(adapter->flags & FLAG_HAS_ERT)))
-                               /* ERT enabled in e1000_configure_rx */
+                       if (pba < min_rx_space)
                                pba = min_rx_space;
                }
 
@@ -3426,8 +3414,6 @@ void e1000e_reset(struct e1000_adapter *adapter)
         * (or the size used for early receive) above it in the Rx FIFO.
         * Set it to the lower of:
         * - 90% of the Rx FIFO size, and
-        * - the full Rx FIFO size minus the early receive size (for parts
-        *   with ERT support assuming ERT set to E1000_ERT_2048), or
         * - the full Rx FIFO size minus one full frame
         */
        if (adapter->flags & FLAG_DISABLE_FC_PAUSE_TIME)
@@ -3438,14 +3424,19 @@ void e1000e_reset(struct e1000_adapter *adapter)
        fc->current_mode = fc->requested_mode;
 
        switch (hw->mac.type) {
+       case e1000_ich9lan:
+       case e1000_ich10lan:
+               if (adapter->netdev->mtu > ETH_DATA_LEN) {
+                       pba = 14;
+                       ew32(PBA, pba);
+                       fc->high_water = 0x2800;
+                       fc->low_water = fc->high_water - 8;
+                       break;
+               }
+               /* fall-through */
        default:
-               if ((adapter->flags & FLAG_HAS_ERT) &&
-                   (adapter->netdev->mtu > ETH_DATA_LEN))
-                       hwm = min(((pba << 10) * 9 / 10),
-                                 ((pba << 10) - (E1000_ERT_2048 << 3)));
-               else
-                       hwm = min(((pba << 10) * 9 / 10),
-                                 ((pba << 10) - adapter->max_frame_size));
+               hwm = min(((pba << 10) * 9 / 10),
+                         ((pba << 10) - adapter->max_frame_size));
 
                fc->high_water = hwm & E1000_FCRTH_RTH; /* 8-byte granularity */
                fc->low_water = fc->high_water - 8;
@@ -3478,11 +3469,10 @@ void e1000e_reset(struct e1000_adapter *adapter)
 
        /*
         * Disable Adaptive Interrupt Moderation if 2 full packets cannot
-        * fit in receive buffer and early-receive not supported.
+        * fit in receive buffer.
         */
        if (adapter->itr_setting & 0x3) {
-               if (((adapter->max_frame_size * 2) > (pba << 10)) &&
-                   !(adapter->flags & FLAG_HAS_ERT)) {
+               if ((adapter->max_frame_size * 2) > (pba << 10)) {
                        if (!(adapter->flags2 & FLAG2_DISABLE_AIM)) {
                                dev_info(&adapter->pdev->dev,
                                        "Interrupt Throttle Rate turned off\n");
@@ -3850,9 +3840,8 @@ static int e1000_open(struct net_device *netdev)
             E1000_MNG_DHCP_COOKIE_STATUS_VLAN))
                e1000_update_mng_vlan(adapter);
 
-       /* DMA latency requirement to workaround early-receive/jumbo issue */
-       if ((adapter->flags & FLAG_HAS_ERT) ||
-           (adapter->hw.mac.type == e1000_pch2lan))
+       /* DMA latency requirement to workaround jumbo issue */
+       if (adapter->hw.mac.type == e1000_pch2lan)
                pm_qos_add_request(&adapter->netdev->pm_qos_req,
                                   PM_QOS_CPU_DMA_LATENCY,
                                   PM_QOS_DEFAULT_VALUE);
@@ -3963,8 +3952,7 @@ static int e1000_close(struct net_device *netdev)
            !test_bit(__E1000_TESTING, &adapter->state))
                e1000e_release_hw_control(adapter);
 
-       if ((adapter->flags & FLAG_HAS_ERT) ||
-           (adapter->hw.mac.type == e1000_pch2lan))
+       if (adapter->hw.mac.type == e1000_pch2lan)
                pm_qos_remove_request(&adapter->netdev->pm_qos_req);
 
        pm_runtime_put_sync(&pdev->dev);