From patchwork Tue Sep 29 16:13:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 79211 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5B8CFA04BC; Tue, 29 Sep 2020 18:14:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9D9F51D543; Tue, 29 Sep 2020 18:14:19 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id 50DEB1D50E for ; Tue, 29 Sep 2020 18:14:17 +0200 (CEST) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601396055; 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=V23LknMv8S3Gn222TxMy++R3FYWRSa7zriGYB6TNIdg=; b=i5W4GcuN4nvd/WjxVFXTNAUERLVdE1gocdOr6aG5JK8iTCU0Ym6K3jHTdMPVfdAny2BViU 9+SSkjWDX8AHurE87TzzbfcCZE66/2O8TA+vlXdLOVz5yzxVR93Ff/Xwb+eg+rQcbMbjO7 mRKbuvkeZEyL+4CQGp7xbUkEeQvJNwo= 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-580-TimKkSA1NNqvA3XyRLc17w-1; Tue, 29 Sep 2020 12:14:13 -0400 X-MC-Unique: TimKkSA1NNqvA3XyRLc17w-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8E91F186DD53; Tue, 29 Sep 2020 16:14:12 +0000 (UTC) Received: from localhost.localdomain (unknown [10.36.110.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB79F5C1DA; Tue, 29 Sep 2020 16:14:06 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, chenbo.xia@intel.com, patrick.fu@intel.com, amorenoz@redhat.com Cc: Maxime Coquelin Date: Tue, 29 Sep 2020 18:13:56 +0200 Message-Id: <20200929161404.124580-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH v3 0/8] virtio-user: introduce vhost-vdpa backend 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" vhost-vDPA is a new vhost backend type introduced by vDPA kernel framework, which provides abstruction to the vDPA devices and exposes to userspace a unified control interface through char devs. This patch set adds vhost-vdpa backend type to the virtio_user. A set of vhost-vdpa specific ops callbacks are attached to the virtio_user according to the runtime dynamic check result of the backend type. DMA memory map/unmap callbacks are added to both vdev bus driver and virtio_user pmd to support address mapping. In addition, minor fixes to existing virtio control path are also implemented to make the new backend work. This is a collaborative work done with Patrick Fu from Intel and Adrian Moreno from Red Hat. Thanks to them for their contributions. The series has been tested with vdpasim and Intel IFC Kernel vDPA drivers, and more lightly with Mellanox mlx5_vdpa on ConnectX-6 Dx. Changes in v3: -------------- * Fix 32bit builds (CI & Chenbo) * Fix checkpatch Changes in v2: -------------- * Split backend-type patch (Adrian) * Fix get_status size (Chenbo) * Various minro fixes (Chenbo) Adrian Moreno (1): net/virtio: move backend type selection to ethdev Maxime Coquelin (7): bus/vdev: add DMA mapping ops net/virtio: introduce DMA ops net/virtio: introduce Vhost-vDPA backend type net/virtio: check protocol feature in user backend net/virtio: adapt Virtio-user status size net/virtio: split virtio-user start net/virtio: introduce Vhost-vDPA backend drivers/bus/vdev/rte_bus_vdev.h | 46 ++- drivers/bus/vdev/vdev.c | 52 +++ drivers/net/virtio/meson.build | 1 + drivers/net/virtio/virtio_user/vhost.h | 5 + drivers/net/virtio/virtio_user/vhost_user.c | 6 +- drivers/net/virtio/virtio_user/vhost_vdpa.c | 298 ++++++++++++++++++ .../net/virtio/virtio_user/virtio_user_dev.c | 117 ++++--- .../net/virtio/virtio_user/virtio_user_dev.h | 13 +- drivers/net/virtio/virtio_user_ethdev.c | 126 +++++++- 9 files changed, 607 insertions(+), 57 deletions(-) create mode 100644 drivers/net/virtio/virtio_user/vhost_vdpa.c