Soft Patch Panel
 help / color / mirror / Atom feed
From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 2/2] controller: update paring lcores for master
Date: Wed,  8 May 2019 10:59:29 +0900	[thread overview]
Message-ID: <1557280769-7569-3-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1557280769-7569-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>

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

As master lcore ID is the response of status command, update parsing
lcore IDs for this change.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 src/controller/commands/nfv.py | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/controller/commands/nfv.py b/src/controller/commands/nfv.py
index 2613bc2..92d2a3f 100644
--- a/src/controller/commands/nfv.py
+++ b/src/controller/commands/nfv.py
@@ -74,8 +74,15 @@ class SppNfv(object):
         """
 
         nfv_attr = json_obj
-        print('- status: %s' % nfv_attr['status'])
-        print('- lcores: %s' % nfv_attr['lcores'])
+        print('- status: {}'.format(nfv_attr['status']))
+        print('- lcore_ids:')
+        print('  - master: {}'.format(nfv_attr['master-lcore']))
+        # remove master and show remained
+        nfv_attr['lcores'].remove(nfv_attr['master-lcore'])
+        if len(nfv_attr['lcores']) > 1:
+            print('  - slaves: {}'.format(nfv_attr['lcores']))
+        else:
+            print('  - slave: {}'.format(nfv_attr['lcores'][0]))
         print('- ports:')
         for port in nfv_attr['ports']:
             dst = None
@@ -84,9 +91,9 @@ class SppNfv(object):
                     dst = patch['dst']
 
             if dst is None:
-                print('  - %s' % port)
+                print('  - {}'.format(port))
             else:
-                print('  - %s -> %s' % (port, dst))
+                print('  - {} -> {}'.format(port, dst))
 
     def get_ports(self):
         """Get all of ports as a list."""
-- 
2.17.1


      parent reply	other threads:[~2019-05-08  2:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-08  1:59 [spp] [PATCH 0/2] Get spp_nfv's master lcore ID in status ogawa.yasufumi
2019-05-08  1:59 ` [spp] [PATCH 1/2] spp_nfv: add master lcore in status msg 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=1557280769-7569-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).