dma/idxd: fix failure to configure a device instance for DSA
Subsystems (2)
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
@@ -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
Quoted 7 lines · Wenwu Ma
In ubuntu 24.04, DSA's workqueue has a new
driver_namefile in sysfs, DPDK needs to write a correct value to this file when configuring a device instance using thedpdk_idxd_cfg.pyscript, otherwise it will fail to be configured, this patch fixes the issue.Signed-off-by Wenwu Ma <[email protected]>---
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
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 queuesSignature · 1 line
2.25.1
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 DSAQuoted 7 lines · Wenwu Ma
In ubuntu 24.04, DSA's workqueue has a new
driver_namefile in sysfs, DPDK needs to write a correct value to this file when configuring a device instance using thedpdk_idxd_cfg.pyscript, otherwise it will fail to be configured, this patch fixes the issue.Signed-off-by Wenwu Ma <[email protected]>---
One comment inline below. With that addressed:
Acked-by Bruce Richardson <[email protected]>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
-0drivers/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
PATCH v2 1/1 dma/idxd: fix failure to configure a device instance for DSA
In reply to Wenwu MaIn 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
@@ -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
Quoted 7 lines · Wenwu Ma
In ubuntu 24.04, DSA's workqueue has a new
driver_namefile in sysfs, DPDK needs to write a correct value to this file when configuring a device instance using thedpdk_idxd_cfg.pyscript, otherwise it will fail to be configured, this patch fixes the issue.Signed-off-by Wenwu Ma <[email protected]>---
Quoted 6 lines · Bruce Richardson
Quoted 4 lines · Wenwu Ma
In ubuntu 24.04, DSA's workqueue has a new
driver_namefile in sysfs, DPDK needs to write a correct value to this file when configuring a device instance using thedpdk_idxd_cfg.pyscript, 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
Signed-off-by Wenwu Ma <[email protected]>---
Acked-by Bruce Richardson <[email protected]>
Signature · 1 line
David Marchand
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_namefile in sysfs, DPDK needs to write a correct value to this file when configuring a device instance using thedpdk_idxd_cfg.pyscript, 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 with7af1e0aceeb3("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
David Marchand
AppliedQuoted 9 lines · Bruce Richardson
Quoted 6 lines · Wenwu Ma
In ubuntu 24.04, DSA's workqueue has a new
driver_namefile in sysfs, DPDK needs to write a correct value to this file when configuring a device instance using thedpdk_idxd_cfg.pyscript, otherwise it will fail to be configured, this patch fixes the issue.Signed-off-by Wenwu Ma <[email protected]>Acked-by Bruce Richardson <[email protected]>
Applied, thanks.
Signature · 1 line
David Marchand