Soft Patch Panel
 help / color / mirror / Atom feed
From: yasufum.o@gmail.com
To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com
Subject: [spp] [PATCH] spp_nfv: fix deleting vhost
Date: Tue, 16 Jul 2019 16:30:28 +0900	[thread overview]
Message-ID: <20190716073028.18709-1-yasufum.o@gmail.com> (raw)

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


                 reply	other threads:[~2019-07-16  7:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20190716073028.18709-1-yasufum.o@gmail.com \
    --to=yasufum.o@gmail.com \
    --cc=ferruh.yigit@intel.com \
    --cc=spp@dpdk.org \
    /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).