Soft Patch Panel
 help / color / mirror / Atom feed
From: Yasufumi Ogawa <yasufum.o@gmail.com>
To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com
Subject: [spp] [PATCH 3/4] shared: add memif in status message
Date: Tue, 21 Jan 2020 13:52:52 +0900	[thread overview]
Message-ID: <20200121045253.1071-4-yasufum.o@gmail.com> (raw)
In-Reply-To: <20200121045253.1071-1-yasufum.o@gmail.com>

Add memif PMD in the result of status command and its log message.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/shared/common.c       | 9 +++++++++
 src/shared/common.h       | 2 ++
 src/shared/port_manager.c | 1 +
 3 files changed, 12 insertions(+)

diff --git a/src/shared/common.c b/src/shared/common.c
index 85e2f06..5fdb29f 100644
--- a/src/shared/common.c
+++ b/src/shared/common.c
@@ -119,6 +119,15 @@ int parse_dev_name(char *dev_name, int *port_type, int *port_id)
 		*port_id = (int)strtol(pid_str, NULL, 10);
 		*port_type = TAP;
 
+	} else if (strncmp(dev_name, VDEV_NET_MEMIF,
+			strlen(VDEV_NET_MEMIF)) == 0) {
+		dev_str_len = strlen(VDEV_NET_MEMIF);
+		pid_len = dev_name_len - dev_str_len;
+		strncpy(pid_str, dev_name + strlen(VDEV_NET_MEMIF),
+				pid_len);
+		*port_id = (int)strtol(pid_str, NULL, 10);
+		*port_type = MEMIF;
+
 	} else if (strncmp(dev_name, VDEV_ETH_NULL,
 			strlen(VDEV_ETH_NULL)) == 0) {
 		dev_str_len = strlen(VDEV_ETH_NULL);
diff --git a/src/shared/common.h b/src/shared/common.h
index ef8372a..adabb79 100644
--- a/src/shared/common.h
+++ b/src/shared/common.h
@@ -39,6 +39,7 @@
 #define VDEV_NET_PCAP "net_pcap"
 #define VDEV_ETH_TAP "eth_tap"
 #define VDEV_NET_TAP "net_tap"
+#define VDEV_NET_MEMIF "net_memif"
 #define VDEV_ETH_NULL "eth_null"
 
 
@@ -82,6 +83,7 @@ enum port_type {
 	PCAP,
 	NULLPMD,
 	TAP,
+	MEMIF,
 	UNDEF,
 };
 
diff --git a/src/shared/port_manager.c b/src/shared/port_manager.c
index 98d89c2..534af99 100644
--- a/src/shared/port_manager.c
+++ b/src/shared/port_manager.c
@@ -11,6 +11,7 @@ struct porttype_map portmap[] = {
 	{ .port_name = "pcap", .port_type = PCAP, },
 	{ .port_name = "nullpmd", .port_type = NULLPMD, },
 	{ .port_name = "tap", .port_type = TAP, },
+	{ .port_name = "memif", .port_type = MEMIF, },
 	{ .port_name = NULL,    .port_type = UNDEF, },
 };
 
-- 
2.17.1


  parent reply	other threads:[~2020-01-21  4:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-21  4:52 [spp] [PATCH 0/4] Add " Yasufumi Ogawa
2020-01-21  4:52 ` [spp] [PATCH 1/4] spp_primary: add memif into " Yasufumi Ogawa
2020-01-21  4:52 ` [spp] [PATCH 2/4] spp_nfv: " Yasufumi Ogawa
2020-01-21  4:52 ` Yasufumi Ogawa [this message]
2020-01-21  4:52 ` [spp] [PATCH 4/4] spp-ctl: add memif port type 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=20200121045253.1071-4-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).