linux/igb_uio: make module parameters visible in sysfs

Message ID 20220821231950.5957-1-shinae@alkira.net (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers
Series linux/igb_uio: make module parameters visible in sysfs |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/iol-testing warning apply patch failure

Commit Message

Shinae Woo Aug. 21, 2022, 11:19 p.m. UTC
  - explicitly set default value for intr_mode
- give read permission on wc_activate
- applying patch gives below visibility

```
$ more /sys/module/igb_uio/parameters/* | cat
::::::::::::::
/sys/module/igb_uio/parameters/intr_mode
::::::::::::::
msix
::::::::::::::
/sys/module/igb_uio/parameters/wc_activate
::::::::::::::
0
```

Signed-off-by: Shinae Woo <shinae@alkira.net>
---
 linux/igb_uio/igb_uio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Stephen Hemminger Oct. 31, 2023, 4:59 p.m. UTC | #1
On Sun, 21 Aug 2022 16:19:50 -0700
Shinae Woo <shinae@alkira.net> wrote:

> diff --git a/linux/igb_uio/igb_uio.c b/linux/igb_uio/igb_uio.c
> index 33e0e02..c927ae6 100644
> --- a/linux/igb_uio/igb_uio.c
> +++ b/linux/igb_uio/igb_uio.c
> @@ -44,7 +44,7 @@ struct rte_uio_pci_dev {
>  };
>  
>  static int wc_activate;
> -static char *intr_mode;
> +static char *intr_mode = RTE_INTR_MODE_MSIX_NAME;

Since intr_mode is now initialized you can remove the code that checks for
it being NULL.


diff --git a/linux/igb_uio/igb_uio.c b/linux/igb_uio/igb_uio.c
index aea67da..11141d4 100644
--- a/linux/igb_uio/igb_uio.c
+++ b/linux/igb_uio/igb_uio.c
@@ -44,7 +44,7 @@ struct rte_uio_pci_dev {
 };
 
 static int wc_activate;
-static char *intr_mode;
+static char *intr_mode = RTE_INTR_MODE_MSIX_NAME;
 static enum rte_intr_mode igbuio_intr_mode_preferred = RTE_INTR_MODE_MSIX;
 /* sriov sysfs */
 static ssize_t
@@ -591,11 +591,6 @@ igbuio_pci_remove(struct pci_dev *dev)
 static int
 igbuio_config_intr_mode(char *intr_str)
 {
-	if (!intr_str) {
-		pr_info("Use MSIX interrupt by default\n");
-		return 0;
-	}
-
 	if (!strcmp(intr_str, RTE_INTR_MODE_MSIX_NAME)) {
 		igbuio_intr_mode_preferred = RTE_INTR_MODE_MSIX;
 		pr_info("Use MSIX interrupt\n");
  

Patch

diff --git a/linux/igb_uio/igb_uio.c b/linux/igb_uio/igb_uio.c
index 33e0e02..c927ae6 100644
--- a/linux/igb_uio/igb_uio.c
+++ b/linux/igb_uio/igb_uio.c
@@ -44,7 +44,7 @@  struct rte_uio_pci_dev {
 };
 
 static int wc_activate;
-static char *intr_mode;
+static char *intr_mode = RTE_INTR_MODE_MSIX_NAME;
 static enum rte_intr_mode igbuio_intr_mode_preferred = RTE_INTR_MODE_MSIX;
 /* sriov sysfs */
 static ssize_t
@@ -663,7 +663,7 @@  MODULE_PARM_DESC(intr_mode,
 "    " RTE_INTR_MODE_LEGACY_NAME "     Use Legacy interrupt\n"
 "\n");
 
-module_param(wc_activate, int, 0);
+module_param(wc_activate, int, S_IRUGO);
 MODULE_PARM_DESC(wc_activate,
 "Activate support for write combining (WC) (default=0)\n"
 "    0 - disable\n"