#define COPYBREAK_DEFAULT 256 unsignedint copybreak = COPYBREAK_DEFAULT;
module_param(copybreak, uint, 0644);
MODULE_PARM_DESC(copybreak, "Maximum size of packet that is copied to a new buffer on receive");
/* 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) \ staticint X[E1000_MAX_NIC+1] = E1000_PARAM_INIT; \ staticunsignedint num_##X; \
module_param_array_named(X, X, int, &num_##X, 0); \
MODULE_PARM_DESC(X, desc);
/* Transmit Interrupt Delay in units of 1.024 microseconds * Tx interrupt delay needs to typically be set to something non-zero * * Valid Range: 0-65535
*/
E1000_PARAM(TxIntDelay, "Transmit Interrupt Delay"); #define DEFAULT_TIDV 8 #define MAX_TXDELAY 0xFFFF #define MIN_TXDELAY 0
/* Transmit Absolute Interrupt Delay in units of 1.024 microseconds * * Valid Range: 0-65535
*/
E1000_PARAM(TxAbsIntDelay, "Transmit Absolute Interrupt Delay"); #define DEFAULT_TADV 32 #define MAX_TXABSDELAY 0xFFFF #define MIN_TXABSDELAY 0
/* 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
/* IntMode (Interrupt Mode) * * Valid Range: varies depending on kernel configuration & hardware support * * legacy=0, MSI=1, MSI-X=2 * * When MSI/MSI-X support is enabled in kernel- * Default Value: 2 (MSI-X) when supported by hardware, 1 (MSI) otherwise * When MSI/MSI-X support is not enabled in kernel- * Default Value: 0 (legacy) * * When a mode is specified that is not allowed/supported, it will be * demoted to the most advanced interrupt mode available.
*/
E1000_PARAM(IntMode, "Interrupt Mode");
/* Enable Smart Power Down of the PHY * * Valid Range: 0, 1 * * Default Value: 0 (disabled)
*/
E1000_PARAM(SmartPowerDownEnable, "Enable PHY smart power down");
/** * e1000e_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.
**/ void e1000e_check_options(struct e1000_adapter *adapter)
{ struct e1000_hw *hw = &adapter->hw; int bd = adapter->bd_number;
if (bd >= E1000_MAX_NIC) {
dev_notice(&adapter->pdev->dev, "Warning: no configuration for board #%i\n", bd);
dev_notice(&adapter->pdev->dev, "Using defaults for all values\n");
}
if (num_InterruptThrottleRate > bd) {
adapter->itr = InterruptThrottleRate[bd];
/* Make sure a message is printed for non-special * values. And in case of an invalid option, display * warning, use default and go through itr/itr_setting * adjustment logic below
*/ if ((adapter->itr > 4) &&
e1000_validate_option(&adapter->itr, &opt, adapter))
adapter->itr = opt.def;
} else { /* If no option specified, use default value and go * through the logic below to adjust itr/itr_setting
*/
adapter->itr = opt.def;
/* Make sure a message is printed for non-special * default values
*/ if (adapter->itr > 4)
dev_info(&adapter->pdev->dev, "%s set to default %d\n", opt.name,
adapter->itr);
}
adapter->itr_setting = adapter->itr; switch (adapter->itr) { case 0:
dev_info(&adapter->pdev->dev, "%s turned off\n",
opt.name); break; case 1:
dev_info(&adapter->pdev->dev, "%s set to dynamic mode\n", opt.name);
adapter->itr = 20000; break; case 2:
dev_info(&adapter->pdev->dev, "%s Invalid mode - setting default\n",
opt.name);
adapter->itr_setting = opt.def;
fallthrough; case 3:
dev_info(&adapter->pdev->dev, "%s set to dynamic conservative mode\n",
opt.name);
adapter->itr = 20000; break; case 4:
dev_info(&adapter->pdev->dev, "%s set to simplified (2000-8000 ints) mode\n",
opt.name); break; default: /* Save the setting, because the dynamic bits * change itr. * * Clear the lower two bits because * they are used as control.
*/
adapter->itr_setting &= ~3; break;
}
} /* Interrupt Mode */
{ staticstruct e1000_option opt = {
.type = range_option,
.name = "Interrupt Mode", #ifndef CONFIG_PCI_MSI
.err = "defaulting to 0 (legacy)",
.def = E1000E_INT_MODE_LEGACY,
.arg = { .r = { .min = 0,
.max = 0 } } #endif
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.