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

Message ID 20240628095400.126083-1-wenwux.ma@intel.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series [v2] dma/idxd: fix failure to configure a device instance for DSA |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Wenwu Ma June 28, 2024, 9:54 a.m. UTC
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.

Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
---
v2:
 - refine the code

---
 drivers/dma/idxd/dpdk_idxd_cfg.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Bruce Richardson June 28, 2024, 10:25 a.m. UTC | #1
On Fri, Jun 28, 2024 at 05:54:00PM +0800, Wenwu Ma wrote:
> 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.
> 
> Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
David Marchand July 9, 2024, 10:18 a.m. UTC | #2
On Fri, Jun 28, 2024 at 12:26 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Fri, Jun 28, 2024 at 05:54:00PM +0800, Wenwu Ma wrote:
> > 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?

> >
> > Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
> > ---
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
>
  
Bruce Richardson July 9, 2024, 10:22 a.m. UTC | #3
On Tue, Jul 09, 2024 at 12:18:29PM +0200, David Marchand wrote:
> On Fri, Jun 28, 2024 at 12:26 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > On Fri, Jun 28, 2024 at 05:54:00PM +0800, Wenwu Ma wrote:
> > > 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?
> 
Looks correct to me, yes. That commit introduces a driver_name node in
sysfs.

/Bruce
  
David Marchand July 9, 2024, 11:14 a.m. UTC | #4
On Fri, Jun 28, 2024 at 12:26 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Fri, Jun 28, 2024 at 05:54:00PM +0800, Wenwu Ma wrote:
> > 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.
> >
> > Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks.
  

Patch

diff --git a/drivers/dma/idxd/dpdk_idxd_cfg.py b/drivers/dma/idxd/dpdk_idxd_cfg.py
index c0c833ade9..5c9572b49d 100755
--- a/drivers/dma/idxd/dpdk_idxd_cfg.py
+++ b/drivers/dma/idxd/dpdk_idxd_cfg.py
@@ -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