[spp] [PATCH 2/4] spp_primary: enable to add and del memif

Yasufumi Ogawa yasufum.o at gmail.com
Sun Jan 26 19:45:31 CET 2020


This update is to enable spp_primary to add and del while running.

Signed-off-by: Yasufumi Ogawa <yasufum.o at gmail.com>
---
 src/primary/main.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/primary/main.c b/src/primary/main.c
index 15152a0..d3828e8 100644
--- a/src/primary/main.c
+++ b/src/primary/main.c
@@ -831,6 +831,11 @@ add_port(char *p_type, int p_id)
 		port_id_list[cnt].port_id = p_id;
 		port_id_list[cnt].type = PCAP;
 
+	} else if (!strcmp(p_type, "memif")) {
+		res = add_memif_pmd(p_id);
+		port_id_list[cnt].port_id = p_id;
+		port_id_list[cnt].type = MEMIF;
+
 	} else if (!strcmp(p_type, "nullpmd")) {
 		res = add_null_pmd(p_id);
 		port_id_list[cnt].port_id = p_id;
@@ -906,6 +911,12 @@ del_port(char *p_type, int p_id)
 			return -1;
 		dev_detach_by_port_id(dev_id);
 
+	} else if (!strcmp(p_type, "memif")) {
+		dev_id = find_ethdev_id(p_id, MEMIF);
+		if (dev_id == PORT_RESET)
+			return -1;
+		dev_detach_by_port_id(dev_id);
+
 	} else if (!strcmp(p_type, "nullpmd")) {
 		dev_id = find_ethdev_id(p_id, NULLPMD);
 		if (dev_id == PORT_RESET)
-- 
2.17.1



More information about the spp mailing list