Skip to contentSkip to conversation

dma/idxd: fix failure to configure a device instance for DSA

PATCH Superseded Wenwu Ma 3 participants 8 messages Jun 28, 2024 – Jul 9, 2024

Subsystems (2)
lore
Share & tools
lore

Wenwu Ma

author
#0 lore raw

PATCH 1/1 dma/idxd: fix failure to configure a device instance for DSA

In ubuntu 24.04, DSA's workqueue has a new driver_name file in sysfs, DPDK needs to write a correct value to this file when configuring a device instance using the dpdk_idxd_cfg.py script, otherwise it will fail to be configured, this patch fixes the issue.

---
 drivers/dma/idxd/dpdk_idxd_cfg.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/dma/idxd/dpdk_idxd_cfg.py +3 -1
index c0c833ade9..9ca4c4d76c 100755
@@ -104,8 +104,10 @@ def configure_dsa(dsa_id, args):
                  "priority": 1,
                  "max_batch_size": 1024,
                  "size": int(max_work_queues_size / nb_queues)}
-        wqcfg.update(parse_wq_opts(args.wq_option))
         wq_dir = SysfsDir(os.path.join(dsa_dir.path, f"wq{dsa_id}.{q}"))
+        if os.path.exists(SysfsDir(os.path.join(wq_dir.path, f"driver_name")).path):
+            wqcfg.update({"driver_name": "user"})
+        wqcfg.update(parse_wq_opts(args.wq_option))
         wq_dir.write_values(wqcfg)
 
     # enable device and then queues
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Wenwu Ma

In ubuntu 24.04, DSA's workqueue has a new driver_name file in sysfs, DPDK needs to write a correct value to this file when configuring a device instance using the dpdk_idxd_cfg.py script, otherwise it will fail to be configured, this patch fixes the issue.

---

One comment inline below. With that addressed:

Quoted 8 lines
 drivers/dma/idxd/dpdk_idxd_cfg.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/dma/idxd/dpdk_idxd_cfg.py +0 -0
index c0c833ade9..9ca4c4d76c 100755

drivers/dma/idxd/dpdk_idxd_cfg.py def configure_dsa(dsa_id, args): · line 108

Quoted 6 lines
drivers/dma/idxd/dpdk_idxd_cfg.py +1 -1
@@ -104,8 +104,10 @@ def configure_dsa(dsa_id, args):
                  "priority": 1,
                  "max_batch_size": 1024,
                  "size": int(max_work_queues_size / nb_queues)}
-        wqcfg.update(parse_wq_opts(args.wq_option))
         wq_dir = SysfsDir(os.path.join(dsa_dir.path, f"wq{dsa_id}.{q}"))
+        if os.path.exists(SysfsDir(os.path.join(wq_dir.path, f"driver_name")).path):

I think this be simplified to remove the extra SysfsDir call as:

	if os.path.exists(os.path.join(wq_dir.path,"driver_name")):
Quoted 8 lines
drivers/dma/idxd/dpdk_idxd_cfg.py +2 -0
+            wqcfg.update({"driver_name": "user"})
+        wqcfg.update(parse_wq_opts(args.wq_option))
         wq_dir.write_values(wqcfg)
 
     # enable device and then queues
Signature · 1 line
2.25.1
author
#2 lore raw

hi

Quoted 39 lines

-----Original Message-----
From: Richardson, Bruce <[email protected]>
Sent: Friday, June 28, 2024 5:28 PM
To: Ma, WenwuX <[email protected]>
Cc: [email protected]; Jiale, SongX <[email protected]>
Subject: Re: [PATCH] dma/idxd: fix failure to configure a device instance for DSA

Quoted 7 lines · Wenwu Ma

In ubuntu 24.04, DSA's workqueue has a new driver_name file in sysfs, DPDK needs to write a correct value to this file when configuring a device instance using the dpdk_idxd_cfg.py script, otherwise it will fail to be configured, this patch fixes the issue.

---

One comment inline below. With that addressed:

Quoted 9 lines
 drivers/dma/idxd/dpdk_idxd_cfg.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/dma/idxd/dpdk_idxd_cfg.py +0 -0
index c0c833ade9..9ca4c4d76c 100755

drivers/dma/idxd/dpdk_idxd_cfg.py def configure_dsa(dsa_id, args): · line 109

