Soft Patch Panel
 help / color / Atom feed
* [spp] [PATCH 0/4] Add memif in status message
@ 2020-01-21  4:52 Yasufumi Ogawa
  2020-01-21  4:52 ` [spp] [PATCH 1/4] spp_primary: add memif into " Yasufumi Ogawa
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Yasufumi Ogawa @ 2020-01-21  4:52 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

This series of update is to add memif in the list of ports in status
message.

Yasufumi Ogawa (4):
  spp_primary: add memif into status message
  spp_nfv: add memif into status message
  shared: add memif in status message
  spp-ctl: add memif port type

 src/nfv/nfv_status.c      | 16 +++++++++++++
 src/primary/main.c        | 50 ++++++++++++++++++++++++++-------------
 src/shared/common.c       |  9 +++++++
 src/shared/common.h       |  2 ++
 src/shared/port_manager.c |  1 +
 src/spp-ctl/spp_webapi.py |  4 ++--
 6 files changed, 63 insertions(+), 19 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [spp] [PATCH 1/4] spp_primary: add memif into status message
  2020-01-21  4:52 [spp] [PATCH 0/4] Add memif in status message Yasufumi Ogawa
@ 2020-01-21  4:52 ` " Yasufumi Ogawa
  2020-01-21  4:52 ` [spp] [PATCH 2/4] spp_nfv: " Yasufumi Ogawa
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Yasufumi Ogawa @ 2020-01-21  4:52 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

Add memif PMD in the result of status command and its log message. This
update also includes tiny fixes for typo in which log label is replaced
from `SHARED` to `PRIMARY`.

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

diff --git a/src/primary/main.c b/src/primary/main.c
index a1ca791..15152a0 100644
--- a/src/primary/main.c
+++ b/src/primary/main.c
@@ -433,6 +433,10 @@ append_port_info_json(char *str,
 			sprintf(str + strlen(str), "\"tap:%u\",",
 					port_map[i].id);
 			break;
+		case MEMIF:
+			sprintf(str + strlen(str), "\"memif:%u\",",
+					port_map[i].id);
+			break;
 		case UNDEF:
 			/* TODO(yasufum) Need to remove print for undefined ? */
 			sprintf(str + strlen(str), "\"udf\",");
@@ -466,8 +470,8 @@ append_patch_info_json(char *str,
 		if (ports_fwd_array[i].in_port_id == PORT_RESET)
 			continue;
 
-		RTE_LOG(INFO, SHARED, "Port ID %d\n", i);
-		RTE_LOG(INFO, SHARED, "Status %d\n",
+		RTE_LOG(INFO, PRIMARY, "Port ID %d\n", i);
+		RTE_LOG(INFO, PRIMARY, "Status %d\n",
 			ports_fwd_array[i].in_port_id);
 
 		memset(patch_str, '\0', sizeof(patch_str));
@@ -476,43 +480,49 @@ append_patch_info_json(char *str,
 
 		switch (port_map[i].port_type) {
 		case PHY:
-			RTE_LOG(INFO, SHARED, "Type: PHY\n");
+			RTE_LOG(INFO, PRIMARY, "Type: PHY\n");
 			sprintf(patch_str + strlen(patch_str),
 					"\"phy:%u\",",
 					port_map[i].id);
 			break;
 		case RING:
-			RTE_LOG(INFO, SHARED, "Type: RING\n");
+			RTE_LOG(INFO, PRIMARY, "Type: RING\n");
 			sprintf(patch_str + strlen(patch_str),
 					"\"ring:%u\",",
 					port_map[i].id);
 			break;
 		case VHOST:
-			RTE_LOG(INFO, SHARED, "Type: VHOST\n");
+			RTE_LOG(INFO, PRIMARY, "Type: VHOST\n");
 			sprintf(patch_str + strlen(patch_str),
 					"\"vhost:%u\",",
 					port_map[i].id);
 			break;
 		case PCAP:
-			RTE_LOG(INFO, SHARED, "Type: PCAP\n");
+			RTE_LOG(INFO, PRIMARY, "Type: PCAP\n");
 			sprintf(patch_str + strlen(patch_str),
 					"\"pcap:%u\",",
 					port_map[i].id);
 			break;
 		case NULLPMD:
-			RTE_LOG(INFO, SHARED, "Type: NULLPMD\n");
+			RTE_LOG(INFO, PRIMARY, "Type: NULLPMD\n");
 			sprintf(patch_str + strlen(patch_str),
 					"\"nullpmd:%u\",",
 					port_map[i].id);
 			break;
 		case TAP:
-			RTE_LOG(INFO, SHARED, "Type: TAP\n");
+			RTE_LOG(INFO, PRIMARY, "Type: TAP\n");
 			sprintf(patch_str + strlen(patch_str),
 					"\"tap:%u\",",
 					port_map[i].id);
 			break;
+		case MEMIF:
+			RTE_LOG(INFO, PRIMARY, "Type: MEMIF\n");
+			sprintf(patch_str + strlen(patch_str),
+					"\"memif:%u\",",
+					port_map[i].id);
+			break;
 		case UNDEF:
-			RTE_LOG(INFO, SHARED, "Type: UDF\n");
+			RTE_LOG(INFO, PRIMARY, "Type: UDF\n");
 			/* TODO(yasufum) Need to remove print for undefined ? */
 			sprintf(patch_str + strlen(patch_str),
 					"\"udf\",");
@@ -521,7 +531,7 @@ append_patch_info_json(char *str,
 
 		sprintf(patch_str + strlen(patch_str), "\"dst\":");
 
-		RTE_LOG(INFO, SHARED, "Out Port ID %d\n",
+		RTE_LOG(INFO, PRIMARY, "Out Port ID %d\n",
 				ports_fwd_array[i].out_port_id);
 
 		if (ports_fwd_array[i].out_port_id == PORT_RESET) {
@@ -532,43 +542,49 @@ append_patch_info_json(char *str,
 			unsigned int j = ports_fwd_array[i].out_port_id;
 			switch (port_map[j].port_type) {
 			case PHY:
-				RTE_LOG(INFO, SHARED, "Type: PHY\n");
+				RTE_LOG(INFO, PRIMARY, "Type: PHY\n");
 				sprintf(patch_str + strlen(patch_str),
 						"\"phy:%u\"",
 						port_map[j].id);
 				break;
 			case RING:
-				RTE_LOG(INFO, SHARED, "Type: RING\n");
+				RTE_LOG(INFO, PRIMARY, "Type: RING\n");
 				sprintf(patch_str + strlen(patch_str),
 						"\"ring:%u\"",
 						port_map[j].id);
 				break;
 			case VHOST:
-				RTE_LOG(INFO, SHARED, "Type: VHOST\n");
+				RTE_LOG(INFO, PRIMARY, "Type: VHOST\n");
 				sprintf(patch_str + strlen(patch_str),
 						"\"vhost:%u\"",
 						port_map[j].id);
 				break;
 			case PCAP:
-				RTE_LOG(INFO, SHARED, "Type: PCAP\n");
+				RTE_LOG(INFO, PRIMARY, "Type: PCAP\n");
 				sprintf(patch_str + strlen(patch_str),
 						"\"pcap:%u\"",
 						port_map[j].id);
 				break;
 			case NULLPMD:
-				RTE_LOG(INFO, SHARED, "Type: NULLPMD\n");
+				RTE_LOG(INFO, PRIMARY, "Type: NULLPMD\n");
 				sprintf(patch_str + strlen(patch_str),
 						"\"nullpmd:%u\"",
 						port_map[j].id);
 				break;
 			case TAP:
-				RTE_LOG(INFO, SHARED, "Type: TAP\n");
+				RTE_LOG(INFO, PRIMARY, "Type: TAP\n");
 				sprintf(patch_str + strlen(patch_str),
 						"\"tap:%u\"",
 						port_map[j].id);
 				break;
+			case MEMIF:
+				RTE_LOG(INFO, PRIMARY, "Type: MEMIF\n");
+				sprintf(patch_str + strlen(patch_str),
+						"\"memif:%u\"",
+						port_map[j].id);
+				break;
 			case UNDEF:
-				RTE_LOG(INFO, SHARED, "Type: UDF\n");
+				RTE_LOG(INFO, PRIMARY, "Type: UDF\n");
 				/*
 				 * TODO(yasufum) Need to remove print for
 				 * undefined ?
-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [spp] [PATCH 2/4] spp_nfv: add memif into status message
  2020-01-21  4:52 [spp] [PATCH 0/4] Add memif in status message Yasufumi Ogawa
  2020-01-21  4:52 ` [spp] [PATCH 1/4] spp_primary: add memif into " Yasufumi Ogawa
