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/5] controller: add paring lcore IDs for vf and mirror
Date: Wed,  8 May 2019 10:59:41 +0900	[thread overview]
Message-ID: <1557280784-7620-3-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 of spp_vf and spp_mirror, add parsing lcore IDs in the
response from these processes.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 src/controller/commands/mirror.py | 14 ++++++++++++++
 src/controller/commands/vf.py     | 15 +++++++++++++--
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/src/controller/commands/mirror.py b/src/controller/commands/mirror.py
index b5b7a1b..d38812d 100644
--- a/src/controller/commands/mirror.py
+++ b/src/controller/commands/mirror.py
@@ -85,6 +85,9 @@ class SppMirror(object):
           Basic Information:
             - client-id: 3
             - ports: [phy:0, phy:1]
+            - lcore_ids:
+              - master: 1
+              - slaves: [2, 3]
           Components:
             - core:1, "mr1" (type: mirror)
               - rx: ring:0
@@ -96,10 +99,21 @@ class SppMirror(object):
 
         """
 
+        # Extract slave lcore IDs first
+        slave_lcore_ids = []
+        for worker in json_obj['components']:
+            slave_lcore_ids.append(str(worker['core']))
+
         # Basic Information
         print('Basic Information:')
         print('  - client-id: %d' % json_obj['client-id'])
         print('  - ports: [%s]' % ', '.join(json_obj['ports']))
+        print('  - lcore_ids:')
+        print('    - master: {}'.format(json_obj['master-lcore']))
+        if len(slave_lcore_ids) > 1:
+            print('    - slaves: [{}]'.format(', '.join(slave_lcore_ids)))
+        else:
+            print('    - slave: {}'.format(slave_lcore_ids[0]))
 
         # Componennts
         print('Components:')
diff --git a/src/controller/commands/vf.py b/src/controller/commands/vf.py
index ff08231..b673f0f 100644
--- a/src/controller/commands/vf.py
+++ b/src/controller/commands/vf.py
@@ -89,6 +89,9 @@ class SppVf(object):
           Basic Information:
             - client-id: 3
             - ports: [phy:0, phy:1]
+            - lcore_ids:
+              - master: 1
+              - slaves: [2, 3]
           Classifier Table:
             - "FA:16:3E:7D:CC:35", ring:0
             - "FA:17:3E:7D:CC:55", ring:1
@@ -103,10 +106,18 @@ class SppVf(object):
 
         """
 
+        # Extract slave lcore IDs first
+        slave_lcore_ids = []
+        for worker in json_obj['components']:
+            slave_lcore_ids.append(str(worker['core']))
+
         # Basic Information
         print('Basic Information:')
-        print('  - client-id: %d' % json_obj['client-id'])
-        print('  - ports: [%s]' % ', '.join(json_obj['ports']))
+        print('  - client-id: {}'.format(json_obj['client-id']))
+        print('  - ports: [{}]'.format(', '.join(json_obj['ports'])))
+        print('  - lcore_ids:')
+        print('    - master: {}'.format(json_obj['master-lcore']))
+        print('    - slaves: [{}]'.format(', '.join(slave_lcore_ids)))
 
         # Classifier Table
         print('Classifier Table:')
-- 
2.17.1


  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 ` ogawa.yasufumi [this message]
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 ` [spp] [PATCH 5/5] controller: add parsing lcore IDs for spp_pcap 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=1557280784-7620-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).