From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id E861C1B388 for ; Fri, 19 Jan 2018 14:47:50 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4C6882627; Fri, 19 Jan 2018 13:47:50 +0000 (UTC) Received: from localhost (ovpn-116-254.ams2.redhat.com [10.36.116.254]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7095B61982; Fri, 19 Jan 2018 13:47:41 +0000 (UTC) From: Stefan Hajnoczi To: dev@dpdk.org Cc: maxime.coquelin@redhat.com, Yuanhan Liu , wei.w.wang@intel.com, mst@redhat.com, zhiyong.yang@intel.com, jasowang@redhat.com, Stefan Hajnoczi Date: Fri, 19 Jan 2018 13:44:38 +0000 Message-Id: <20180119134444.24927-19-stefanha@redhat.com> In-Reply-To: <20180119134444.24927-1-stefanha@redhat.com> References: <20180119134444.24927-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 19 Jan 2018 13:47:50 +0000 (UTC) Subject: [dpdk-dev] [RFC 18/24] vhost: add RTE_VHOST_USER_VIRTIO_TRANSPORT flag 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: , X-List-Received-Date: Fri, 19 Jan 2018 13:47:51 -0000 Extend the API to support the virtio-vhost-user transport as an alternative to the AF_UNIX transport. The caller provides a PCI DomBDF address: rte_vhost_driver_register("0000:00:04.0", RTE_VHOST_USER_VIRTIO_TRANSPORT); Signed-off-by: Stefan Hajnoczi --- drivers/librte_vhost/rte_vhost.h | 1 + drivers/librte_vhost/socket.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/librte_vhost/rte_vhost.h b/drivers/librte_vhost/rte_vhost.h index d33206997..d91d8d992 100644 --- a/drivers/librte_vhost/rte_vhost.h +++ b/drivers/librte_vhost/rte_vhost.h @@ -28,6 +28,7 @@ extern "C" { #define RTE_VHOST_USER_NO_RECONNECT (1ULL << 1) #define RTE_VHOST_USER_DEQUEUE_ZERO_COPY (1ULL << 2) #define RTE_VHOST_USER_IOMMU_SUPPORT (1ULL << 3) +#define RTE_VHOST_USER_VIRTIO_TRANSPORT (1ULL << 4) /** * Information relating to memory regions including offsets to diff --git a/drivers/librte_vhost/socket.c b/drivers/librte_vhost/socket.c index c46328950..265a014cf 100644 --- a/drivers/librte_vhost/socket.c +++ b/drivers/librte_vhost/socket.c @@ -132,6 +132,9 @@ rte_vhost_driver_register(const char *path, uint64_t flags) struct vhost_user_socket *vsocket; const struct vhost_transport_ops *trans_ops = &af_unix_trans_ops; + if (flags & RTE_VHOST_USER_VIRTIO_TRANSPORT) + trans_ops = &virtio_vhost_user_trans_ops; + if (!path) return -1; -- 2.14.3