@ 2020-01-21  4:52 ` " Yasufumi Ogawa
  2020-01-21  4:52 ` [spp] [PATCH 3/4] shared: add memif in " Yasufumi Ogawa
  2020-01-21  4:52 ` [spp] [PATCH 4/4] spp-ctl: add memif port type Yasufumi Ogawa
  3 siblings, 0 replies; 5+ messages in thread
From: Yasufumi Ogawa @ 2020-01-21  4:52 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/nfv/nfv_status.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/nfv/nfv_status.c b/src/nfv/nfv_status.c
index a092fac..3947a84 100644
--- a/src/nfv/nfv_status.c
+++ b/src/nfv/nfv_status.c
@@ -115,6 +115,10 @@ append_port_info_json(char *str,
 			sprintf(str + strlen(str), "\"tap:%u\",",
 					port_map[i].id);
 			break;
+		case MEMIF:
+			sprintf(str + strlen(str), "\"memif:%u\",",
+					port_map[i].id);
+			break;
 		case UNDEF:
 			/* TODO(yasufum) Need to remove print for undefined ? */
 			sprintf(str + strlen(str), "\"udf\",");
@@ -201,6 +205,12 @@ append_patch_info_json(char *str,
 					"\"tap:%u\",",
 					port_map[i].id);
 			break;
+		case MEMIF:
+			RTE_LOG(INFO, SHARED, "Type: MEMIF\n");
+			sprintf(patch_str + strlen(patch_str),
+					"\"memif:%u\",",
+					port_map[i].id);
+			break;
 		case UNDEF:
 			RTE_LOG(INFO, SHARED, "Type: UDF\n");
 			/* TODO(yasufum) Need to remove print for undefined ? */
@@ -257,6 +267,12 @@ append_patch_info_json(char *str,
 						"\"tap:%u\"",
 						port_map[j].id);
 				break;
+			case MEMIF:
+				RTE_LOG(INFO, SHARED, "Type: MEMIF\n");
+				sprintf(patch_str + strlen(patch_str),
+						"\"memif:%u\"",
+						port_map[j].id);
+				break;
 			case UNDEF:
 				RTE_LOG(INFO, SHARED, "Type: UDF\n");
 				/*
-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [spp] [PATCH 3/4] shared: add memif in status message
  2020-01-21  4:52 [spp] [PATCH 0/4] Add memif in status message 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
  2020-01-21  4:52 ` [spp] [PATCH 4/4] spp-ctl: add memif port type Yasufumi Ogawa
  3 siblings, 0 replies; 5+ messages in thread
