vhost: check vDPA configuration succeed
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Mon, 6 Jul 2020 11:24:48 +0000 (13:24 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Sat, 11 Jul 2020 04:18:52 +0000 (06:18 +0200)
This patch checks whether vDPA device configuration
succeed and does not set the CONFIGURED flag if it
didn't.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
lib/librte_vhost/vhost_user.c

index 1d9e112..a96bc5c 100644 (file)
@@ -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: