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 1/4] spp_primary: add memif into status message
Date: Tue, 21 Jan 2020 13:52:50 +0900
Message-ID: <20200121045253.1071-2-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. 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


  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 memif in " Yasufumi Ogawa
2020-01-21  4:52 ` Yasufumi Ogawa [this message]
2020-01-21  4:52 ` [spp] [PATCH 2/4] spp_nfv: add memif into " 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

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-2-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

Soft Patch Panel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://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/ https://inbox.dpdk.org/spp \
		spp@dpdk.org
	public-inbox-index spp

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.spp


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