[dpdk-dev] [PATCH v2 4/8] vhost: check vDPA configuration succeed

Adrian Moreno amorenoz at redhat.com
Thu Jul 2 10:32:33 CEST 2020


From: Maxime Coquelin <maxime.coquelin at redhat.com>

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 at redhat.com>
Signed-off-by: Adrian Moreno <amorenoz at redhat.com>
---
 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 6be5c771b..bf079c914 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -2849,8 +2849,11 @@ vhost_user_msg_handler(int vid, int fd)
 		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.26.2



More information about the dev mailing list