From: Yasufumi Ogawa @ 2020-01-21  4:52 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [spp] [PATCH 4/4] spp-ctl: add memif port type
  2020-01-21  4:52 [spp] [PATCH 0/4] Add memif in status message Yasufumi Ogawa
                   ` (2 preceding siblings ...)
  2020-01-21  4:52 ` [spp] [PATCH 3/4] shared: add memif in " Yasufumi Ogawa
@ 2020-01-21  4:52 ` Yasufumi Ogawa
  3 siblings, 0 replies; 5+ messages in thread
From: Yasufumi Ogawa @ 2020-01-21  4:52 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

Add memif into the list of supported port types.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/spp-ctl/spp_webapi.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/spp-ctl/spp_webapi.py b/src/spp-ctl/spp_webapi.py
index a21fd86..31befe2 100644
--- a/src/spp-ctl/spp_webapi.py
+++ b/src/spp-ctl/spp_webapi.py
@@ -13,8 +13,8 @@ import sys
 
 import spp_proc
 
-PORT_TYPES = ["phy", "vhost", "ring", "pcap", "nullpmd", "tap"]
-VF_PORT_TYPES = ["phy", "vhost", "ring"]
+PORT_TYPES = ["phy", "vhost", "ring", "pcap", "nullpmd", "tap", "memif"]
+VF_PORT_TYPES = ["phy", "vhost", "ring"] # TODO(yasufum) add other ports
 # TODO(yasufum) consider PCAP_PORT_TYPES is required.
 
 LOG = logging.getLogger(__name__)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-21  4:52 [spp] [PATCH 0/4] Add memif in status message 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 ` [spp] [PATCH 3/4] shared: add memif in " Yasufumi Ogawa
2020-01-21  4:52 ` [spp] [PATCH 4/4] spp-ctl: add memif port type Yasufumi Ogawa

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