intel: make module parameters readable in sys filesystem
Subsystems (3)
Linux users sometimes need an easy way to check current values of module parameters. For example the module may be manually reloaded with different parameters. Make these visible and readable in the /sys filesystem to allow that.
--- drivers/net/ethernet/intel/e100.c | 6 +++--- drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +- drivers/net/ethernet/intel/e1000e/netdev.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- drivers/net/ethernet/intel/igb/igb_main.c | 4 ++-- drivers/net/ethernet/intel/igbvf/netdev.c | 2 +- drivers/net/ethernet/intel/igc/igc_main.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 6 +++--- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-)
drivers/net/ethernet/intel/e100.c +3 -3
@@ -170,9 +170,9 @@ MODULE_FIRMWARE(FIRMWARE_D102E);static int debug =3 ;static int eeprom_bad_csum_allow =0 ;static int use_io =0 ; -module_param (debug, int,0 ); -module_param (eeprom_bad_csum_allow, int,0 ); -module_param (use_io, int,0 ); +module_param (debug, int,0444 ); +module_param (eeprom_bad_csum_allow, int,0444 ); +module_param (use_io, int,0444 );MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" );MODULE_PARM_DESC (eeprom_bad_csum_allow,"Allow bad eeprom checksums" );MODULE_PARM_DESC (use_io,"Force use of i/o access mode" );
drivers/net/ethernet/intel/e1000/e1000_main.c +1 -1
@@ -195,7 +195,7 @@ MODULE_LICENSE("GPL v2");#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK)static int debug =-1 ; -module_param (debug, int,0 ); +module_param (debug, int,0444 );MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" );/**
drivers/net/ethernet/intel/e1000e/netdev.c +1 -1
@@ -34,7 +34,7 @@ char e1000e_driver_name[] = "e1000e";#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK)static int debug =-1 ; -module_param (debug, int,0 ); +module_param (debug, int,0444 );MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" );static const struct e1000_info *e1000_info_tbl[] = {
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
@@ -95,7 +95,7 @@ MODULE_DEVICE_TABLE(pci, i40e_pci_tbl);#define I40E_MAX_VF_COUNT 128static int debug =-1 ; -module_param (debug, uint,0 ); +module_param (debug, uint,0444 );MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all), Debug mask (0x8XXXXXXX)" );MODULE_AUTHOR ("Intel Corporation, <[email protected]>" );
drivers/net/ethernet/intel/igb/igb_main.c +2 -2
@@ -202,7 +202,7 @@ static struct notifier_block dca_notifier = {#endif #ifdef CONFIG_PCI_IOV static unsigned int max_vfs; -module_param (max_vfs, uint,0 ); +module_param (max_vfs, uint,0444 );MODULE_PARM_DESC (max_vfs,"Maximum number of virtual functions to allocate per physical function" );#endif /* CONFIG_PCI_IOV */
@@ -238,7 +238,7 @@ MODULE_LICENSE("GPL v2");#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK)static int debug =-1 ; -module_param (debug, int,0 ); +module_param (debug, int,0444 );MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" );struct igb_reg_info {
drivers/net/ethernet/intel/igbvf/netdev.c +1 -1
@@ -32,7 +32,7 @@ static const char igbvf_copyright[] =#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK)static int debug =-1 ; -module_param (debug, int,0 ); +module_param (debug, int,0444 );MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" );static int igbvf_poll (struct napi_struct *napi,int budget);
drivers/net/ethernet/intel/igc/igc_main.c +1 -1
@@ -34,7 +34,7 @@ static int debug = -1;MODULE_AUTHOR ("Intel Corporation, <[email protected]>" );MODULE_DESCRIPTION (DRV_SUMMARY );MODULE_LICENSE ("GPL v2" ); -module_param (debug, int,0 ); +module_param (debug, int,0444 );MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" );char igc_driver_name[] ="igc" ;
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +3 -3
@@ -147,19 +147,19 @@ static struct notifier_block dca_notifier = {#ifdef CONFIG_PCI_IOV static unsigned int max_vfs; -module_param (max_vfs, uint,0 ); +module_param (max_vfs, uint,0444 );MODULE_PARM_DESC (max_vfs,"Maximum number of virtual functions to allocate per physical function - default is zero and maximum value is 63. (Deprecated)" );#endif /* CONFIG_PCI_IOV */ static bool allow_unsupported_sfp; -module_param (allow_unsupported_sfp, bool,0 ); +module_param (allow_unsupported_sfp, bool,0444 );MODULE_PARM_DESC (allow_unsupported_sfp,"Allow unsupported and untested SFP+ modules on 82599-based adapters" );#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK)static int debug =-1 ; -module_param (debug, int,0 ); +module_param (debug, int,0444 );MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" );MODULE_AUTHOR ("Intel Corporation, <[email protected]>" );
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +1 -1
@@ -82,7 +82,7 @@ MODULE_LICENSE("GPL v2");#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK)static int debug =-1 ; -module_param (debug, int,0 ); +module_param (debug, int,0444 );MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" );static struct workqueue_struct *ixgbevf_wq;
Signature · 1 line
2.39.3
Quoted 23 lines · Jon Maxwell
Linux users sometimes need an easy way to check current values of module parameters. For example the module may be manually reloaded with different parameters. Make these visible and readable in the /sys filesystem to allow that.
Signed-off-by Jon Maxwell <[email protected]>--- drivers/net/ethernet/intel/e100.c | 6 +++--- drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +- drivers/net/ethernet/intel/e1000e/netdev.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- drivers/net/ethernet/intel/igb/igb_main.c | 4 ++-- drivers/net/ethernet/intel/igbvf/netdev.c | 2 +- drivers/net/ethernet/intel/igc/igc_main.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 6 +++--- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-)drivers/net/ethernet/intel/e100.c +0
-0
drivers/net/ethernet/intel/e100.c MODULE_FIRMWARE(FIRMWARE_D102E); · line 173
Quoted 7 lines
drivers/net/ethernet/intel/e100.c +1
-3@@ -170,9 +170,9 @@ MODULE_FIRMWARE(FIRMWARE_D102E);static int debug =3 ;static int eeprom_bad_csum_allow =0 ;static int use_io =0 ; -module_param (debug, int,0 ); -module_param (eeprom_bad_csum_allow, int,0 ); -module_param (use_io, int,0 ); +module_param (debug, int,0444 );
ethtool should show you debug. And it is pretty much standardized, it should work for most ethernet interfaces which support msglvl. So i would say it is better to teach your Linux users how to use ethtool for this.
There might be some value in this change for module parameters which are not standardised, but i suggest you drop debug from the patchset.
Andrew
Quoted 29 lines · Andrew Lunn
Quoted 27 lines · Jon Maxwell
Linux users sometimes need an easy way to check current values of module parameters. For example the module may be manually reloaded with different parameters. Make these visible and readable in the /sys filesystem to allow that.
Signed-off-by Jon Maxwell <[email protected]>--- drivers/net/ethernet/intel/e100.c | 6 +++--- drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +- drivers/net/ethernet/intel/e1000e/netdev.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- drivers/net/ethernet/intel/igb/igb_main.c | 4 ++-- drivers/net/ethernet/intel/igbvf/netdev.c | 2 +- drivers/net/ethernet/intel/igc/igc_main.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 6 +++--- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-)drivers/net/ethernet/intel/e100.c +0
-1@@ -170,9 +170,9 @@ MODULE_FIRMWARE(FIRMWARE_D102E);static int debug =3 ;static int eeprom_bad_csum_allow =0 ;static int use_io =0 ; -module_param (debug, int,0 );
Quoted 8 lines
drivers/net/ethernet/intel/e100.c MODULE_FIRMWARE(FIRMWARE_D102E); · line 173
Quoted 3 lines
drivers/net/ethernet/intel/e100.c +1
-2-module_param (eeprom_bad_csum_allow, int,0 ); -module_param (use_io, int,0 ); +module_param (debug, int,0444 );ethtool should show you debug. And it is pretty much standardized, it should work for most ethernet interfaces which support msglvl. So i would say it is better to teach your Linux users how to use ethtool for this.
Yes they know about that. But take the scenario where allow_unsupported_sfp is set 0 after it was set to 1 at boot. That won't be logged.
Quoted 4 lines
There might be some value in this change for module parameters which are not standardised, but i suggest you drop debug from the patchset.
Fair enough makes sense seeing that it can be controlled by ethtool. I'll submit a v2 with that change.
Regards
Jon
Quoted 1 line
Andrew