2018-03-23 01:08:48 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2018-04-26 23:08:09 +08:00
|
|
|
/* Copyright(c) 1999 - 2006 Intel Corporation. */
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#include "e1000.h"
|
|
|
|
|
|
|
|
/* This is the only thing that needs to be changed to adjust the
|
|
|
|
* maximum number of ports that the driver can manage.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define E1000_MAX_NIC 32
|
|
|
|
|
|
|
|
#define OPTION_UNSET -1
|
|
|
|
#define OPTION_DISABLED 0
|
|
|
|
#define OPTION_ENABLED 1
|
|
|
|
|
|
|
|
/* All parameters are treated the same, as an integer array of values.
|
|
|
|
* This macro just reduces the need to repeat the same declaration code
|
|
|
|
* over and over (plus this helps to avoid typo bugs).
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define E1000_PARAM_INIT { [0 ... E1000_MAX_NIC] = OPTION_UNSET }
|
|
|
|
#define E1000_PARAM(X, desc) \
|
2012-12-03 22:24:25 +08:00
|
|
|
static int X[E1000_MAX_NIC+1] = E1000_PARAM_INIT; \
|
2007-10-30 01:46:19 +08:00
|
|
|
static unsigned int num_##X; \
|
2005-04-17 06:20:36 +08:00
|
|
|
module_param_array_named(X, X, int, &num_##X, 0); \
|
|
|
|
MODULE_PARM_DESC(X, desc);
|
|
|
|
|
|
|
|
/* Transmit Descriptor Count
|
|
|
|
*
|
|
|
|
* Valid Range: 80-256 for 82542 and 82543 gigabit ethernet controllers
|
|
|
|
* Valid Range: 80-4096 for 82544 and newer
|
|
|
|
*
|
|
|
|
* Default Value: 256
|
|
|
|
*/
|
|
|
|
E1000_PARAM(TxDescriptors, "Number of transmit descriptors");
|
|
|
|
|
|
|
|
/* Receive Descriptor Count
|
|
|
|
*
|
|
|
|
* Valid Range: 80-256 for 82542 and 82543 gigabit ethernet controllers
|
|
|
|
* Valid Range: 80-4096 for 82544 and newer
|
|
|
|
*
|
|
|
|
* Default Value: 256
|
|
|
|
*/
|
|
|
|
E1000_PARAM(RxDescriptors, "Number of receive descriptors");
|
|
|
|
|
|
|
|
/* User Specified Speed Override
|
|
|
|
*
|
|
|
|
* Valid Range: 0, 10, 100, 1000
|
|
|
|
* - 0 - auto-negotiate at all supported speeds
|
|
|
|
* - 10 - only link at 10 Mbps
|
|
|
|
* - 100 - only link at 100 Mbps
|
|
|
|
* - 1000 - only link at 1000 Mbps
|
|
|
|
*
|
|
|
|
* Default Value: 0
|
|
|
|
*/
|
|
|
|
E1000_PARAM(Speed, "Speed setting");
|
|
|
|
|
|
|
|
/* User Specified Duplex Override
|
|
|
|
*
|
|
|
|
* Valid Range: 0-2
|
|
|
|
* - 0 - auto-negotiate for duplex
|
|
|
|
* - 1 - only link at half duplex
|
|
|
|
* - 2 - only link at full duplex
|
|
|
|
*
|
|
|
|
* Default Value: 0
|
|
|
|
*/
|
|
|
|
E1000_PARAM(Duplex, "Duplex setting");
|
|
|
|
|
|
|
|
/* Auto-negotiation Advertisement Override
|
|
|
|
*
|
|
|
|
* Valid Range: 0x01-0x0F, 0x20-0x2F (copper); 0x20 (fiber)
|
|
|
|
*
|
|
|
|
* The AutoNeg value is a bit mask describing which speed and duplex
|
|
|
|
* combinations should be advertised during auto-negotiation.
|
|
|
|
* The supported speed and duplex modes are listed below
|
|
|
|
*
|
|
|
|
* Bit 7 6 5 4 3 2 1 0
|
|
|
|
* Speed (Mbps) N/A N/A 1000 N/A 100 100 10 10
|
|
|
|
* Duplex Full Full Half Full Half
|
|
|
|
*
|
|
|
|
* Default Value: 0x2F (copper); 0x20 (fiber)
|
|
|
|
*/
|
|
|
|
E1000_PARAM(AutoNeg, "Advertised auto-negotiation setting");
|
2006-11-02 00:48:07 +08:00
|
|
|
#define AUTONEG_ADV_DEFAULT 0x2F
|
|
|
|
#define AUTONEG_ADV_MASK 0x2F
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* User Specified Flow Control Override
|
|
|
|
*
|
|
|
|
* Valid Range: 0-3
|
|
|
|
* - 0 - No Flow Control
|
|
|
|
* - 1 - Rx only, respond to PAUSE frames but do not generate them
|
|
|
|
* - 2 - Tx only, generate PAUSE frames but ignore them on receive
|
|
|
|
* - 3 - Full Flow Control Support
|
|
|
|
*
|
|
|
|
* Default Value: Read flow control settings from the EEPROM
|
|
|
|
*/
|
|
|
|
E1000_PARAM(FlowControl, "Flow Control setting");
|
2006-11-02 00:48:07 +08:00
|
|
|
#define FLOW_CONTROL_DEFAULT FLOW_CONTROL_FULL
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* XsumRX - Receive Checksum Offload Enable/Disable
|
|
|
|
*
|
|
|
|
* Valid Range: 0, 1
|
|
|
|
* - 0 - disables all checksum offload
|
|
|
|
* - 1 - enables receive IP/TCP/UDP checksum offload
|
|
|
|
* on 82543 and newer -based NICs
|
|
|
|
*
|
|
|
|
* Default Value: 1
|
|
|
|
*/
|
|
|
|
E1000_PARAM(XsumRX, "Disable or enable Receive Checksum offload");
|
|
|
|
|
|
|
|
/* Transmit Interrupt Delay in units of 1.024 microseconds
|
2006-11-02 00:48:07 +08:00
|
|
|
* Tx interrupt delay needs to typically be set to something non zero
|
2005-04-17 06:20:36 +08:00
|
|
|
*
|
|
|
|
* Valid Range: 0-65535
|
|
|
|
*/
|
|
|
|
E1000_PARAM(TxIntDelay, "Transmit Interrupt Delay");
|
e1000: add dynamic itr modes
Add a new dynamic itr algorithm, with 2 modes, and make it the default
operation mode. This greatly reduces latency and increases small packet
performance, at the "cost" of some CPU utilization. Bulk traffic
throughput is unaffected.
The driver can limit the amount of interrupts per second that the
adapter will generate for incoming packets. It does this by writing a
value to the adapter that is based on the maximum amount of interrupts
that the adapter will generate per second.
Setting InterruptThrottleRate to a value greater or equal to 100 will
program the adapter to send out a maximum of that many interrupts per
second, even if more packets have come in. This reduces interrupt
load on the system and can lower CPU utilization under heavy load,
but will increase latency as packets are not processed as quickly.
The default behaviour of the driver previously assumed a static
InterruptThrottleRate value of 8000, providing a good fallback value
for all traffic types,but lacking in small packet performance and
latency. The hardware can handle many more small packets per second
however, and for this reason an adaptive interrupt moderation algorithm
was implemented.
Since 7.3.x, the driver has two adaptive modes (setting 1 or 3) in
which it dynamically adjusts the InterruptThrottleRate value based on
the traffic that it receives. After determining the type of incoming
traffic in the last timeframe, it will adjust the InterruptThrottleRate
to an appropriate value for that traffic.
The algorithm classifies the incoming traffic every interval into
classes. Once the class is determined, the InterruptThrottleRate
value is adjusted to suit that traffic type the best. There are
three classes defined: "Bulk traffic", for large amounts of packets
of normal size; "Low latency", for small amounts of traffic and/or
a significant percentage of small packets; and "Lowest latency",
for almost completely small packets or minimal traffic.
In dynamic conservative mode, the InterruptThrottleRate value is
set to 4000 for traffic that falls in class "Bulk traffic". If
traffic falls in the "Low latency" or "Lowest latency" class, the
InterruptThrottleRate is increased stepwise to 20000. This default
mode is suitable for most applications.
For situations where low latency is vital such as cluster or
grid computing, the algorithm can reduce latency even more when
InterruptThrottleRate is set to mode 1. In this mode, which operates
the same as mode 3, the InterruptThrottleRate will be increased
stepwise to 70000 for traffic in class "Lowest latency".
Setting InterruptThrottleRate to 0 turns off any interrupt moderation
and may improve small packet latency, but is generally not suitable
for bulk throughput traffic.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Rick Jones <rick.jones2@hp.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
2006-11-02 00:48:13 +08:00
|
|
|
#define DEFAULT_TIDV 8
|
2006-11-02 00:48:07 +08:00
|
|
|
#define MAX_TXDELAY 0xFFFF
|
|
|
|
#define MIN_TXDELAY 0
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* Transmit Absolute Interrupt Delay in units of 1.024 microseconds
|
|
|
|
*
|
|
|
|
* Valid Range: 0-65535
|
|
|
|
*/
|
|
|
|
E1000_PARAM(TxAbsIntDelay, "Transmit Absolute Interrupt Delay");
|
e1000: add dynamic itr modes
Add a new dynamic itr algorithm, with 2 modes, and make it the default
operation mode. This greatly reduces latency and increases small packet
performance, at the "cost" of some CPU utilization. Bulk traffic
throughput is unaffected.
The driver can limit the amount of interrupts per second that the
adapter will generate for incoming packets. It does this by writing a
value to the adapter that is based on the maximum amount of interrupts
that the adapter will generate per second.
Setting InterruptThrottleRate to a value greater or equal to 100 will
program the adapter to send out a maximum of that many interrupts per
second, even if more packets have come in. This reduces interrupt
load on the system and can lower CPU utilization under heavy load,
but will increase latency as packets are not processed as quickly.
The default behaviour of the driver previously assumed a static
InterruptThrottleRate value of 8000, providing a good fallback value
for all traffic types,but lacking in small packet performance and
latency. The hardware can handle many more small packets per second
however, and for this reason an adaptive interrupt moderation algorithm
was implemented.
Since 7.3.x, the driver has two adaptive modes (setting 1 or 3) in
which it dynamically adjusts the InterruptThrottleRate value based on
the traffic that it receives. After determining the type of incoming
traffic in the last timeframe, it will adjust the InterruptThrottleRate
to an appropriate value for that traffic.
The algorithm classifies the incoming traffic every interval into
classes. Once the class is determined, the InterruptThrottleRate
value is adjusted to suit that traffic type the best. There are
three classes defined: "Bulk traffic", for large amounts of packets
of normal size; "Low latency", for small amounts of traffic and/or
a significant percentage of small packets; and "Lowest latency",
for almost completely small packets or minimal traffic.
In dynamic conservative mode, the InterruptThrottleRate value is
set to 4000 for traffic that falls in class "Bulk traffic". If
traffic falls in the "Low latency" or "Lowest latency" class, the
InterruptThrottleRate is increased stepwise to 20000. This default
mode is suitable for most applications.
For situations where low latency is vital such as cluster or
grid computing, the algorithm can reduce latency even more when
InterruptThrottleRate is set to mode 1. In this mode, which operates
the same as mode 3, the InterruptThrottleRate will be increased
stepwise to 70000 for traffic in class "Lowest latency".
Setting InterruptThrottleRate to 0 turns off any interrupt moderation
and may improve small packet latency, but is generally not suitable
for bulk throughput traffic.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Rick Jones <rick.jones2@hp.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
2006-11-02 00:48:13 +08:00
|
|
|
#define DEFAULT_TADV 32
|
2006-11-02 00:48:07 +08:00
|
|
|
#define MAX_TXABSDELAY 0xFFFF
|
|
|
|
#define MIN_TXABSDELAY 0
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* Receive Interrupt Delay in units of 1.024 microseconds
|
2006-11-02 00:48:07 +08:00
|
|
|
* hardware will likely hang if you set this to anything but zero.
|
2005-04-17 06:20:36 +08:00
|
|
|
*
|
|
|
|
* Valid Range: 0-65535
|
|
|
|
*/
|
|
|
|
E1000_PARAM(RxIntDelay, "Receive Interrupt Delay");
|
2006-11-02 00:48:07 +08:00
|
|
|
#define DEFAULT_RDTR 0
|
|
|
|
#define MAX_RXDELAY 0xFFFF
|
|
|
|
#define MIN_RXDELAY 0
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* Receive Absolute Interrupt Delay in units of 1.024 microseconds
|
|
|
|
*
|
|
|
|
* Valid Range: 0-65535
|
|
|
|
*/
|
|
|
|
E1000_PARAM(RxAbsIntDelay, "Receive Absolute Interrupt Delay");
|
e1000: add dynamic itr modes
Add a new dynamic itr algorithm, with 2 modes, and make it the default
operation mode. This greatly reduces latency and increases small packet
performance, at the "cost" of some CPU utilization. Bulk traffic
throughput is unaffected.
The driver can limit the amount of interrupts per second that the
adapter will generate for incoming packets. It does this by writing a
value to the adapter that is based on the maximum amount of interrupts
that the adapter will generate per second.
Setting InterruptThrottleRate to a value greater or equal to 100 will
program the adapter to send out a maximum of that many interrupts per
second, even if more packets have come in. This reduces interrupt
load on the system and can lower CPU utilization under heavy load,
but will increase latency as packets are not processed as quickly.
The default behaviour of the driver previously assumed a static
InterruptThrottleRate value of 8000, providing a good fallback value
for all traffic types,but lacking in small packet performance and
latency. The hardware can handle many more small packets per second
however, and for this reason an adaptive interrupt moderation algorithm
was implemented.
Since 7.3.x, the driver has two adaptive modes (setting 1 or 3) in
which it dynamically adjusts the InterruptThrottleRate value based on
the traffic that it receives. After determining the type of incoming
traffic in the last timeframe, it will adjust the InterruptThrottleRate
to an appropriate value for that traffic.
The algorithm classifies the incoming traffic every interval into
classes. Once the class is determined, the InterruptThrottleRate
value is adjusted to suit that traffic type the best. There are
three classes defined: "Bulk traffic", for large amounts of packets
of normal size; "Low latency", for small amounts of traffic and/or
a significant percentage of small packets; and "Lowest latency",
for almost completely small packets or minimal traffic.
In dynamic conservative mode, the InterruptThrottleRate value is
set to 4000 for traffic that falls in class "Bulk traffic". If
traffic falls in the "Low latency" or "Lowest latency" class, the
InterruptThrottleRate is increased stepwise to 20000. This default
mode is suitable for most applications.
For situations where low latency is vital such as cluster or
grid computing, the algorithm can reduce latency even more when
InterruptThrottleRate is set to mode 1. In this mode, which operates
the same as mode 3, the InterruptThrottleRate will be increased
stepwise to 70000 for traffic in class "Lowest latency".
Setting InterruptThrottleRate to 0 turns off any interrupt moderation
and may improve small packet latency, but is generally not suitable
for bulk throughput traffic.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Rick Jones <rick.jones2@hp.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
2006-11-02 00:48:13 +08:00
|
|
|
#define DEFAULT_RADV 8
|
2006-11-02 00:48:07 +08:00
|
|
|
#define MAX_RXABSDELAY 0xFFFF
|
|
|
|
#define MIN_RXABSDELAY 0
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* Interrupt Throttle Rate (interrupts/sec)
|
|
|
|
*
|
e1000: add dynamic itr modes
Add a new dynamic itr algorithm, with 2 modes, and make it the default
operation mode. This greatly reduces latency and increases small packet
performance, at the "cost" of some CPU utilization. Bulk traffic
throughput is unaffected.
The driver can limit the amount of interrupts per second that the
adapter will generate for incoming packets. It does this by writing a
value to the adapter that is based on the maximum amount of interrupts
that the adapter will generate per second.
Setting InterruptThrottleRate to a value greater or equal to 100 will
program the adapter to send out a maximum of that many interrupts per
second, even if more packets have come in. This reduces interrupt
load on the system and can lower CPU utilization under heavy load,
but will increase latency as packets are not processed as quickly.
The default behaviour of the driver previously assumed a static
InterruptThrottleRate value of 8000, providing a good fallback value
for all traffic types,but lacking in small packet performance and
latency. The hardware can handle many more small packets per second
however, and for this reason an adaptive interrupt moderation algorithm
was implemented.
Since 7.3.x, the driver has two adaptive modes (setting 1 or 3) in
which it dynamically adjusts the InterruptThrottleRate value based on
the traffic that it receives. After determining the type of incoming
traffic in the last timeframe, it will adjust the InterruptThrottleRate
to an appropriate value for that traffic.
The algorithm classifies the incoming traffic every interval into
classes. Once the class is determined, the InterruptThrottleRate
value is adjusted to suit that traffic type the best. There are
three classes defined: "Bulk traffic", for large amounts of packets
of normal size; "Low latency", for small amounts of traffic and/or
a significant percentage of small packets; and "Lowest latency",
for almost completely small packets or minimal traffic.
In dynamic conservative mode, the InterruptThrottleRate value is
set to 4000 for traffic that falls in class "Bulk traffic". If
traffic falls in the "Low latency" or "Lowest latency" class, the
InterruptThrottleRate is increased stepwise to 20000. This default
mode is suitable for most applications.
For situations where low latency is vital such as cluster or
grid computing, the algorithm can reduce latency even more when
InterruptThrottleRate is set to mode 1. In this mode, which operates
the same as mode 3, the InterruptThrottleRate will be increased
stepwise to 70000 for traffic in class "Lowest latency".
Setting InterruptThrottleRate to 0 turns off any interrupt moderation
and may improve small packet latency, but is generally not suitable
for bulk throughput traffic.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Rick Jones <rick.jones2@hp.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
2006-11-02 00:48:13 +08:00
|
|
|
* Valid Range: 100-100000 (0=off, 1=dynamic, 3=dynamic conservative)
|
2005-04-17 06:20:36 +08:00
|
|
|
*/
|
|
|
|
E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");
|
e1000: add dynamic itr modes
Add a new dynamic itr algorithm, with 2 modes, and make it the default
operation mode. This greatly reduces latency and increases small packet
performance, at the "cost" of some CPU utilization. Bulk traffic
throughput is unaffected.
The driver can limit the amount of interrupts per second that the
adapter will generate for incoming packets. It does this by writing a
value to the adapter that is based on the maximum amount of interrupts
that the adapter will generate per second.
Setting InterruptThrottleRate to a value greater or equal to 100 will
program the adapter to send out a maximum of that many interrupts per
second, even if more packets have come in. This reduces interrupt
load on the system and can lower CPU utilization under heavy load,
but will increase latency as packets are not processed as quickly.
The default behaviour of the driver previously assumed a static
InterruptThrottleRate value of 8000, providing a good fallback value
for all traffic types,but lacking in small packet performance and
latency. The hardware can handle many more small packets per second
however, and for this reason an adaptive interrupt moderation algorithm
was implemented.
Since 7.3.x, the driver has two adaptive modes (setting 1 or 3) in
which it dynamically adjusts the InterruptThrottleRate value based on
the traffic that it receives. After determining the type of incoming
traffic in the last timeframe, it will adjust the InterruptThrottleRate
to an appropriate value for that traffic.
The algorithm classifies the incoming traffic every interval into
classes. Once the class is determined, the InterruptThrottleRate
value is adjusted to suit that traffic type the best. There are
three classes defined: "Bulk traffic", for large amounts of packets
of normal size; "Low latency", for small amounts of traffic and/or
a significant percentage of small packets; and "Lowest latency",
for almost completely small packets or minimal traffic.
In dynamic conservative mode, the InterruptThrottleRate value is
set to 4000 for traffic that falls in class "Bulk traffic". If
traffic falls in the "Low latency" or "Lowest latency" class, the
InterruptThrottleRate is increased stepwise to 20000. This default
mode is suitable for most applications.
For situations where low latency is vital such as cluster or
grid computing, the algorithm can reduce latency even more when
InterruptThrottleRate is set to mode 1. In this mode, which operates
the same as mode 3, the InterruptThrottleRate will be increased
stepwise to 70000 for traffic in class "Lowest latency".
Setting InterruptThrottleRate to 0 turns off any interrupt moderation
and may improve small packet latency, but is generally not suitable
for bulk throughput traffic.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Rick Jones <rick.jones2@hp.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
2006-11-02 00:48:13 +08:00
|
|
|
#define DEFAULT_ITR 3
|
2006-11-02 00:48:07 +08:00
|
|
|
#define MAX_ITR 100000
|
|
|
|
#define MIN_ITR 100
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2006-06-28 00:06:45 +08:00
|
|
|
/* Enable Smart Power Down of the PHY
|
|
|
|
*
|
|
|
|
* Valid Range: 0, 1
|
|
|
|
*
|
|
|
|
* Default Value: 0 (disabled)
|
|
|
|
*/
|
|
|
|
E1000_PARAM(SmartPowerDownEnable, "Enable PHY smart power down");
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
struct e1000_option {
|
|
|
|
enum { enable_option, range_option, list_option } type;
|
2007-10-30 01:46:19 +08:00
|
|
|
const char *name;
|
|
|
|
const char *err;
|
|
|
|
int def;
|
2005-04-17 06:20:36 +08:00
|
|
|
union {
|
|
|
|
struct { /* range_option info */
|
|
|
|
int min;
|
|
|
|
int max;
|
|
|
|
} r;
|
|
|
|
struct { /* list_option info */
|
|
|
|
int nr;
|
2008-08-27 16:14:46 +08:00
|
|
|
const struct e1000_opt_list { int i; char *str; } *p;
|
2005-04-17 06:20:36 +08:00
|
|
|
} l;
|
|
|
|
} arg;
|
|
|
|
};
|
|
|
|
|
2012-12-03 22:24:25 +08:00
|
|
|
static int e1000_validate_option(unsigned int *value,
|
2012-12-06 22:30:56 +08:00
|
|
|
const struct e1000_option *opt,
|
|
|
|
struct e1000_adapter *adapter)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2006-01-19 05:01:39 +08:00
|
|
|
if (*value == OPTION_UNSET) {
|
2005-04-17 06:20:36 +08:00
|
|
|
*value = opt->def;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (opt->type) {
|
|
|
|
case enable_option:
|
|
|
|
switch (*value) {
|
|
|
|
case OPTION_ENABLED:
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("%s Enabled\n", opt->name);
|
2005-04-17 06:20:36 +08:00
|
|
|
return 0;
|
|
|
|
case OPTION_DISABLED:
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("%s Disabled\n", opt->name);
|
2005-04-17 06:20:36 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case range_option:
|
2006-01-19 05:01:39 +08:00
|
|
|
if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) {
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("%s set to %i\n", opt->name, *value);
|
2005-04-17 06:20:36 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case list_option: {
|
|
|
|
int i;
|
2008-08-27 16:14:46 +08:00
|
|
|
const struct e1000_opt_list *ent;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2006-01-19 05:01:39 +08:00
|
|
|
for (i = 0; i < opt->arg.l.nr; i++) {
|
2005-04-17 06:20:36 +08:00
|
|
|
ent = &opt->arg.l.p[i];
|
2006-01-19 05:01:39 +08:00
|
|
|
if (*value == ent->i) {
|
|
|
|
if (ent->str[0] != '\0')
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("%s\n", ent->str);
|
2005-04-17 06:20:36 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
BUG();
|
|
|
|
}
|
|
|
|
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("Invalid %s value specified (%i) %s\n",
|
2005-04-17 06:20:36 +08:00
|
|
|
opt->name, *value, opt->err);
|
|
|
|
*value = opt->def;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void e1000_check_fiber_options(struct e1000_adapter *adapter);
|
|
|
|
static void e1000_check_copper_options(struct e1000_adapter *adapter);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* e1000_check_options - Range Checking for Command Line Parameters
|
|
|
|
* @adapter: board private structure
|
|
|
|
*
|
|
|
|
* This routine checks all command line parameters for valid user
|
|
|
|
* input. If an invalid value is given, or if no user specified
|
|
|
|
* value exists, a default value is used. The final value is stored
|
|
|
|
* in a variable in the adapter structure.
|
|
|
|
**/
|
2012-12-03 22:24:25 +08:00
|
|
|
void e1000_check_options(struct e1000_adapter *adapter)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2008-08-27 16:14:46 +08:00
|
|
|
struct e1000_option opt;
|
2005-04-17 06:20:36 +08:00
|
|
|
int bd = adapter->bd_number;
|
2008-08-27 16:14:46 +08:00
|
|
|
|
2006-01-19 05:01:39 +08:00
|
|
|
if (bd >= E1000_MAX_NIC) {
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_warn("Warning: no configuration for board #%i "
|
|
|
|
"using defaults for all values\n", bd);
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
{ /* Transmit Descriptor Count */
|
2008-08-27 16:14:46 +08:00
|
|
|
struct e1000_tx_ring *tx_ring = adapter->tx_ring;
|
|
|
|
int i;
|
|
|
|
e1000_mac_type mac_type = adapter->hw.mac_type;
|
|
|
|
|
|
|
|
opt = (struct e1000_option) {
|
2005-04-17 06:20:36 +08:00
|
|
|
.type = range_option,
|
|
|
|
.name = "Transmit Descriptors",
|
|
|
|
.err = "using default of "
|
|
|
|
__MODULE_STRING(E1000_DEFAULT_TXD),
|
|
|
|
.def = E1000_DEFAULT_TXD,
|
2008-08-27 16:14:46 +08:00
|
|
|
.arg = { .r = {
|
|
|
|
.min = E1000_MIN_TXD,
|
|
|
|
.max = mac_type < e1000_82544 ? E1000_MAX_TXD : E1000_MAX_82544_TXD
|
|
|
|
}}
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
2006-08-29 05:56:32 +08:00
|
|
|
if (num_TxDescriptors > bd) {
|
|
|
|
tx_ring->count = TxDescriptors[bd];
|
|
|
|
e1000_validate_option(&tx_ring->count, &opt, adapter);
|
2007-04-28 04:55:29 +08:00
|
|
|
tx_ring->count = ALIGN(tx_ring->count,
|
2006-08-29 05:56:32 +08:00
|
|
|
REQ_TX_DESCRIPTOR_MULTIPLE);
|
|
|
|
} else {
|
|
|
|
tx_ring->count = opt.def;
|
|
|
|
}
|
2006-01-13 08:50:39 +08:00
|
|
|
for (i = 0; i < adapter->num_tx_queues; i++)
|
2005-10-04 19:01:55 +08:00
|
|
|
tx_ring[i].count = tx_ring->count;
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
{ /* Receive Descriptor Count */
|
2008-08-27 16:14:46 +08:00
|
|
|
struct e1000_rx_ring *rx_ring = adapter->rx_ring;
|
|
|
|
int i;
|
|
|
|
e1000_mac_type mac_type = adapter->hw.mac_type;
|
|
|
|
|
|
|
|
opt = (struct e1000_option) {
|
2005-04-17 06:20:36 +08:00
|
|
|
.type = range_option,
|
|
|
|
.name = "Receive Descriptors",
|
|
|
|
.err = "using default of "
|
|
|
|
__MODULE_STRING(E1000_DEFAULT_RXD),
|
|
|
|
.def = E1000_DEFAULT_RXD,
|
2008-08-27 16:14:46 +08:00
|
|
|
.arg = { .r = {
|
|
|
|
.min = E1000_MIN_RXD,
|
2013-02-09 20:49:21 +08:00
|
|
|
.max = mac_type < e1000_82544 ? E1000_MAX_RXD :
|
|
|
|
E1000_MAX_82544_RXD
|
2008-08-27 16:14:46 +08:00
|
|
|
}}
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
2006-08-29 05:56:32 +08:00
|
|
|
if (num_RxDescriptors > bd) {
|
|
|
|
rx_ring->count = RxDescriptors[bd];
|
|
|
|
e1000_validate_option(&rx_ring->count, &opt, adapter);
|
2007-04-28 04:55:29 +08:00
|
|
|
rx_ring->count = ALIGN(rx_ring->count,
|
2006-08-29 05:56:32 +08:00
|
|
|
REQ_RX_DESCRIPTOR_MULTIPLE);
|
|
|
|
} else {
|
|
|
|
rx_ring->count = opt.def;
|
|
|
|
}
|
2006-01-13 08:50:39 +08:00
|
|
|
for (i = 0; i < adapter->num_rx_queues; i++)
|
2005-10-04 19:01:55 +08:00
|
|
|
rx_ring[i].count = rx_ring->count;
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
{ /* Checksum Offload Enable/Disable */
|
2008-08-27 16:14:46 +08:00
|
|
|
opt = (struct e1000_option) {
|
2005-04-17 06:20:36 +08:00
|
|
|
.type = enable_option,
|
|
|
|
.name = "Checksum Offload",
|
|
|
|
.err = "defaulting to Enabled",
|
|
|
|
.def = OPTION_ENABLED
|
|
|
|
};
|
|
|
|
|
2006-08-29 05:56:32 +08:00
|
|
|
if (num_XsumRX > bd) {
|
2007-10-30 01:46:19 +08:00
|
|
|
unsigned int rx_csum = XsumRX[bd];
|
2006-08-29 05:56:32 +08:00
|
|
|
e1000_validate_option(&rx_csum, &opt, adapter);
|
|
|
|
adapter->rx_csum = rx_csum;
|
|
|
|
} else {
|
|
|
|
adapter->rx_csum = opt.def;
|
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
{ /* Flow Control */
|
|
|
|
|
2010-12-02 03:59:50 +08:00
|
|
|
static const struct e1000_opt_list fc_list[] = {
|
|
|
|
{ E1000_FC_NONE, "Flow Control Disabled" },
|
|
|
|
{ E1000_FC_RX_PAUSE, "Flow Control Receive Only" },
|
|
|
|
{ E1000_FC_TX_PAUSE, "Flow Control Transmit Only" },
|
|
|
|
{ E1000_FC_FULL, "Flow Control Enabled" },
|
|
|
|
{ E1000_FC_DEFAULT, "Flow Control Hardware Default" }
|
|
|
|
};
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2008-08-27 16:14:46 +08:00
|
|
|
opt = (struct e1000_option) {
|
2005-04-17 06:20:36 +08:00
|
|
|
.type = list_option,
|
|
|
|
.name = "Flow Control",
|
|
|
|
.err = "reading default settings from EEPROM",
|
2006-09-28 03:53:28 +08:00
|
|
|
.def = E1000_FC_DEFAULT,
|
2005-04-17 06:20:36 +08:00
|
|
|
.arg = { .l = { .nr = ARRAY_SIZE(fc_list),
|
|
|
|
.p = fc_list }}
|
|
|
|
};
|
|
|
|
|
2006-08-29 05:56:32 +08:00
|
|
|
if (num_FlowControl > bd) {
|
2007-10-30 01:46:19 +08:00
|
|
|
unsigned int fc = FlowControl[bd];
|
2006-08-29 05:56:32 +08:00
|
|
|
e1000_validate_option(&fc, &opt, adapter);
|
|
|
|
adapter->hw.fc = adapter->hw.original_fc = fc;
|
|
|
|
} else {
|
|
|
|
adapter->hw.fc = adapter->hw.original_fc = opt.def;
|
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
{ /* Transmit Interrupt Delay */
|
2008-08-27 16:14:46 +08:00
|
|
|
opt = (struct e1000_option) {
|
2005-04-17 06:20:36 +08:00
|
|
|
.type = range_option,
|
|
|
|
.name = "Transmit Interrupt Delay",
|
|
|
|
.err = "using default of " __MODULE_STRING(DEFAULT_TIDV),
|
|
|
|
.def = DEFAULT_TIDV,
|
|
|
|
.arg = { .r = { .min = MIN_TXDELAY,
|
|
|
|
.max = MAX_TXDELAY }}
|
|
|
|
};
|
|
|
|
|
2006-08-29 05:56:32 +08:00
|
|
|
if (num_TxIntDelay > bd) {
|
|
|
|
adapter->tx_int_delay = TxIntDelay[bd];
|
|
|
|
e1000_validate_option(&adapter->tx_int_delay, &opt,
|
|
|
|
adapter);
|
|
|
|
} else {
|
|
|
|
adapter->tx_int_delay = opt.def;
|
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
{ /* Transmit Absolute Interrupt Delay */
|
2008-08-27 16:14:46 +08:00
|
|
|
opt = (struct e1000_option) {
|
2005-04-17 06:20:36 +08:00
|
|
|
.type = range_option,
|
|
|
|
.name = "Transmit Absolute Interrupt Delay",
|
|
|
|
.err = "using default of " __MODULE_STRING(DEFAULT_TADV),
|
|
|
|
.def = DEFAULT_TADV,
|
|
|
|
.arg = { .r = { .min = MIN_TXABSDELAY,
|
|
|
|
.max = MAX_TXABSDELAY }}
|
|
|
|
};
|
|
|
|
|
2006-08-29 05:56:32 +08:00
|
|
|
if (num_TxAbsIntDelay > bd) {
|
|
|
|
adapter->tx_abs_int_delay = TxAbsIntDelay[bd];
|
|
|
|
e1000_validate_option(&adapter->tx_abs_int_delay, &opt,
|
2013-02-09 20:49:21 +08:00
|
|
|
adapter);
|
2006-08-29 05:56:32 +08:00
|
|
|
} else {
|
|
|
|
adapter->tx_abs_int_delay = opt.def;
|
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
{ /* Receive Interrupt Delay */
|
2008-08-27 16:14:46 +08:00
|
|
|
opt = (struct e1000_option) {
|
2005-04-17 06:20:36 +08:00
|
|
|
.type = range_option,
|
|
|
|
.name = "Receive Interrupt Delay",
|
|
|
|
.err = "using default of " __MODULE_STRING(DEFAULT_RDTR),
|
|
|
|
.def = DEFAULT_RDTR,
|
|
|
|
.arg = { .r = { .min = MIN_RXDELAY,
|
|
|
|
.max = MAX_RXDELAY }}
|
|
|
|
};
|
|
|
|
|
2006-08-29 05:56:32 +08:00
|
|
|
if (num_RxIntDelay > bd) {
|
|
|
|
adapter->rx_int_delay = RxIntDelay[bd];
|
|
|
|
e1000_validate_option(&adapter->rx_int_delay, &opt,
|
2013-02-09 20:49:21 +08:00
|
|
|
adapter);
|
2006-08-29 05:56:32 +08:00
|
|
|
} else {
|
|
|
|
adapter->rx_int_delay = opt.def;
|
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
{ /* Receive Absolute Interrupt Delay */
|
2008-08-27 16:14:46 +08:00
|
|
|
opt = (struct e1000_option) {
|
2005-04-17 06:20:36 +08:00
|
|
|
.type = range_option,
|
|
|
|
.name = "Receive Absolute Interrupt Delay",
|
|
|
|
.err = "using default of " __MODULE_STRING(DEFAULT_RADV),
|
|
|
|
.def = DEFAULT_RADV,
|
|
|
|
.arg = { .r = { .min = MIN_RXABSDELAY,
|
|
|
|
.max = MAX_RXABSDELAY }}
|
|
|
|
};
|
|
|
|
|
2006-08-29 05:56:32 +08:00
|
|
|
if (num_RxAbsIntDelay > bd) {
|
|
|
|
adapter->rx_abs_int_delay = RxAbsIntDelay[bd];
|
|
|
|
e1000_validate_option(&adapter->rx_abs_int_delay, &opt,
|
2013-02-09 20:49:21 +08:00
|
|
|
adapter);
|
2006-08-29 05:56:32 +08:00
|
|
|
} else {
|
|
|
|
adapter->rx_abs_int_delay = opt.def;
|
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
{ /* Interrupt Throttling Rate */
|
2008-08-27 16:14:46 +08:00
|
|
|
opt = (struct e1000_option) {
|
2005-04-17 06:20:36 +08:00
|
|
|
.type = range_option,
|
|
|
|
.name = "Interrupt Throttling Rate (ints/sec)",
|
|
|
|
.err = "using default of " __MODULE_STRING(DEFAULT_ITR),
|
|
|
|
.def = DEFAULT_ITR,
|
|
|
|
.arg = { .r = { .min = MIN_ITR,
|
|
|
|
.max = MAX_ITR }}
|
|
|
|
};
|
|
|
|
|
2006-08-29 05:56:32 +08:00
|
|
|
if (num_InterruptThrottleRate > bd) {
|
|
|
|
adapter->itr = InterruptThrottleRate[bd];
|
|
|
|
switch (adapter->itr) {
|
|
|
|
case 0:
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("%s turned off\n", opt.name);
|
2006-08-29 05:56:32 +08:00
|
|
|
break;
|
|
|
|
case 1:
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("%s set to dynamic mode\n",
|
|
|
|
opt.name);
|
e1000: add dynamic itr modes
Add a new dynamic itr algorithm, with 2 modes, and make it the default
operation mode. This greatly reduces latency and increases small packet
performance, at the "cost" of some CPU utilization. Bulk traffic
throughput is unaffected.
The driver can limit the amount of interrupts per second that the
adapter will generate for incoming packets. It does this by writing a
value to the adapter that is based on the maximum amount of interrupts
that the adapter will generate per second.
Setting InterruptThrottleRate to a value greater or equal to 100 will
program the adapter to send out a maximum of that many interrupts per
second, even if more packets have come in. This reduces interrupt
load on the system and can lower CPU utilization under heavy load,
but will increase latency as packets are not processed as quickly.
The default behaviour of the driver previously assumed a static
InterruptThrottleRate value of 8000, providing a good fallback value
for all traffic types,but lacking in small packet performance and
latency. The hardware can handle many more small packets per second
however, and for this reason an adaptive interrupt moderation algorithm
was implemented.
Since 7.3.x, the driver has two adaptive modes (setting 1 or 3) in
which it dynamically adjusts the InterruptThrottleRate value based on
the traffic that it receives. After determining the type of incoming
traffic in the last timeframe, it will adjust the InterruptThrottleRate
to an appropriate value for that traffic.
The algorithm classifies the incoming traffic every interval into
classes. Once the class is determined, the InterruptThrottleRate
value is adjusted to suit that traffic type the best. There are
three classes defined: "Bulk traffic", for large amounts of packets
of normal size; "Low latency", for small amounts of traffic and/or
a significant percentage of small packets; and "Lowest latency",
for almost completely small packets or minimal traffic.
In dynamic conservative mode, the InterruptThrottleRate value is
set to 4000 for traffic that falls in class "Bulk traffic". If
traffic falls in the "Low latency" or "Lowest latency" class, the
InterruptThrottleRate is increased stepwise to 20000. This default
mode is suitable for most applications.
For situations where low latency is vital such as cluster or
grid computing, the algorithm can reduce latency even more when
InterruptThrottleRate is set to mode 1. In this mode, which operates
the same as mode 3, the InterruptThrottleRate will be increased
stepwise to 70000 for traffic in class "Lowest latency".
Setting InterruptThrottleRate to 0 turns off any interrupt moderation
and may improve small packet latency, but is generally not suitable
for bulk throughput traffic.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Rick Jones <rick.jones2@hp.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
2006-11-02 00:48:13 +08:00
|
|
|
adapter->itr_setting = adapter->itr;
|
|
|
|
adapter->itr = 20000;
|
|
|
|
break;
|
|
|
|
case 3:
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("%s set to dynamic conservative "
|
|
|
|
"mode\n", opt.name);
|
e1000: add dynamic itr modes
Add a new dynamic itr algorithm, with 2 modes, and make it the default
operation mode. This greatly reduces latency and increases small packet
performance, at the "cost" of some CPU utilization. Bulk traffic
throughput is unaffected.
The driver can limit the amount of interrupts per second that the
adapter will generate for incoming packets. It does this by writing a
value to the adapter that is based on the maximum amount of interrupts
that the adapter will generate per second.
Setting InterruptThrottleRate to a value greater or equal to 100 will
program the adapter to send out a maximum of that many interrupts per
second, even if more packets have come in. This reduces interrupt
load on the system and can lower CPU utilization under heavy load,
but will increase latency as packets are not processed as quickly.
The default behaviour of the driver previously assumed a static
InterruptThrottleRate value of 8000, providing a good fallback value
for all traffic types,but lacking in small packet performance and
latency. The hardware can handle many more small packets per second
however, and for this reason an adaptive interrupt moderation algorithm
was implemented.
Since 7.3.x, the driver has two adaptive modes (setting 1 or 3) in
which it dynamically adjusts the InterruptThrottleRate value based on
the traffic that it receives. After determining the type of incoming
traffic in the last timeframe, it will adjust the InterruptThrottleRate
to an appropriate value for that traffic.
The algorithm classifies the incoming traffic every interval into
classes. Once the class is determined, the InterruptThrottleRate
value is adjusted to suit that traffic type the best. There are
three classes defined: "Bulk traffic", for large amounts of packets
of normal size; "Low latency", for small amounts of traffic and/or
a significant percentage of small packets; and "Lowest latency",
for almost completely small packets or minimal traffic.
In dynamic conservative mode, the InterruptThrottleRate value is
set to 4000 for traffic that falls in class "Bulk traffic". If
traffic falls in the "Low latency" or "Lowest latency" class, the
InterruptThrottleRate is increased stepwise to 20000. This default
mode is suitable for most applications.
For situations where low latency is vital such as cluster or
grid computing, the algorithm can reduce latency even more when
InterruptThrottleRate is set to mode 1. In this mode, which operates
the same as mode 3, the InterruptThrottleRate will be increased
stepwise to 70000 for traffic in class "Lowest latency".
Setting InterruptThrottleRate to 0 turns off any interrupt moderation
and may improve small packet latency, but is generally not suitable
for bulk throughput traffic.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Rick Jones <rick.jones2@hp.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
2006-11-02 00:48:13 +08:00
|
|
|
adapter->itr_setting = adapter->itr;
|
|
|
|
adapter->itr = 20000;
|
2006-08-29 05:56:32 +08:00
|
|
|
break;
|
2010-05-05 06:26:03 +08:00
|
|
|
case 4:
|
|
|
|
e_dev_info("%s set to simplified "
|
2013-02-09 20:49:21 +08:00
|
|
|
"(2000-8000) ints mode\n", opt.name);
|
2010-05-05 06:26:03 +08:00
|
|
|
adapter->itr_setting = adapter->itr;
|
|
|
|
break;
|
2006-08-29 05:56:32 +08:00
|
|
|
default:
|
|
|
|
e1000_validate_option(&adapter->itr, &opt,
|
2013-02-09 20:49:21 +08:00
|
|
|
adapter);
|
2010-05-05 06:26:03 +08:00
|
|
|
/* save the setting, because the dynamic bits
|
|
|
|
* change itr.
|
|
|
|
* clear the lower two bits because they are
|
2013-02-09 20:49:21 +08:00
|
|
|
* used as control
|
|
|
|
*/
|
2006-12-15 17:29:31 +08:00
|
|
|
adapter->itr_setting = adapter->itr & ~3;
|
2006-08-29 05:56:32 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
e1000: add dynamic itr modes
Add a new dynamic itr algorithm, with 2 modes, and make it the default
operation mode. This greatly reduces latency and increases small packet
performance, at the "cost" of some CPU utilization. Bulk traffic
throughput is unaffected.
The driver can limit the amount of interrupts per second that the
adapter will generate for incoming packets. It does this by writing a
value to the adapter that is based on the maximum amount of interrupts
that the adapter will generate per second.
Setting InterruptThrottleRate to a value greater or equal to 100 will
program the adapter to send out a maximum of that many interrupts per
second, even if more packets have come in. This reduces interrupt
load on the system and can lower CPU utilization under heavy load,
but will increase latency as packets are not processed as quickly.
The default behaviour of the driver previously assumed a static
InterruptThrottleRate value of 8000, providing a good fallback value
for all traffic types,but lacking in small packet performance and
latency. The hardware can handle many more small packets per second
however, and for this reason an adaptive interrupt moderation algorithm
was implemented.
Since 7.3.x, the driver has two adaptive modes (setting 1 or 3) in
which it dynamically adjusts the InterruptThrottleRate value based on
the traffic that it receives. After determining the type of incoming
traffic in the last timeframe, it will adjust the InterruptThrottleRate
to an appropriate value for that traffic.
The algorithm classifies the incoming traffic every interval into
classes. Once the class is determined, the InterruptThrottleRate
value is adjusted to suit that traffic type the best. There are
three classes defined: "Bulk traffic", for large amounts of packets
of normal size; "Low latency", for small amounts of traffic and/or
a significant percentage of small packets; and "Lowest latency",
for almost completely small packets or minimal traffic.
In dynamic conservative mode, the InterruptThrottleRate value is
set to 4000 for traffic that falls in class "Bulk traffic". If
traffic falls in the "Low latency" or "Lowest latency" class, the
InterruptThrottleRate is increased stepwise to 20000. This default
mode is suitable for most applications.
For situations where low latency is vital such as cluster or
grid computing, the algorithm can reduce latency even more when
InterruptThrottleRate is set to mode 1. In this mode, which operates
the same as mode 3, the InterruptThrottleRate will be increased
stepwise to 70000 for traffic in class "Lowest latency".
Setting InterruptThrottleRate to 0 turns off any interrupt moderation
and may improve small packet latency, but is generally not suitable
for bulk throughput traffic.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Rick Jones <rick.jones2@hp.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
2006-11-02 00:48:13 +08:00
|
|
|
adapter->itr_setting = opt.def;
|
|
|
|
adapter->itr = 20000;
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
}
|
2006-06-28 00:06:45 +08:00
|
|
|
{ /* Smart Power Down */
|
2008-08-27 16:14:46 +08:00
|
|
|
opt = (struct e1000_option) {
|
2006-06-28 00:06:45 +08:00
|
|
|
.type = enable_option,
|
|
|
|
.name = "PHY Smart Power Down",
|
|
|
|
.err = "defaulting to Disabled",
|
|
|
|
.def = OPTION_DISABLED
|
|
|
|
};
|
|
|
|
|
2006-08-29 05:56:32 +08:00
|
|
|
if (num_SmartPowerDownEnable > bd) {
|
2007-10-30 01:46:19 +08:00
|
|
|
unsigned int spd = SmartPowerDownEnable[bd];
|
2006-08-29 05:56:32 +08:00
|
|
|
e1000_validate_option(&spd, &opt, adapter);
|
|
|
|
adapter->smart_power_down = spd;
|
|
|
|
} else {
|
|
|
|
adapter->smart_power_down = opt.def;
|
|
|
|
}
|
2006-06-28 00:06:45 +08:00
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2006-01-19 05:01:39 +08:00
|
|
|
switch (adapter->hw.media_type) {
|
2005-04-17 06:20:36 +08:00
|
|
|
case e1000_media_type_fiber:
|
|
|
|
case e1000_media_type_internal_serdes:
|
|
|
|
e1000_check_fiber_options(adapter);
|
|
|
|
break;
|
|
|
|
case e1000_media_type_copper:
|
|
|
|
e1000_check_copper_options(adapter);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
BUG();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* e1000_check_fiber_options - Range Checking for Link Options, Fiber Version
|
|
|
|
* @adapter: board private structure
|
|
|
|
*
|
|
|
|
* Handles speed and duplex options on fiber adapters
|
|
|
|
**/
|
2012-12-03 22:24:25 +08:00
|
|
|
static void e1000_check_fiber_options(struct e1000_adapter *adapter)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
|
|
|
int bd = adapter->bd_number;
|
2006-08-29 05:56:32 +08:00
|
|
|
if (num_Speed > bd) {
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("Speed not valid for fiber adapters, parameter "
|
|
|
|
"ignored\n");
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
2006-08-29 05:56:32 +08:00
|
|
|
if (num_Duplex > bd) {
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("Duplex not valid for fiber adapters, parameter "
|
|
|
|
"ignored\n");
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
2006-08-29 05:56:32 +08:00
|
|
|
if ((num_AutoNeg > bd) && (AutoNeg[bd] != 0x20)) {
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("AutoNeg other than 1000/Full is not valid for fiber"
|
|
|
|
"adapters, parameter ignored\n");
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* e1000_check_copper_options - Range Checking for Link Options, Copper Version
|
|
|
|
* @adapter: board private structure
|
|
|
|
*
|
|
|
|
* Handles speed and duplex options on copper adapters
|
|
|
|
**/
|
2012-12-03 22:24:25 +08:00
|
|
|
static void e1000_check_copper_options(struct e1000_adapter *adapter)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2008-08-27 16:14:46 +08:00
|
|
|
struct e1000_option opt;
|
2007-10-30 01:46:19 +08:00
|
|
|
unsigned int speed, dplx, an;
|
2005-04-17 06:20:36 +08:00
|
|
|
int bd = adapter->bd_number;
|
|
|
|
|
|
|
|
{ /* Speed */
|
2008-08-27 16:14:46 +08:00
|
|
|
static const struct e1000_opt_list speed_list[] = {
|
|
|
|
{ 0, "" },
|
|
|
|
{ SPEED_10, "" },
|
|
|
|
{ SPEED_100, "" },
|
|
|
|
{ SPEED_1000, "" }};
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2008-08-27 16:14:46 +08:00
|
|
|
opt = (struct e1000_option) {
|
2005-04-17 06:20:36 +08:00
|
|
|
.type = list_option,
|
|
|
|
.name = "Speed",
|
|
|
|
.err = "parameter ignored",
|
|
|
|
.def = 0,
|
|
|
|
.arg = { .l = { .nr = ARRAY_SIZE(speed_list),
|
|
|
|
.p = speed_list }}
|
|
|
|
};
|
|
|
|
|
2006-08-29 05:56:32 +08:00
|
|
|
if (num_Speed > bd) {
|
|
|
|
speed = Speed[bd];
|
|
|
|
e1000_validate_option(&speed, &opt, adapter);
|
|
|
|
} else {
|
|
|
|
speed = opt.def;
|
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
{ /* Duplex */
|
2008-08-27 16:14:46 +08:00
|
|
|
static const struct e1000_opt_list dplx_list[] = {
|
|
|
|
{ 0, "" },
|
|
|
|
{ HALF_DUPLEX, "" },
|
|
|
|
{ FULL_DUPLEX, "" }};
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2008-08-27 16:14:46 +08:00
|
|
|
opt = (struct e1000_option) {
|
2005-04-17 06:20:36 +08:00
|
|
|
.type = list_option,
|
|
|
|
.name = "Duplex",
|
|
|
|
.err = "parameter ignored",
|
|
|
|
.def = 0,
|
|
|
|
.arg = { .l = { .nr = ARRAY_SIZE(dplx_list),
|
|
|
|
.p = dplx_list }}
|
|
|
|
};
|
|
|
|
|
2006-08-29 05:56:32 +08:00
|
|
|
if (num_Duplex > bd) {
|
|
|
|
dplx = Duplex[bd];
|
|
|
|
e1000_validate_option(&dplx, &opt, adapter);
|
|
|
|
} else {
|
|
|
|
dplx = opt.def;
|
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
2006-08-29 05:56:32 +08:00
|
|
|
if ((num_AutoNeg > bd) && (speed != 0 || dplx != 0)) {
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("AutoNeg specified along with Speed or Duplex, "
|
|
|
|
"parameter ignored\n");
|
2005-04-17 06:20:36 +08:00
|
|
|
adapter->hw.autoneg_advertised = AUTONEG_ADV_DEFAULT;
|
|
|
|
} else { /* Autoneg */
|
2008-08-27 16:14:46 +08:00
|
|
|
static const struct e1000_opt_list an_list[] =
|
2005-04-17 06:20:36 +08:00
|
|
|
#define AA "AutoNeg advertising "
|
|
|
|
{{ 0x01, AA "10/HD" },
|
|
|
|
{ 0x02, AA "10/FD" },
|
|
|
|
{ 0x03, AA "10/FD, 10/HD" },
|
|
|
|
{ 0x04, AA "100/HD" },
|
|
|
|
{ 0x05, AA "100/HD, 10/HD" },
|
|
|
|
{ 0x06, AA "100/HD, 10/FD" },
|
|
|
|
{ 0x07, AA "100/HD, 10/FD, 10/HD" },
|
|
|
|
{ 0x08, AA "100/FD" },
|
|
|
|
{ 0x09, AA "100/FD, 10/HD" },
|
|
|
|
{ 0x0a, AA "100/FD, 10/FD" },
|
|
|
|
{ 0x0b, AA "100/FD, 10/FD, 10/HD" },
|
|
|
|
{ 0x0c, AA "100/FD, 100/HD" },
|
|
|
|
{ 0x0d, AA "100/FD, 100/HD, 10/HD" },
|
|
|
|
{ 0x0e, AA "100/FD, 100/HD, 10/FD" },
|
|
|
|
{ 0x0f, AA "100/FD, 100/HD, 10/FD, 10/HD" },
|
|
|
|
{ 0x20, AA "1000/FD" },
|
|
|
|
{ 0x21, AA "1000/FD, 10/HD" },
|
|
|
|
{ 0x22, AA "1000/FD, 10/FD" },
|
|
|
|
{ 0x23, AA "1000/FD, 10/FD, 10/HD" },
|
|
|
|
{ 0x24, AA "1000/FD, 100/HD" },
|
|
|
|
{ 0x25, AA "1000/FD, 100/HD, 10/HD" },
|
|
|
|
{ 0x26, AA "1000/FD, 100/HD, 10/FD" },
|
|
|
|
{ 0x27, AA "1000/FD, 100/HD, 10/FD, 10/HD" },
|
|
|
|
{ 0x28, AA "1000/FD, 100/FD" },
|
|
|
|
{ 0x29, AA "1000/FD, 100/FD, 10/HD" },
|
|
|
|
{ 0x2a, AA "1000/FD, 100/FD, 10/FD" },
|
|
|
|
{ 0x2b, AA "1000/FD, 100/FD, 10/FD, 10/HD" },
|
|
|
|
{ 0x2c, AA "1000/FD, 100/FD, 100/HD" },
|
|
|
|
{ 0x2d, AA "1000/FD, 100/FD, 100/HD, 10/HD" },
|
|
|
|
{ 0x2e, AA "1000/FD, 100/FD, 100/HD, 10/FD" },
|
|
|
|
{ 0x2f, AA "1000/FD, 100/FD, 100/HD, 10/FD, 10/HD" }};
|
|
|
|
|
2008-08-27 16:14:46 +08:00
|
|
|
opt = (struct e1000_option) {
|
2005-04-17 06:20:36 +08:00
|
|
|
.type = list_option,
|
|
|
|
.name = "AutoNeg",
|
|
|
|
.err = "parameter ignored",
|
|
|
|
.def = AUTONEG_ADV_DEFAULT,
|
|
|
|
.arg = { .l = { .nr = ARRAY_SIZE(an_list),
|
|
|
|
.p = an_list }}
|
|
|
|
};
|
|
|
|
|
2006-08-29 05:56:32 +08:00
|
|
|
if (num_AutoNeg > bd) {
|
|
|
|
an = AutoNeg[bd];
|
|
|
|
e1000_validate_option(&an, &opt, adapter);
|
|
|
|
} else {
|
|
|
|
an = opt.def;
|
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
adapter->hw.autoneg_advertised = an;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (speed + dplx) {
|
|
|
|
case 0:
|
|
|
|
adapter->hw.autoneg = adapter->fc_autoneg = 1;
|
2006-08-29 05:56:32 +08:00
|
|
|
if ((num_Speed > bd) && (speed != 0 || dplx != 0))
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("Speed and duplex autonegotiation "
|
|
|
|
"enabled\n");
|
2005-04-17 06:20:36 +08:00
|
|
|
break;
|
|
|
|
case HALF_DUPLEX:
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("Half Duplex specified without Speed\n");
|
|
|
|
e_dev_info("Using Autonegotiation at Half Duplex only\n");
|
2005-04-17 06:20:36 +08:00
|
|
|
adapter->hw.autoneg = adapter->fc_autoneg = 1;
|
|
|
|
adapter->hw.autoneg_advertised = ADVERTISE_10_HALF |
|
2013-02-09 20:49:21 +08:00
|
|
|
ADVERTISE_100_HALF;
|
2005-04-17 06:20:36 +08:00
|
|
|
break;
|
|
|
|
case FULL_DUPLEX:
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("Full Duplex specified without Speed\n");
|
|
|
|
e_dev_info("Using Autonegotiation at Full Duplex only\n");
|
2005-04-17 06:20:36 +08:00
|
|
|
adapter->hw.autoneg = adapter->fc_autoneg = 1;
|
|
|
|
adapter->hw.autoneg_advertised = ADVERTISE_10_FULL |
|
2013-02-09 20:49:21 +08:00
|
|
|
ADVERTISE_100_FULL |
|
|
|
|
ADVERTISE_1000_FULL;
|
2005-04-17 06:20:36 +08:00
|
|
|
break;
|
|
|
|
case SPEED_10:
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("10 Mbps Speed specified without Duplex\n");
|
|
|
|
e_dev_info("Using Autonegotiation at 10 Mbps only\n");
|
2005-04-17 06:20:36 +08:00
|
|
|
adapter->hw.autoneg = adapter->fc_autoneg = 1;
|
|
|
|
adapter->hw.autoneg_advertised = ADVERTISE_10_HALF |
|
2013-02-09 20:49:21 +08:00
|
|
|
ADVERTISE_10_FULL;
|
2005-04-17 06:20:36 +08:00
|
|
|
break;
|
|
|
|
case SPEED_10 + HALF_DUPLEX:
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("Forcing to 10 Mbps Half Duplex\n");
|
2005-04-17 06:20:36 +08:00
|
|
|
adapter->hw.autoneg = adapter->fc_autoneg = 0;
|
|
|
|
adapter->hw.forced_speed_duplex = e1000_10_half;
|
|
|
|
adapter->hw.autoneg_advertised = 0;
|
|
|
|
break;
|
|
|
|
case SPEED_10 + FULL_DUPLEX:
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("Forcing to 10 Mbps Full Duplex\n");
|
2005-04-17 06:20:36 +08:00
|
|
|
adapter->hw.autoneg = adapter->fc_autoneg = 0;
|
|
|
|
adapter->hw.forced_speed_duplex = e1000_10_full;
|
|
|
|
adapter->hw.autoneg_advertised = 0;
|
|
|
|
break;
|
|
|
|
case SPEED_100:
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("100 Mbps Speed specified without Duplex\n");
|
|
|
|
e_dev_info("Using Autonegotiation at 100 Mbps only\n");
|
2005-04-17 06:20:36 +08:00
|
|
|
adapter->hw.autoneg = adapter->fc_autoneg = 1;
|
|
|
|
adapter->hw.autoneg_advertised = ADVERTISE_100_HALF |
|
2013-02-09 20:49:21 +08:00
|
|
|
ADVERTISE_100_FULL;
|
2005-04-17 06:20:36 +08:00
|
|
|
break;
|
|
|
|
case SPEED_100 + HALF_DUPLEX:
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("Forcing to 100 Mbps Half Duplex\n");
|
2005-04-17 06:20:36 +08:00
|
|
|
adapter->hw.autoneg = adapter->fc_autoneg = 0;
|
|
|
|
adapter->hw.forced_speed_duplex = e1000_100_half;
|
|
|
|
adapter->hw.autoneg_advertised = 0;
|
|
|
|
break;
|
|
|
|
case SPEED_100 + FULL_DUPLEX:
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("Forcing to 100 Mbps Full Duplex\n");
|
2005-04-17 06:20:36 +08:00
|
|
|
adapter->hw.autoneg = adapter->fc_autoneg = 0;
|
|
|
|
adapter->hw.forced_speed_duplex = e1000_100_full;
|
|
|
|
adapter->hw.autoneg_advertised = 0;
|
|
|
|
break;
|
|
|
|
case SPEED_1000:
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("1000 Mbps Speed specified without Duplex\n");
|
2007-01-19 01:25:15 +08:00
|
|
|
goto full_duplex_only;
|
2005-04-17 06:20:36 +08:00
|
|
|
case SPEED_1000 + HALF_DUPLEX:
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("Half Duplex is not supported at 1000 Mbps\n");
|
2007-01-19 01:25:15 +08:00
|
|
|
/* fall through */
|
2005-04-17 06:20:36 +08:00
|
|
|
case SPEED_1000 + FULL_DUPLEX:
|
2007-01-19 01:25:15 +08:00
|
|
|
full_duplex_only:
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("Using Autonegotiation at 1000 Mbps Full Duplex "
|
|
|
|
"only\n");
|
2005-04-17 06:20:36 +08:00
|
|
|
adapter->hw.autoneg = adapter->fc_autoneg = 1;
|
|
|
|
adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
BUG();
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Speed, AutoNeg and MDI/MDI-X must all play nice */
|
|
|
|
if (e1000_validate_mdi_setting(&(adapter->hw)) < 0) {
|
2010-04-27 22:02:58 +08:00
|
|
|
e_dev_info("Speed, AutoNeg and MDI-X specs are incompatible. "
|
|
|
|
"Setting MDI-X to a compatible value.\n");
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|