intel: make module parameters readable in sys filesystem
Subsystems (3)
PATCH v3 1/1 intel: make module parameters readable in sys filesystem
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.
---
V2: Remove the "debug" module parameter as per Andrew Lunns suggestion.
V3: Correctly format v2.
drivers/net/ethernet/intel/e100.c | 4 ++-- drivers/net/ethernet/intel/igb/igb_main.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/e100.c +2 -2
@@ -171,8 +171,8 @@ 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 (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/igb/igb_main.c +1 -1
@@ -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 */
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +2 -2
@@ -147,13 +147,13 @@ 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" );
Signature · 1 line
2.39.3
Dear Jon,
Thank you very much for your patch.
Am 13.02.24 um 11:23 PM schrieb Jon Maxwell:
Quoted 8 lines
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]>---
V2: Remove the "debug" module parameter as per Andrew Lunns suggestion.
Please mention this in the commit message, why debug should not be exposed.
Kind regards,
Paul
Quoted 54 lines
V3: Correctly format v2.
drivers/net/ethernet/intel/e100.c | 4 ++-- drivers/net/ethernet/intel/igb/igb_main.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-)drivers/net/ethernet/intel/e100.c +2
-2@@ -171,8 +171,8 @@ 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 (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/igb/igb_main.c +1
-1@@ -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 */ drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +2
-2@@ -147,13 +147,13 @@ 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" );
Quoted 59 lines · Paul Menzel
Dear Jon,
Thank you very much for your patch.
Am 13.02.24 um 11:23 PM schrieb Jon Maxwell:
Quoted 8 lines
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]>---
V2: Remove the "debug" module parameter as per Andrew Lunns suggestion.Please mention this in the commit message, why
debugshould not be exposed.Kind regards,
Paul
Quoted 36 lines
V3: Correctly format v2. drivers/net/ethernet/intel/e100.c | 4 ++-- drivers/net/ethernet/intel/igb/igb_main.c | 2 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c| 4 ++--3 files changed, 5 insertions(+), 5 deletions(-)drivers/net/ethernet/intel/e100.c +2
-2@@ -171,8 +171,8 @@ 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 (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/igb/igb_main.c +1
-1@@ -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 */diff --git
a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.cb/drivers/net/ethernet/intel/ixgbe/ixgbe_main.cindexbd541527c8c74d6922e8683e2f4493d9b361f67b..9d26ff82a397d4939cf7adea78c217e4071aa166100644 ---a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
Quoted 8 lines
drivers/net/ethernet/intel/igb/igb_main.c static struct notifier_block dca_notifier = { · line 151
Quoted 8 lines
+++
b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.cdrivers/net/ethernet/intel/igb/igb_main.c +1
-1@@ -147,13 +147,13 @@ 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)");
I doubt it makes sense to expose a deprecated parameter.
Quoted 8 lines
Quoted 7 lines
drivers/net/ethernet/intel/igb/igb_main.c +1
-1#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");