From: ogawa.yasufumi@lab.ntt.co.jp
To: ferruh.yigit@intel.com, spp@dpdk.org, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 2/3] controller: add lcores in status command of pri
Date: Thu, 31 Jan 2019 12:05:05 +0900 [thread overview]
Message-ID: <1548903906-17403-3-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1548903906-17403-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
This update is to show lcores in the result of status command of pri in
SPP CLI. It is also changed the format of message to be similar as
other processes. Here is an example of using lcore 0 and 3.
- lcores:
[0, 3]
- physical ports:
ID rx tx tx_drop mac_addr
0 78932932 78932931 1 56:48:4f:53:54:00
- ring ports:
ID rx tx rx_drop rx_drop
0 89283 89283 0 0
...
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
src/controller/commands/pri.py | 33 ++++++++++++++++++++-------------
1 file changed, 20 insertions(+), 13 deletions(-)
diff --git a/src/controller/commands/pri.py b/src/controller/commands/pri.py
index 662e41a..1f60ece 100644
--- a/src/controller/commands/pri.py
+++ b/src/controller/commands/pri.py
@@ -83,6 +83,7 @@ class SppPrimary(object):
long.
{
+ "lcores": [0, 3],
"phy_ports": [
{
"eth": "56:48:4f:12:34:00",
@@ -107,28 +108,34 @@ class SppPrimary(object):
It is formatted to be simple and more understandable.
- Physical Ports:
- ID rx tx tx_drop mac_addr
- 0 78932932 78932931 1 56:48:4f:53:54:00
- Ring Ports:
- ID rx tx rx_drop rx_drop
- 0 89283 89283 0 0
- ...
+ - lcores:
+ [0, 3]
+ - physical ports:
+ ID rx tx tx_drop mac_addr
+ 0 78932932 78932931 1 56:48:4f:53:54:00
+ - ring ports:
+ ID rx tx rx_drop rx_drop
+ 0 89283 89283 0 0
+ ...
"""
+ if 'lcores' in json_obj:
+ print('- lcores:')
+ print(' - {}'.format(json_obj['lcores']))
+
if 'phy_ports' in json_obj:
- print('Physical Ports:')
- print(' ID rx tx tx_drop mac_addr')
+ print('- physical ports:')
+ print(' ID rx tx tx_drop mac_addr')
for pports in json_obj['phy_ports']:
- print(' %2d %10d %10d %10d %s' % (
+ print(' %2d %10d %10d %10d %s' % (
pports['id'], pports['rx'], pports['tx'],
pports['tx_drop'], pports['eth']))
if 'ring_ports' in json_obj:
- print('Ring Ports:')
- print(' ID rx tx rx_drop rx_drop')
+ print('- ring Ports:')
+ print(' ID rx tx rx_drop rx_drop')
for rports in json_obj['ring_ports']:
- print(' %2d %10d %10d %10d %10d' % (
+ print(' %2d %10d %10d %10d %10d' % (
rports['id'], rports['rx'], rports['tx'],
rports['rx_drop'], rports['tx_drop']))
--
2.7.4
next prev parent reply other threads:[~2019-01-31 3:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-31 3:05 [spp] [PATCH 0/3] Add getting lcores feature ogawa.yasufumi
2019-01-31 3:05 ` [spp] [PATCH 1/3] spp_primary: add lcores in status info ogawa.yasufumi
2019-01-31 3:05 ` ogawa.yasufumi [this message]
2019-01-31 3:05 ` [spp] [PATCH 3/3] spp-ctl: add API for getting CPU layout 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=1548903906-17403-3-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).