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.coque...@redhat.com> --- lib/librte_vhost/vhost_user.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 7a43c2fae7..4a847f368c 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -2809,9 +2809,11 @@ vhost_user_msg_handler(int vid, int fd) if (!(dev->flags & VIRTIO_DEV_VDPA_CONFIGURED) && request == VHOST_USER_SET_VRING_CALL) { - 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.25.4