When NUMA is not configured, the node id is set to 0.
Signed-off-by: Wenkai Lin linwenkai6@hisilicon.com --- wd.c | 6 ++++++ wd_util.c | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/wd.c b/wd.c index b614ea2..d1fc207 100644 --- a/wd.c +++ b/wd.c @@ -246,6 +246,12 @@ static int get_dev_info(struct uacce_dev *dev) if (ret < 0) return ret;
+ /* Special processing is performed when NUMA is not configured */ + if (dev->numa_id < 0) { + WD_INFO("numa node of the device is not configured, set it to 0!\n"); + dev->numa_id = 0; + } + ret = get_str_attr(dev, "api", dev->api, WD_NAME_SIZE); if (ret < 0) return ret; diff --git a/wd_util.c b/wd_util.c index 67b1afc..330d53a 100644 --- a/wd_util.c +++ b/wd_util.c @@ -550,9 +550,7 @@ static __u16 wd_get_dev_numa(struct uacce_dev_list *head, __u16 numa_num = 0;
while (list) { - if (list->dev->numa_id < 0) { - list->dev->numa_id = 0; - } else if (list->dev->numa_id >= size) { + if (list->dev->numa_id >= size) { WD_ERR("invalid: numa id is %d!\n", list->dev->numa_id); return 0; }