When the number of queues is used up, wd_find_dev_by_numa returns null. If the number of queues corresponding to the current operation type is 0, uadk is not need to obtain available devices.
Signed-off-by: Wenkai Lin linwenkai6@hisilicon.com --- wd_util.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/wd_util.c b/wd_util.c index b5e3697..db42fa3 100644 --- a/wd_util.c +++ b/wd_util.c @@ -2409,6 +2409,10 @@ static int wd_init_ctx_set(struct wd_init_attrs *attrs, struct uacce_dev_list *l struct uacce_dev *dev; int i;
+ /* If the ctx set number is 0, the initialization is skipped. */ + if (!ctx_set_num) + return 0; + dev = wd_find_dev_by_numa(list, numa_id); if (WD_IS_ERR(dev)) return WD_PTR_ERR(dev);