Soft Patch Panel
 help / color / Atom feed
* [spp] [PATCH] spp_nfv: fix deleting vhost
@ 2019-07-16  7:30 yasufum.o
  0 siblings, 0 replies; only message in thread
From: yasufum.o @ 2019-07-16  7:30 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

From: Yasufumi Ogawa <yasufum.o@gmail.com>

This update is to add dev_detach_by_port_id() for deleting vhost PMD.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/nfv/commands.h | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/nfv/commands.h b/src/nfv/commands.h
index 11e434a..8f19f4e 100644
--- a/src/nfv/commands.h
+++ b/src/nfv/commands.h
@@ -31,13 +31,12 @@ do_del(char *res_uid)
 		port_id = find_port_id(p_id, VHOST);
 		if (port_id == PORT_RESET)
 			return -1;
+		dev_detach_by_port_id(port_id);
 
 	} else if (!strcmp(p_type, "ring")) {
-		RTE_LOG(DEBUG, SPP_NFV, "Del ring id %d\n", p_id);
 		port_id = find_port_id(p_id, RING);
 		if (port_id == PORT_RESET)
 			return -1;
-
 		rte_eth_dev_stop(port_id);
 		rte_eth_dev_close(port_id);
 
@@ -45,14 +44,12 @@ do_del(char *res_uid)
 		port_id = find_port_id(p_id, PCAP);
 		if (port_id == PORT_RESET)
 			return -1;
-
 		dev_detach_by_port_id(port_id);
 
 	} else if (!strcmp(p_type, "nullpmd")) {
 		port_id = find_port_id(p_id, NULLPMD);
 		if (port_id == PORT_RESET)
 			return -1;
-
 		dev_detach_by_port_id(port_id);
 
 	}
@@ -153,6 +150,9 @@ do_connection(int *connected, int *sock)
 static int
 parse_command(char *str)
 {
+	uint16_t dev_id;
+	char dev_name[RTE_DEV_NAME_MAX_LEN];
+
 	char *token_list[MAX_PARAMETER] = {NULL};
 	int cli_id;
 	int max_token = 0;
@@ -185,6 +185,13 @@ parse_command(char *str)
 					lcore_id_used,
 					ports_fwd_array, port_map);
 
+		RTE_ETH_FOREACH_DEV(dev_id) {
+			rte_eth_dev_get_name_by_port(dev_id, dev_name);
+			if (strlen(dev_name) > 0)
+				RTE_LOG(DEBUG, SPP_NFV, "Eth devs: %d\t%s\n",
+						dev_id, dev_name);
+		}
+
 	} else if (!strcmp(token_list[0], "_get_client_id")) {
 		memset(str, '\0', MSG_SIZE);
 		sprintf(str, "{%s:%s,%s:%d,%s:%s}",
-- 
2.17.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-16  7:30 [spp] [PATCH] spp_nfv: fix deleting vhost yasufum.o

Soft Patch Panel

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/spp/0 spp/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 spp spp/ http://inbox.dpdk.org/spp \
		spp@dpdk.org
	public-inbox-index spp


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.spp


AGPL code for this site: git clone https://public-inbox.org/ public-inbox