From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id A8C78A0096 for ; Wed, 8 May 2019 04:02:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9ED0AA49; Wed, 8 May 2019 04:02:03 +0200 (CEST) Received: from tama500.ecl.ntt.co.jp (tama500.ecl.ntt.co.jp [129.60.39.148]) by dpdk.org (Postfix) with ESMTP id 3C047DE3 for ; Wed, 8 May 2019 04:02:01 +0200 (CEST) Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x48220YG023007; Wed, 8 May 2019 11:02:00 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 27382637FF7; Wed, 8 May 2019 11:02:00 +0900 (JST) Received: from localhost.localdomain (lobster.nslab.ecl.ntt.co.jp [129.60.13.95]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 161D2637FE3; Wed, 8 May 2019 11:02:00 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp Date: Wed, 8 May 2019 10:59:41 +0900 Message-Id: <1557280784-7620-3-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1557280784-7620-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> References: <1557280784-7620-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-TM-AS-MML: disable Subject: [spp] [PATCH 2/5] controller: add paring lcore IDs for vf and mirror X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spp-bounces@dpdk.org Sender: "spp" From: Yasufumi Ogawa 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 --- 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