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 15C36A057B for ; Thu, 2 Apr 2020 02:06:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F241E1C0BD; Thu, 2 Apr 2020 02:06:37 +0200 (CEST) Received: from mail.valinux.co.jp (mail.valinux.co.jp [210.128.90.3]) by dpdk.org (Postfix) with ESMTP id 7183A1C0B5 for ; Thu, 2 Apr 2020 02:06:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.valinux.co.jp (Postfix) with ESMTP id EF755B6381; Thu, 2 Apr 2020 09:06:33 +0900 (JST) X-Virus-Scanned: Debian amavisd-new at valinux.co.jp Received: from mail.valinux.co.jp ([127.0.0.1]) by localhost (mail.valinux.co.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pnQ5ECg_s9tW; Thu, 2 Apr 2020 09:06:33 +0900 (JST) Received: from valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by mail.valinux.co.jp (Postfix) with ESMTP id CB416B630A; Thu, 2 Apr 2020 09:06:33 +0900 (JST) From: Itsuro Oda To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com Date: Thu, 2 Apr 2020 09:06:23 +0900 Message-Id: <20200402000633.3391-2-oda@valinux.co.jp> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200402000633.3391-1-oda@valinux.co.jp> References: <20200402000633.3391-1-oda@valinux.co.jp> Subject: [spp] [PATCH 01/11] shared: switch to use original vhost PMD again X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spp-bounces@dpdk.org Sender: "spp" Original vhost PMD was fixed to be used by a secondary process in DPDK v20.02. This patch switches to use original vhost PMD instead of SPP dedicated vhost PMD. This patch also modifies comment about vhost in detail more. Signed-off-by: Itsuro Oda --- src/shared/common.c | 4 +--- src/shared/common.h | 1 - src/shared/secondary/add_port.c | 15 ++++++++++----- src/shared/secondary/add_port.h | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/shared/common.c b/src/shared/common.c index d1c3e36..61db6ba 100644 --- a/src/shared/common.c +++ b/src/shared/common.c @@ -91,9 +91,7 @@ int parse_dev_name(char *dev_name, int *port_type, int *port_id) } else if (strncmp(dev_name, VDEV_ETH_VHOST, strlen(VDEV_ETH_VHOST)) == 0 || strncmp(dev_name, VDEV_NET_VHOST, - strlen(VDEV_NET_VHOST)) == 0 || - strncmp(dev_name, VDEV_SPP_VHOST, - strlen(VDEV_SPP_VHOST)) == 0) { + strlen(VDEV_NET_VHOST)) == 0) { dev_str_len = strlen(VDEV_NET_VHOST); pid_len = dev_name_len - dev_str_len; strncpy(pid_str, dev_name + strlen(VDEV_NET_VHOST), diff --git a/src/shared/common.h b/src/shared/common.h index fd3102c..f2909c2 100644 --- a/src/shared/common.h +++ b/src/shared/common.h @@ -52,7 +52,6 @@ #define VDEV_NET_RING "net_ring" #define VDEV_ETH_VHOST "eth_vhost" #define VDEV_NET_VHOST "net_vhost" -#define VDEV_SPP_VHOST "spp_vhost" #define VDEV_NET_PCAP "net_pcap" #define VDEV_ETH_TAP "eth_tap" #define VDEV_NET_TAP "net_tap" diff --git a/src/shared/secondary/add_port.c b/src/shared/secondary/add_port.c index a7b7261..bca18b1 100644 --- a/src/shared/secondary/add_port.c +++ b/src/shared/secondary/add_port.c @@ -186,11 +186,16 @@ add_vhost_pmd(int index) return ret; } - /* NOTE: make sure the eth_dev is stopped. - * it is for the case a secondary process which used the vhost - * was down without stopping the device. - * note that it is still user responsibility to prevent multipul - * processes use a vhost at the same time. + /* NOTE: + * A vhost PMD is shared among multi processes, but it + * can be used by only one process. It is user responsibility + * to prevent multipul processes use a vhost at the same time. + * The same vhost interface can be used after the vhost is + * deleted (and created again) or the process which used the + * vhost is down. + * dev_attach_by_devargs will succeed even if the device exists. + * rte_eth_dev_stop is necessary to configure the device again. + * It is no-op if the device is stopped. */ rte_eth_dev_stop(vhost_port_id); diff --git a/src/shared/secondary/add_port.h b/src/shared/secondary/add_port.h index 39feb50..d41969b 100644 --- a/src/shared/secondary/add_port.h +++ b/src/shared/secondary/add_port.h @@ -10,7 +10,7 @@ #define NR_DESCS 128 #define VHOST_IFACE_NAME "/tmp/sock%u" -#define VHOST_BACKEND_NAME "spp_vhost%u" +#define VHOST_BACKEND_NAME "eth_vhost%u" #define PCAP_PMD_DEV_NAME "eth_pcap%u" #define MEMIF_PMD_DEV_NAME "net_memif%u" -- 2.17.0