module be2net not loaded with define parameter in /etc/modprobe.d/

baptistemm asked:

I want to load the be2net module with the parameter rx_frag_size set to 4096, the default value being 2048.
As specified by the documentation I created a file /etc/modprobe.d/be2net.conf with the content options be2net rx_frag_size=4096.

However after the reboot, the rx_frag_size is still set to 2048 (checked with command cat /sys/module/be2net/parameters/rx_frag_size).

I tried to find any script that would modprobe be2net in /etc/ without success.

I also tried this method and put an executable script /etc/sysconfig/modules/be2net.modules to load the module using modprobe be2net rx_frag_size=4096 and did not work either, the parameter remains at 2048.

As last method, to verify if the file /etc/modprobe.d/be2net.conf is used by modprobe, I unloaded the module be2net and reloaded it using

modprobe -r be2net
modprobe be2net
cat /sys/module/be2net/parameters/rx_frag_size

so actually it works but this is not persistent.

Do you have any idea what would cause the module not being loaded with the parameter set in /etc/modprobe.d/be2net.conf at boot?


My answer:

Modules that are loaded in the initramfs need to have their module options copied to the initramfs, otherwise they’ll be loaded with their defaults.

To resolve this problem requires regenerating the initramfs. You can do this on RHEL 6 and later by running:

dracut -f -v

This regenerates the initramfs for the running kernel. To regenerate the initramfs for all installed kernels, add --regenerate-all to the command.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.