From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 5/5] controller: add parsing lcore IDs for spp_pcap
Date: Wed, 8 May 2019 10:59:44 +0900 [thread overview]
Message-ID: <1557280784-7620-6-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1557280784-7620-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
To show lcore IDs, add parsing the response from spp_pcap.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
src/controller/commands/pcap.py | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/src/controller/commands/pcap.py b/src/controller/commands/pcap.py
index d06327b..88dd5c8 100644
--- a/src/controller/commands/pcap.py
+++ b/src/controller/commands/pcap.py
@@ -115,8 +115,13 @@ class SppPcap(object):
Print status received from spp_pcap.
spp > pcap 1; status
+ Basic Information:
- client-id: 3
- satus: running
+ - lcore_ids:
+ - master: 1
+ - slaves: [2, 3, 3, 4, 5, 6]
+ Components:
- core:2, receive
- rx: phy:0
- core:3, write
@@ -129,11 +134,21 @@ class SppPcap(object):
"""
- # client id and status
+ # Extract slave lcore IDs first
+ slave_lcore_ids = []
+ for worker in json_obj['core']:
+ slave_lcore_ids.append(str(worker['core']))
+
+ # Basic Information
+ print('Basic Information:')
print(' - client-id: {}'.format(json_obj['client-id']))
print(' - status: {}'.format(json_obj['status']))
+ print(' - lcore_ids:')
+ print(' - master: {}'.format(json_obj['master-lcore']))
+ print(' - slaves: [{}]'.format(', '.join(slave_lcore_ids)))
- # Core
+ # Componennts
+ print('Components:')
for worker in json_obj['core']:
if 'role' in worker.keys():
print(" - core:{core_id} {role}".format(
--
2.17.1
prev parent reply other threads:[~2019-05-08 2:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-08 1:59 [spp] [PATCH 0/5] Show lcores in status of spp_vf and siblings ogawa.yasufumi
2019-05-08 1:59 ` [spp] [PATCH 1/5] spp_vf/common: add lcore IDs in status message ogawa.yasufumi
2019-05-08 1:59 ` [spp] [PATCH 2/5] controller: add paring lcore IDs for vf and mirror ogawa.yasufumi
2019-05-08 1:59 ` [spp] [PATCH 3/5] spp-ctl: add master lcore entry for SPP CLI ogawa.yasufumi
2019-05-08 1:59 ` [spp] [PATCH 4/5] spp_pcap: add lcore IDs in status message ogawa.yasufumi
2019-05-08 1:59 ` ogawa.yasufumi [this message]
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=1557280784-7620-6-git-send-email-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).