Quoted 7 lines
drivers/dma/idxd/dpdk_idxd_cfg.py +1 -1
@@ -104,8 +104,10 @@ def configure_dsa(dsa_id, args):
                  "priority": 1,
                  "max_batch_size": 1024,
                  "size": int(max_work_queues_size / nb_queues)}
-        wqcfg.update(parse_wq_opts(args.wq_option))
         wq_dir = SysfsDir(os.path.join(dsa_dir.path,
 f"wq{dsa_id}.{q}"))
+        if os.path.exists(SysfsDir(os.path.join(wq_dir.path,

f"driver_name")).path):

Quoted 2 lines

I think this be simplified to remove the extra SysfsDir call as:

	if os.path.exists(os.path.join(wq_dir.path,"driver_name")):

Ok, thanks

Quoted 9 lines
Quoted 9 lines
drivers/dma/idxd/dpdk_idxd_cfg.py +2 -0
+            wqcfg.update({"driver_name": "user"})
+        wqcfg.update(parse_wq_opts(args.wq_option))
         wq_dir.write_values(wqcfg)
 
     # enable device and then queues
--
2.25.1
author
#3 lore raw

PATCH v2 1/1 dma/idxd: fix failure to configure a device instance for DSA

In reply to Wenwu Ma

In ubuntu 24.04, DSA's workqueue has a new driver_name file in sysfs, DPDK needs to write a correct value to this file when configuring a device instance using the dpdk_idxd_cfg.py script, otherwise it will fail to be configured, this patch fixes the issue.

---
v2:
- refine the code

---
 drivers/dma/idxd/dpdk_idxd_cfg.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/dma/idxd/dpdk_idxd_cfg.py +3 -1
index c0c833ade9..5c9572b49d 100755
@@ -104,8 +104,10 @@ def configure_dsa(dsa_id, args):
                  "priority": 1,
                  "max_batch_size": 1024,
                  "size": int(max_work_queues_size / nb_queues)}
-        wqcfg.update(parse_wq_opts(args.wq_option))
         wq_dir = SysfsDir(os.path.join(dsa_dir.path, f"wq{dsa_id}.{q}"))
+        if os.path.exists(os.path.join(wq_dir.path, f"driver_name")):
+            wqcfg.update({"driver_name": "user"})
+        wqcfg.update(parse_wq_opts(args.wq_option))
         wq_dir.write_values(wqcfg)
 
     # enable device and then queues
Signature · 1 line
2.25.1
#5 lore raw
Quoted 6 lines · Bruce Richardson
Quoted 4 lines · Wenwu Ma

In ubuntu 24.04, DSA's workqueue has a new driver_name file in sysfs, DPDK needs to write a correct value to this file when configuring a device instance using the dpdk_idxd_cfg.py script, otherwise it will fail to be configured, this patch fixes the issue.

Pointing at the kernel version would be useful too.
I suppose this change is introduced with 7af1e0aceeb3 ("dmaengine:
idxd: add wq driver name support for accel-config user tool").

Can you confirm?

Quoted 5 lines
Quoted 3 lines

---

Signature · 1 line
David Marchand
#6 lore raw
Quoted 9 lines · David Marchand
Quoted 6 lines · Bruce Richardson
Quoted 4 lines · Wenwu Ma

In ubuntu 24.04, DSA's workqueue has a new driver_name file in sysfs, DPDK needs to write a correct value to this file when configuring a device instance using the dpdk_idxd_cfg.py script, otherwise it will fail to be configured, this patch fixes the issue.

Quoted 6 lines

Pointing at the kernel version would be useful too.
I suppose this change is introduced with 7af1e0aceeb3 ("dmaengine:
idxd: add wq driver name support for accel-config user tool").

Can you confirm?

Looks correct to me, yes. That commit introduces a driver_name node in sysfs.

/Bruce

#7 lore raw
In reply to Bruce Richardson
Quoted 9 lines · Bruce Richardson
Quoted 6 lines · Wenwu Ma

In ubuntu 24.04, DSA's workqueue has a new driver_name file in sysfs, DPDK needs to write a correct value to this file when configuring a device instance using the dpdk_idxd_cfg.py script, otherwise it will fail to be configured, this patch fixes the issue.

Applied, thanks.

Signature · 1 line
David Marchand