From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id AB999A0471 for ; Wed, 19 Jun 2019 17:25:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5F7AB1C438; Wed, 19 Jun 2019 17:16:43 +0200 (CEST) Received: from mx0.arrikto.com (mx0.arrikto.com [212.71.252.59]) by dpdk.org (Postfix) with ESMTP id 180A61C392 for ; Wed, 19 Jun 2019 17:15:47 +0200 (CEST) Received: from troi.prod.arr (mail.arr [10.99.0.5]) by mx0.arrikto.com (Postfix) with ESMTP id E9EE018201B; Wed, 19 Jun 2019 18:15:46 +0300 (EEST) Received: from localhost.localdomain (unknown [10.89.50.133]) by troi.prod.arr (Postfix) with ESMTPSA id 8410532C; Wed, 19 Jun 2019 18:15:46 +0300 (EEST) From: Nikos Dragazis To: dev@dpdk.org Cc: Maxime Coquelin , Tiwei Bie , Zhihong Wang , Stefan Hajnoczi , Wei Wang , Stojaczyk Dariusz , Vangelis Koukis Date: Wed, 19 Jun 2019 18:14:48 +0300 Message-Id: <1560957293-17294-24-git-send-email-ndragazis@arrikto.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1560957293-17294-1-git-send-email-ndragazis@arrikto.com> References: <1560957293-17294-1-git-send-email-ndragazis@arrikto.com> Subject: [dpdk-dev] [PATCH 23/28] net/vhost: add virtio-vhost-user support 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 new virtio-transport=0|1 argument enables virtio-vhost-user support: testpmd ... --pci-whitelist 0000:00:04.0 \ --vdev vhost,iface=0000:00:04.0,virtio-transport=1 Signed-off-by: Nikos Dragazis Signed-off-by: Stefan Hajnoczi --- drivers/net/vhost/rte_eth_vhost.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index 0b61e37..c0d087f 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -31,6 +31,7 @@ enum {VIRTIO_RXQ, VIRTIO_TXQ, VIRTIO_QNUM}; #define ETH_VHOST_DEQUEUE_ZERO_COPY "dequeue-zero-copy" #define ETH_VHOST_IOMMU_SUPPORT "iommu-support" #define ETH_VHOST_POSTCOPY_SUPPORT "postcopy-support" +#define ETH_VHOST_VIRTIO_TRANSPORT "virtio-transport" #define VHOST_MAX_PKT_BURST 32 static const char *valid_arguments[] = { @@ -40,6 +41,7 @@ static const char *valid_arguments[] = { ETH_VHOST_DEQUEUE_ZERO_COPY, ETH_VHOST_IOMMU_SUPPORT, ETH_VHOST_POSTCOPY_SUPPORT, + ETH_VHOST_VIRTIO_TRANSPORT, NULL }; @@ -1341,6 +1343,7 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev) int dequeue_zero_copy = 0; int iommu_support = 0; int postcopy_support = 0; + uint16_t virtio_transport = 0; struct rte_eth_dev *eth_dev; const char *name = rte_vdev_device_name(dev); @@ -1422,6 +1425,16 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev) flags |= RTE_VHOST_USER_POSTCOPY_SUPPORT; } + if (rte_kvargs_count(kvlist, ETH_VHOST_VIRTIO_TRANSPORT) == 1) { + ret = rte_kvargs_process(kvlist, ETH_VHOST_VIRTIO_TRANSPORT, + &open_int, &virtio_transport); + if (ret < 0) + goto out_free; + + if (virtio_transport) + flags |= RTE_VHOST_USER_VIRTIO_TRANSPORT; + } + if (dev->device.numa_node == SOCKET_ID_ANY) dev->device.numa_node = rte_socket_id(); -- 2.7.4