From patchwork Fri Sep 11 15:07:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 77428 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 58242A04BB; Fri, 11 Sep 2020 17:08:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2CF081C0D0; Fri, 11 Sep 2020 17:08: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 D6BBB1C0CF for ; Fri, 11 Sep 2020 17:08:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599836896; 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=Zr/gQAs6NpoednH/QVUA0tqjtko6vlzo/k8DIh5GW9Y=; b=HiMLhSmswyxqLXQ2r5fRZQi3rDGEu0xXuKc1vS6O0BhX5fFc+86VlNqdEdgmIdpTTmHMbu 7AbVvVb2VXHiPHHSWBz9wHBUu8D61SzJQcho0Rxl2MoZJLOIu7/2Rg+UQHHhvcoQWEL5TM gcgV++ubXRmk5VpOckuwx95hrpP9iZ0= 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-162-SAqnFS5lNmmLwuAuKwjFQg-1; Fri, 11 Sep 2020 11:08:14 -0400 X-MC-Unique: SAqnFS5lNmmLwuAuKwjFQg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 793BC8030BA; Fri, 11 Sep 2020 15:08:13 +0000 (UTC) Received: from localhost.localdomain (unknown [10.36.110.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id AD7013C89; Fri, 11 Sep 2020 15:08:08 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, patrick.fu@intel.com, amorenoz@redhat.com Cc: Maxime Coquelin Date: Fri, 11 Sep 2020 17:07:58 +0200 Message-Id: <20200911150805.79901-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0.0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH 0/7]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. Next revision will contains some clean-up for the backend type handling. Maxime Coquelin (7): bus/vdev: add DMA mapping ops net/virtio: introduce DMA ops net/virtio: introduce Vhost-vDPA backend type net/virtio: adapt Virtio-user status size net/virtio: check protocol feature in user backend 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 | 310 ++++++++++++++++++ .../net/virtio/virtio_user/virtio_user_dev.c | 163 ++++++--- .../net/virtio/virtio_user/virtio_user_dev.h | 11 +- drivers/net/virtio/virtio_user_ethdev.c | 61 +++- 9 files changed, 599 insertions(+), 56 deletions(-) create mode 100644 drivers/net/virtio/virtio_user/vhost_vdpa.c