From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0328DA0524; Thu, 2 Jul 2020 10:33:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 64CB51D70F; Thu, 2 Jul 2020 10:33:09 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 3A36C1D691 for ; Thu, 2 Jul 2020 10:33:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593678786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7cMAZjucjqcVUPQPW7sJ6JBEZWdX/z0DHws8TCX5wZw=; b=SjawmKr4og0HVtLqDduoSTSrUMIAqsPO973CxJ23jtBifxnmA9c4vxvyz9M/o6tJDk+pNc Vkkvs3W+PwrB+7dUpPVjyOmj6s7grVTWuL0JLsHIQfxWdWqIXV1ZFZdbGWcjhmLvU/YYyx BUkjyE7vjOQqQ8kEjFQJLyqLhh3EhY0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-378-mFBI1arfN6WPHe6rSeSBVw-1; Thu, 02 Jul 2020 04:33:04 -0400 X-MC-Unique: mFBI1arfN6WPHe6rSeSBVw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4EAF8800597; Thu, 2 Jul 2020 08:33:03 +0000 (UTC) Received: from amorenoz.users.ipa.redhat.com (ovpn-112-91.ams2.redhat.com [10.36.112.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id 468791002397; Thu, 2 Jul 2020 08:33:01 +0000 (UTC) From: Adrian Moreno To: dev@dpdk.org, xiaolong.ye@intel.com, shahafs@mellanox.com, matan@mellanox.com, maxime.coquelin@redhat.com, xiao.w.wang@intel.com, viacheslavo@mellanox.com Cc: jasowang@redhat.com, lulu@redhat.com, Adrian Moreno Date: Thu, 2 Jul 2020 10:32:33 +0200 Message-Id: <20200702083237.1215652-5-amorenoz@redhat.com> In-Reply-To: <20200702083237.1215652-1-amorenoz@redhat.com> References: <20200702083237.1215652-1-amorenoz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=amorenoz@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 4/8] vhost: check vDPA configuration succeed X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Maxime Coquelin This patch checks whether vDPA device configuration succeed and does not set the CONFIGURED flag if it didn't. Signed-off-by: Maxime Coquelin Signed-off-by: Adrian Moreno --- 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