Skip to contentSkip to conversation

dma/idxd: fix missing default for workqueue options

PATCH Applied Bruce Richardson 4 participants 4 messages Jun 17, 2022 – Jun 21, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dma/idxd: fix missing default for workqueue options

When no --wq-option flag is passed to dpdk_idxd_cfg.py script, the default value used by argparse is None. This leads to later errors which are expecting an array value:

TypeError: 'NoneType' object is not iterable

This is fixed by specifying that the empty array should be the default if no flags are passed.

Fixes 94b0f04dc0e3 ("dma/idxd: add generic option for queue config")
---
 drivers/dma/idxd/dpdk_idxd_cfg.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/idxd/dpdk_idxd_cfg.py +1 -1
index 77c473b240..41b4d13b9c 100755
@@ -122,7 +122,7 @@ def main(args):
     arg_p.add_argument('--name-prefix', metavar='prefix', dest='prefix',
                        default="dpdk",
                        help="Prefix for workqueue name to mark for DPDK use [default: 'dpdk']")
-    arg_p.add_argument('--wq-option', action='append',
+    arg_p.add_argument('--wq-option', action='append', default=[],
                        help="Provide additional config option for queues (format 'x=y')")
     arg_p.add_argument('--reset', action='store_true',
                        help="Reset DSA device and its queues")
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw
Quoted 13 lines

From: Richardson, Bruce <[email protected]>
Sent: Friday, June 17, 2022 4:48 PM
To: [email protected]
Cc: Laatz, Kevin <[email protected]>; Pai G, Sunil <[email protected]>; Richardson, Bruce <[email protected]>
Subject: [PATCH] dma/idxd: fix missing default for workqueue options

When no --wq-option flag is passed to dpdk_idxd_cfg.py script, the default value used by argparse is None. This leads to later errors which are expecting an array value:

TypeError: 'NoneType' object is not iterable

Quoted 7 lines

This is fixed by specifying that the empty array should be the default if no flags are passed.

Fixes 94b0f04dc0e3 ("dma/idxd: add generic option for queue config")

---

LGTM

#2 lore raw

20/06/2022 06:09, Pai G, Sunil:

Quoted 16 lines
Quoted 16 lines

From: Richardson, Bruce <[email protected]>
Sent: Friday, June 17, 2022 4:48 PM
To: [email protected]
Cc: Laatz, Kevin <[email protected]>; Pai G, Sunil <[email protected]>; Richardson, Bruce <[email protected]>
Subject: [PATCH] dma/idxd: fix missing default for workqueue options

When no --wq-option flag is passed to dpdk_idxd_cfg.py script, the default value used by argparse is None. This leads to later errors which are expecting an array value:

TypeError: 'NoneType' object is not iterable

This is fixed by specifying that the empty array should be the default if no flags are passed.

Quoted 7 lines
Quoted 4 lines
Fixes 94b0f04dc0e3 ("dma/idxd: add generic option for queue config")

---

LGTM

Applied, thanks.

Acked-by on v1 1/1
#3 lore raw
In reply to Bruce Richardson
Quoted 6 lines

When no --wq-option flag is passed to dpdk_idxd_cfg.py script, the default value used by argparse is None. This leads to later errors which are expecting an array value:

TypeError: 'NoneType' object is not iterable

Quoted 7 lines

This is fixed by specifying that the empty array should be the default if no flags are passed.

Fixes 94b0f04dc0e3 ("dma/idxd: add generic option for queue config")

---