Soft Patch Panel
 help / color / mirror / Atom feed
From: ogawa.yasufumi@lab.ntt.co.jp
To: ferruh.yigit@intel.com, spp@dpdk.org, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH v2 3/4] spp_vm: update retrieving status
Date: Fri,  5 Oct 2018 14:06:29 +0900	[thread overview]
Message-ID: <20181005050630.10661-4-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <20181005050630.10661-1-ogawa.yasufumi@lab.ntt.co.jp>

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

Change from print_active_ports() to get_sec_status_json() to create a
response for status command.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 src/vm/main.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/vm/main.c b/src/vm/main.c
index 16b4c6b..4f3511b 100644
--- a/src/vm/main.c
+++ b/src/vm/main.c
@@ -397,7 +397,6 @@ parse_command(char *str)
 	char *token_list[MAX_PARAMETER] = {NULL};
 	int max_token = 0;
 	int ret = 0;
-	int i;
 
 	if (!str)
 		return 0;
@@ -418,14 +417,15 @@ parse_command(char *str)
 		RTE_LOG(DEBUG, APP, "status\n");
 		memset(str, '\0', MSG_SIZE);
 		if (cmd == FORWARD)
-			i = sprintf(str, "status: running\n");
+			get_sec_stats_json(str, "running", ports_fwd_array,
+					port_map);
 		else
-			i = sprintf(str, "status: idling\n");
-		print_active_ports(str + i, ports_fwd_array, port_map);
+			get_sec_stats_json(str, "idling", ports_fwd_array,
+					port_map);
 
 	} else if (!strcmp(token_list[0], "_get_client_id")) {
 		memset(str, '\0', MSG_SIZE);
-		i = sprintf(str, "%d", client_id);
+		sprintf(str, "%d", client_id);
 
 	} else if (!strcmp(token_list[0], "_set_client_id")) {
 		int id;
-- 
2.7.4

  parent reply	other threads:[~2018-10-05  5:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20181004055918.5922-1-ogawa.yasufumi@lab.ntt.co.j>
2018-10-05  5:06 ` [spp] [PATCH v2 0/4] Change format of sec status to JSON ogawa.yasufumi
2018-10-05  5:06   ` [spp] [PATCH v2 1/4] shared: change sec status to JSON format ogawa.yasufumi
2018-10-05  5:06   ` [spp] [PATCH v2 2/4] spp_nfv: update retrieving status ogawa.yasufumi
2018-10-05  5:06   ` ogawa.yasufumi [this message]
2018-10-05  5:06   ` [spp] [PATCH v2 4/4] controller: update for parsing JSON status ogawa.yasufumi

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=20181005050630.10661-4-ogawa.yasufumi@lab.ntt.co.jp \
    --to=ogawa.yasufumi@lab.ntt.co.jp \
    --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).