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 0DF97A00C3; Thu, 14 May 2020 10:02:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 943C01D6B2; Thu, 14 May 2020 10:02:48 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id A0F0E1D674 for ; Thu, 14 May 2020 10:02:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589443366; 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; bh=O8jJOQUj6yVRuP/QL+vDdlSM1vsO2orBdMim2EeOz60=; b=Z/RsV+M/XWzUe97lnMqBVcAX/RnohMyoG3tbknSkcEoAtTEM1LaNrvOvzJgvEB0OVLAEjd 4oN64qhN79ZyYAHBpDxbBO9dIU2S/UY9I8WHyxo9Qp57jD2Qi0WnhPj+bm9ZTTxI4YGnpP EhjB3tlol0WTiqRtxvnmCKzZma/nC8Q= 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-443-mxIlLS4ING2o9lRG7osb9w-1; Thu, 14 May 2020 04:02:37 -0400 X-MC-Unique: mxIlLS4ING2o9lRG7osb9w-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 218E3EC1B5; Thu, 14 May 2020 08:02:36 +0000 (UTC) Received: from localhost.localdomain (unknown [10.36.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id C35D261F50; Thu, 14 May 2020 08:02:30 +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:09 +0200 Message-Id: <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 (v20.08) 0/9] vhost: improve Vhost/vDPA device init 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" The goal of this series is to make the Vhost/vDPA device init more robust by adding support to a new protocol feature. VHOST_USER_SET_STATUS is received by the backend when the driver updates the Virtio device status register. For now this series only deal with the DRIVER_OK bit, which indicates that the driver is done with the device initialization. For example, such information helps the Vhost backend to know when it can call de dev_conf vDPA callback. It avoids doing an hazardous workaround which only work with Qemu and not Virtio-user PMD. Before adding support for this new request, some clean-ups and refactoring are done as preliminary steps to make the code more easily readable. Some vDPA APIs are also made mandatory, and the IFC driver modified to add support for the .set_vring_state() callback. I think this one should be mandatory as if the frontent requests for one queue to be disabled, I think the vDPA device should no more be processing it. Note that the VHOST_USER_PROTOCOL_F_STATUS protocol feature requires frontend support. For Qemu, it has been posted for reviews and can be found here: https://patchwork.ozlabs.org/project/qemu-devel/patch/20200514073332.1434576-1-maxime.coquelin@redhat.com/ For Virtio-user PMD, it is being developped and will be posted soon. Maxime Coquelin (9): vhost: fix virtio ready flag check vhost: refactor Virtio ready check vdpa/ifc: add support to vDPA queue enable vhost: make some vDPA callbacks mandatory vhost: check vDPA configuration succeed vhost: add support for virtio status vdpa/ifc: enable status protocol feature vdpa/mlx5: enable status protocol feature vhost: only use vDPA config workaround if needed drivers/vdpa/ifc/base/ifcvf.c | 9 +++ drivers/vdpa/ifc/base/ifcvf.h | 4 ++ drivers/vdpa/ifc/ifcvf_vdpa.c | 26 ++++++++- drivers/vdpa/mlx5/mlx5_vdpa.c | 4 +- lib/librte_vhost/rte_vdpa.h | 14 +++-- lib/librte_vhost/rte_vhost.h | 4 ++ lib/librte_vhost/socket.c | 6 +- lib/librte_vhost/vdpa.c | 10 ++++ lib/librte_vhost/vhost.c | 3 +- lib/librte_vhost/vhost.h | 9 +++ lib/librte_vhost/vhost_user.c | 103 +++++++++++++++++++++++++++------- lib/librte_vhost/vhost_user.h | 6 +- 12 files changed, 162 insertions(+), 36 deletions(-) -- 2.25.4