Soft Patch Panel
 help / color / mirror / Atom feed
* [spp] [PATCH 0/2] Get spp_nfv's master lcore ID in status
@ 2019-05-08  1:59 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 ` [spp] [PATCH 2/2] controller: update paring lcores for master ogawa.yasufumi
  0 siblings, 2 replies; 3+ messages in thread
From: ogawa.yasufumi @ 2019-05-08  1:59 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

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

To know which one is master lcore is required for considering core
assignment if master is shared among mulit processes. In SPP, master
lcore is not used for a worker thread and can be shared among other
processes to reduce the number of occupied cores.

This update is to add master lcore ID in response of status command.

Yasufumi Ogawa (2):
  spp_nfv: add master lcore in status msg
  controller: update paring lcores for master

 src/controller/commands/nfv.py | 15 +++++++++++----
 src/nfv/nfv_status.c           |  2 ++
 2 files changed, 13 insertions(+), 4 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [spp] [PATCH 1/2] spp_nfv: add master lcore in status msg
  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 ` ogawa.yasufumi
  2019-05-08  1:59 ` [spp] [PATCH 2/2] controller: update paring lcores for master ogawa.yasufumi
  1 sibling, 0 replies; 3+ messages in thread
From: ogawa.yasufumi @ 2019-05-08  1:59 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

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

To know which one is master lcore is required for considering core
assignment if master is shared among mulit processes. This update is to
add master lcore ID in response of status command.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 src/nfv/nfv_status.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/nfv/nfv_status.c b/src/nfv/nfv_status.c
index d29e083..7e3dbd4 100644
--- a/src/nfv/nfv_status.c
+++ b/src/nfv/nfv_status.c
@@ -55,6 +55,8 @@ append_lcore_info_json(char *str,
 		uint8_t lcore_id_used[RTE_MAX_LCORE])
 {
 	int i;
+	sprintf(str + strlen(str), "\"master-lcore\":%d,",
+			rte_get_master_lcore());
 	sprintf(str + strlen(str), "\"lcores\":[");
 	for (i = 0; i < RTE_MAX_LCORE; i++) {
 		if (lcore_id_used[i] == 1)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [spp] [PATCH 2/2] controller: update paring lcores for master
  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
  1 sibling, 0 replies; 3+ messages in thread
From: ogawa.yasufumi @ 2019-05-08  1:59 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-08  2:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [spp] [PATCH 2/2] controller: update paring lcores for master ogawa.yasufumi

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).