DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] linux/igb_uio: make module parameters visible in sysfs
@ 2022-08-21 23:19 Shinae Woo
  2023-10-31 16:59 ` Stephen Hemminger
  0 siblings, 1 reply; 4+ messages in thread
From: Shinae Woo @ 2022-08-21 23:19 UTC (permalink / raw)
  To: dev

- 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(-)

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"
-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] linux/igb_uio: make module parameters visible in sysfs
  2022-08-21 23:19 [PATCH] linux/igb_uio: make module parameters visible in sysfs Shinae Woo
@ 2023-10-31 16:59 ` Stephen Hemminger
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2023-10-31 16:59 UTC (permalink / raw)
  To: Shinae Woo; +Cc: dev

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");

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] linux/igb_uio: make module parameters visible in sysfs
  2022-08-21 22:12 Shinae Woo
@ 2023-07-06  2:40 ` Stephen Hemminger
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2023-07-06  2:40 UTC (permalink / raw)
  To: Shinae Woo; +Cc: dev

On Sun, 21 Aug 2022 15:12:13 -0700
Shinae Woo <shinae@alkira.net> wrote:

> - 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>

Looks ok.
This would have to go against dpdk-kmods tree.
Checkpatch is being overly picky here

Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] linux/igb_uio: make module parameters visible in sysfs
@ 2022-08-21 22:12 Shinae Woo
  2023-07-06  2:40 ` Stephen Hemminger
  0 siblings, 1 reply; 4+ messages in thread
From: Shinae Woo @ 2022-08-21 22:12 UTC (permalink / raw)
  To: dev

- 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(-)

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"
-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-31 16:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-21 23:19 [PATCH] linux/igb_uio: make module parameters visible in sysfs Shinae Woo
2023-10-31 16:59 ` Stephen Hemminger
  -- strict thread matches above, loose matches on Subject: below --
2022-08-21 22:12 Shinae Woo
2023-07-06  2:40 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).