Product SiteDocumentation Site

23.5. Setting Module Parameters

Like the kernel itself, modules can also take parameters that change their behavior. Most of the time, the default ones work well, but occasionally it is necessary or desirable to set custom parameters for a module. Because parameters cannot be dynamically set for a module that is already loaded into a running kernel, there are two different methods for setting them.
  1. You can unload all dependencies of the module you want to set parameters for, unload the module using modprobe -r, and then load it with modprobe along with a list of customized parameters. This method is often used when the module does not have many dependencies, or to test different combinations of parameters without making them persistent, and is the method covered in this section.
  2. Alternatively, you can list the new parameters in an existing or newly created file in the /etc/modprobe.d/ directory. This method makes the module parameters persistent by ensuring that they are set each time the module is loaded, such as after every reboot or modprobe command. This method is covered in Section 23.6, “Persistent Module Loading”, though the following information is a prerequisite.
Example 23.5. Supplying optional parameters when loading a kernel module
You can use modprobe to load a kernel module with custom parameters using the following command line format:
~]# modprobe module_name [parameter=value] 

When loading a module with custom parameters on the command line, be aware of the following:
Here are the recommended steps for setting custom parameters and then loading a kernel module. This procedure illustrates the steps using the e1000e module, which is the network driver for Intel PRO/1000 network adapters, as an example:
Procedure 23.1. Loading a Kernel Module with Custom Parameters
  1. First, ensure the module is not already loaded into the kernel:
    ~]# lsmod |grep e1000e
    Output would indicate that the module is already loaded into the kernel, in which case you must first unload it before proceeding. See Section 23.4, “Unloading a Module” for instructions on safely unloading it.
  2. Load the module and list all custom parameters after the module name. For example, if you wanted to load the Intel PRO/1000 network driver with the interrupt throttle rate set to 3000 interrupts per second for the first, second, and third instances of the driver, and turn on debug, you would run, as root:
    ~]# modprobe e1000e InterruptThrottleRate=3000,3000,3000 debug=1
    This example illustrates passing multiple values to a single parameter by separating them with commas and omitting any spaces between them.