From a15f9dbba057caf9dfd84ad4528ce2ce722aa24d Mon Sep 17 00:00:00 2001 From: Maxime Coquelin Date: Mon, 6 Jul 2020 13:24:48 +0200 Subject: [PATCH] vhost: check vDPA configuration succeed This patch checks whether vDPA device configuration succeed and does not set the CONFIGURED flag if it didn't. Signed-off-by: Maxime Coquelin Reviewed-by: Chenbo Xia --- lib/librte_vhost/vhost_user.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 1d9e1127b8..a96bc5c16b 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -2866,8 +2866,11 @@ skip_to_post_handle: goto out; if (!(dev->flags & VIRTIO_DEV_VDPA_CONFIGURED)) { - vdpa_dev->ops->dev_conf(dev->vid); - dev->flags |= VIRTIO_DEV_VDPA_CONFIGURED; + if (vdpa_dev->ops->dev_conf(dev->vid)) + VHOST_LOG_CONFIG(ERR, + "Failed to configure vDPA device\n"); + else + dev->flags |= VIRTIO_DEV_VDPA_CONFIGURED; } out: -- 2.20.1