]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
e1000e: apply burst mode settings only on default
authorWillem de Bruijn <willemb@google.com>
Fri, 25 Aug 2017 15:06:26 +0000 (11:06 -0400)
committerJack Vogel <jack.vogel@oracle.com>
Mon, 8 Jan 2018 17:48:17 +0000 (09:48 -0800)
Devices that support FLAG2_DMA_BURST have different default values
for RDTR and RADV. Apply burst mode default settings only when no
explicit value was passed at module load.

The RDTR default is zero. If the module is loaded for low latency
operation with RxIntDelay=0, do not override this value with a burst
default of 32.

Move the decision to apply burst values earlier, where explicitly
initialized module variables can be distinguished from defaults.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Orabug: 27069012
(cherry picked from commit 48072ae1ec7a1c778771cad8c1b8dd803c4992ab)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Ethan Zhao <ethan.zhao@oracle.com>
drivers/net/ethernet/intel/e1000e/e1000.h
drivers/net/ethernet/intel/e1000e/netdev.c
drivers/net/ethernet/intel/e1000e/param.c

index 0828d2bda936595a77982e95c4b680defbdae971..d146d9ec2e730d0a9c8e07a400439b1d8e5bc5a0 100644 (file)
@@ -94,10 +94,6 @@ struct e1000_info;
  */
 #define E1000_CHECK_RESET_COUNT                25
 
-#define DEFAULT_RDTR                   0
-#define DEFAULT_RADV                   8
-#define BURST_RDTR                     0x20
-#define BURST_RADV                     0x20
 #define PCICFG_DESC_RING_STATUS                0xe4
 #define FLUSH_DESC_REQUIRED            0x100
 
index 5844af18be53c47c27c5bd509cc4ce21e0042ca9..dcf472b47553f9cf651a5ce1a3342b3d8080de30 100644 (file)
@@ -3242,14 +3242,6 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
                 */
                ew32(RXDCTL(0), E1000_RXDCTL_DMA_BURST_ENABLE);
                ew32(RXDCTL(1), E1000_RXDCTL_DMA_BURST_ENABLE);
-
-               /* override the delay timers for enabling bursting, only if
-                * the value was not set by the user via module options
-                */
-               if (adapter->rx_int_delay == DEFAULT_RDTR)
-                       adapter->rx_int_delay = BURST_RDTR;
-               if (adapter->rx_abs_int_delay == DEFAULT_RADV)
-                       adapter->rx_abs_int_delay = BURST_RADV;
        }
 
        /* set the Receive Delay Timer Register */
index 6d8c39abee1676980e7abfd6acbde7545f4ee528..47da518645437c271b963ece477754516a540fbf 100644 (file)
@@ -73,17 +73,25 @@ E1000_PARAM(TxAbsIntDelay, "Transmit Absolute Interrupt Delay");
 /* Receive Interrupt Delay in units of 1.024 microseconds
  * hardware will likely hang if you set this to anything but zero.
  *
+ * Burst variant is used as default if device has FLAG2_DMA_BURST.
+ *
  * Valid Range: 0-65535
  */
 E1000_PARAM(RxIntDelay, "Receive Interrupt Delay");
+#define DEFAULT_RDTR   0
+#define BURST_RDTR     0x20
 #define MAX_RXDELAY 0xFFFF
 #define MIN_RXDELAY 0
 
 /* Receive Absolute Interrupt Delay in units of 1.024 microseconds
+ *
+ * Burst variant is used as default if device has FLAG2_DMA_BURST.
  *
  * Valid Range: 0-65535
  */
 E1000_PARAM(RxAbsIntDelay, "Receive Absolute Interrupt Delay");
+#define DEFAULT_RADV   8
+#define BURST_RADV     0x20
 #define MAX_RXABSDELAY 0xFFFF
 #define MIN_RXABSDELAY 0
 
@@ -297,6 +305,9 @@ void e1000e_check_options(struct e1000_adapter *adapter)
                                         .max = MAX_RXDELAY } }
                };
 
+               if (adapter->flags2 & FLAG2_DMA_BURST)
+                       opt.def = BURST_RDTR;
+
                if (num_RxIntDelay > bd) {
                        adapter->rx_int_delay = RxIntDelay[bd];
                        e1000_validate_option(&adapter->rx_int_delay, &opt,
@@ -307,7 +318,7 @@ void e1000e_check_options(struct e1000_adapter *adapter)
        }
        /* Receive Absolute Interrupt Delay */
        {
-               static const struct e1000_option opt = {
+               static struct e1000_option opt = {
                        .type = range_option,
                        .name = "Receive Absolute Interrupt Delay",
                        .err  = "using default of "
@@ -317,6 +328,9 @@ void e1000e_check_options(struct e1000_adapter *adapter)
                                         .max = MAX_RXABSDELAY } }
                };
 
+               if (adapter->flags2 & FLAG2_DMA_BURST)
+                       opt.def = BURST_RADV;
+
                if (num_RxAbsIntDelay > bd) {
                        adapter->rx_abs_int_delay = RxAbsIntDelay[bd];
                        e1000_validate_option(&adapter->rx_abs_int_delay, &opt,