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 4A4ACA00C3; Thu, 14 May 2020 10:04:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D76191D6E7; Thu, 14 May 2020 10:03:13 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 1EA661D6E7 for ; Thu, 14 May 2020 10:03:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589443391; 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=fm8Fi3mUwy4WGydUR/47N3fIo/yZ1B4zqMJN0MUDkgo=; b=aN4CMfxLEGkfbUi0qkrf0UaBGOrhBt+Am/c7sOXvfJgRHQ2TdpREG/j8pHm9JBxGBxsQzx wXpM27y7+J1xWzocdlkd++NFLcuEpnHejas9zkcgedoiCMu15RoCm0bOe4pbQFOi2aCB6j OOIsC+gVC1Cb5FeyRFQ+wXnZE5S6YMI= 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-453-rGmQxCgvM_i-04YDkEx_1w-1; Thu, 14 May 2020 04:03:08 -0400 X-MC-Unique: rGmQxCgvM_i-04YDkEx_1w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D0693835B40; Thu, 14 May 2020 08:03:06 +0000 (UTC) Received: from localhost.localdomain (unknown [10.36.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 17E2B61F50; Thu, 14 May 2020 08:03:02 +0000 (UTC) From: Maxime Coquelin To: xiaolong.ye@intel.com, shahafs@mellanox.com, matan@mellanox.com, amorenoz@redhat.com, xiao.w.wang@intel.com, viacheslavo@mellanox.com, dev@dpdk.org Cc: jasowang@redhat.com, lulu@redhat.com, Maxime Coquelin Date: Thu, 14 May 2020 10:02:18 +0200 Message-Id: <20200514080218.1435344-10-maxime.coquelin@redhat.com> In-Reply-To: <20200514080218.1435344-1-maxime.coquelin@redhat.com> References: <20200514080218.1435344-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 9/9] vhost: only use vDPA config workaround if needed 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" Now that we have Virtio device status support, let's only use the vDPA workaround if it is not supported. This patch also document why Virtio device status protocol feature support is strongly advised. Signed-off-by: Maxime Coquelin --- lib/librte_vhost/vhost_user.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index e5a44be58d..67e96a872a 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -2847,8 +2847,20 @@ vhost_user_msg_handler(int vid, int fd) if (!vdpa_dev) goto out; - if (!(dev->flags & VIRTIO_DEV_VDPA_CONFIGURED) && - request == VHOST_USER_SET_VRING_CALL) { + if (!(dev->flags & VIRTIO_DEV_VDPA_CONFIGURED)) { + /* + * Workaround when Virtio device status protocol + * feature is not supported, wait for SET_VRING_CALL + * request. This is not ideal as some frontends like + * Virtio-user may not send this request, so vDPA device + * may never be configured. Virtio device status support + * on frontend side is strongly advised. + */ + if (!(dev->protocol_features & + (1ULL << VHOST_USER_PROTOCOL_F_STATUS)) && + (request != VHOST_USER_SET_VRING_CALL)) + goto out; + if (vdpa_dev->ops->dev_conf(dev->vid)) VHOST_LOG_CONFIG(ERR, "Failed to configure vDPA device\n"); -- 2.25.4