diff mbox series

[net-next,v3] intel: make module parameters readable in sys filesystem

Message ID 20240213222344.195885-1-jmaxwell37@gmail.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v3] intel: make module parameters readable in sys filesystem | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 989 this patch: 989
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 1006 this patch: 1006
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api warning Found: 'module_param' was: 5 now: 5
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1006 this patch: 1006
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 33 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-02-15--00-00 (tests: 1443)

Commit Message

Jonathan Maxwell Feb. 13, 2024, 10:23 p.m. UTC
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 <jmaxwell37@gmail.com>
---
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(-)

Comments

Paul Menzel Feb. 14, 2024, 7:22 a.m. UTC | #1
Dear Jon,


Thank you very much for your patch.

Am 13.02.24 um 11:23 PM schrieb 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 <jmaxwell37@gmail.com>
> ---
> 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


> 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(-)
> 
> diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
> index 01f0f12035caeb7ca1657387538fcebf5c608322..3fcb8daaa2437fa3fe7b98ba9f606dbbb1844e58 100644
> --- a/drivers/net/ethernet/intel/e100.c
> +++ b/drivers/net/ethernet/intel/e100.c
> @@ -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");
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
> index 4df8d4153aa5f5ce7ac9dd566180d552be9f5b4f..31d0a43a908c0a4eab4fe1147064a5f5677c9f0b 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -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.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> index bd541527c8c74d6922e8683e2f4493d9b361f67b..9d26ff82a397d4939cf7adea78c217e4071aa166 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> @@ -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");
>
Heiner Kallweit Feb. 14, 2024, 7:32 a.m. UTC | #2
On 14.02.2024 08:22, Paul Menzel wrote:
> Dear Jon,
> 
> 
> Thank you very much for your patch.
> 
> Am 13.02.24 um 11:23 PM schrieb 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 <jmaxwell37@gmail.com>
>> ---
>> 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
> 
> 
>> 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(-)
>>
>> diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
>> index 01f0f12035caeb7ca1657387538fcebf5c608322..3fcb8daaa2437fa3fe7b98ba9f606dbbb1844e58 100644
>> --- a/drivers/net/ethernet/intel/e100.c
>> +++ b/drivers/net/ethernet/intel/e100.c
>> @@ -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");
>> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
>> index 4df8d4153aa5f5ce7ac9dd566180d552be9f5b4f..31d0a43a908c0a4eab4fe1147064a5f5677c9f0b 100644
>> --- a/drivers/net/ethernet/intel/igb/igb_main.c
>> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
>> @@ -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.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> index bd541527c8c74d6922e8683e2f4493d9b361f67b..9d26ff82a397d4939cf7adea78c217e4071aa166 100644
>> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> @@ -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.

>>   #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");
>>   
>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
index 01f0f12035caeb7ca1657387538fcebf5c608322..3fcb8daaa2437fa3fe7b98ba9f606dbbb1844e58 100644
--- a/drivers/net/ethernet/intel/e100.c
+++ b/drivers/net/ethernet/intel/e100.c
@@ -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");
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 4df8d4153aa5f5ce7ac9dd566180d552be9f5b4f..31d0a43a908c0a4eab4fe1147064a5f5677c9f0b 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -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.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index bd541527c8c74d6922e8683e2f4493d9b361f67b..9d26ff82a397d4939cf7adea78c217e4071aa166 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -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");