From: Xiao Wang Date: Thu, 17 May 2018 07:35:25 +0000 (+0800) Subject: net/virtio-user: fix device init in legacy-mem mode X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=88e5469ff800fed3462721769894cc13b248d417;p=dpdk.git net/virtio-user: fix device init in legacy-mem mode In legacy-mem mode, memory event callback registering is not supported, we should not return error in dev_init on this case. Fixes: 12ecb2f63b12 ("net/virtio-user: support memory hotplug") Suggested-by: Tiwei Bie Signed-off-by: Xiao Wang Reviewed-by: Maxime Coquelin --- diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c index aff01f5870..4322527f20 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c @@ -447,8 +447,11 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, if (rte_mem_event_callback_register(VIRTIO_USER_MEM_EVENT_CLB_NAME, virtio_user_mem_event_cb, dev)) { - PMD_INIT_LOG(ERR, "Failed to register mem event callback\n"); - return -1; + if (rte_errno != ENOTSUP) { + PMD_INIT_LOG(ERR, "Failed to register mem event" + " callback\n"); + return -1; + } } return 0;