Soft Patch Panel
 help / color / mirror / Atom feed
From: Itsuro Oda <oda@valinux.co.jp>
To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com
Subject: [spp] [PATCH 01/11] shared: switch to use original vhost PMD again
Date: Thu,  2 Apr 2020 09:06:23 +0900	[thread overview]
Message-ID: <20200402000633.3391-2-oda@valinux.co.jp> (raw)
In-Reply-To: <20200402000633.3391-1-oda@valinux.co.jp>

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 <oda@valinux.co.jp>
---
 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


  reply	other threads:[~2020-04-02  0:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-02  0:06 [spp] [PATCH 00/11] " Itsuro Oda
2020-04-02  0:06 ` Itsuro Oda [this message]
2020-04-02  0:06 ` [spp] [PATCH 02/11] spp_nfv: remove unnecessary code for vhost Itsuro Oda
2020-04-02  0:06 ` [spp] [PATCH 03/11] spp_primary: " Itsuro Oda
2020-04-02  0:06 ` [spp] [PATCH 04/11] spp_primary: remove link to vhost PMD in Makefile Itsuro Oda
2020-04-02  0:06 ` [spp] [PATCH 05/11] spp_nfv: " Itsuro Oda
2020-04-02  0:06 ` [spp] [PATCH 06/11] spp_vf: " Itsuro Oda
2020-04-02  0:06 ` [spp] [PATCH 07/11] spp_mirror: " Itsuro Oda
2020-04-02  0:06 ` [spp] [PATCH 08/11] spp_pcap: " Itsuro Oda
2020-04-02  0:06 ` [spp] [PATCH 09/11] vdev_test: " Itsuro Oda
2020-04-02  0:06 ` [spp] [PATCH 10/11] drivers: remove build task for SPP dedicated vhost PMD Itsuro Oda
2020-04-02  0:06 ` [spp] [PATCH 11/11] drivers/vhost: remove " Itsuro Oda
2020-04-30  2:39 ` [spp] (x-fn-spp-ml 616) [PATCH 00/11] switch to use original vhost PMD again Hideyuki Yamashita
2020-05-25  3:04 ` [spp] " Yasufumi Ogawa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200402000633.3391-2-oda@valinux.co.jp \
    --to=oda@valinux.co.jp \
    --cc=ferruh.yigit@intel.com \
    --cc=spp@dpdk.org \
    --cc=yasufum.o@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).