[spp] [PATCH v3 12/12] spp_vf, spp_mirror: exclude vhosts at process initialization

Itsuro Oda oda at valinux.co.jp
Fri Jan 10 00:10:26 CET 2020


A vhost device is shared among the primary process and secondary
processes. When a secodary process starts it recognizes vhost
devices if they are used by processes already started. It is not
appropriate to include to port information as PHY devices.

Signed-off-by: Itsuro Oda <oda at valinux.co.jp>
---
 src/shared/secondary/spp_worker_th/cmd_utils.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/shared/secondary/spp_worker_th/cmd_utils.c b/src/shared/secondary/spp_worker_th/cmd_utils.c
index 010a4b6..69d7222 100644
--- a/src/shared/secondary/spp_worker_th/cmd_utils.c
+++ b/src/shared/secondary/spp_worker_th/cmd_utils.c
@@ -437,8 +437,12 @@ init_host_port_info(void)
 			p_iface_info->phy[port_id].ethdev_port_id = port_id;
 			break;
 		case VHOST:
-			p_iface_info->vhost[port_id].iface_type = port_type;
-			p_iface_info->vhost[port_id].ethdev_port_id = port_id;
+			/* NOTE: a vhost can be used by one process.
+			 * even if it exists, it is necessary to do
+			 * add_vhost_pmd to setup the device.
+			 * note that it is user responsibility to prevent
+			 * multipul processes use a vhost at the same time.
+			 */
 			break;
 		case RING:
 			p_iface_info->ring[port_id].iface_type = port_type;
-- 
2.17.1



More information about the spp mailing list