Soft Patch Panel
 help / color / mirror / Atom feed
From: yasufum.o@gmail.com
To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com
Subject: [spp] [PATCH] controller: support multi socks to suggest lcores
Date: Wed, 26 Jun 2019 14:37:11 +0900	[thread overview]
Message-ID: <20190626053711.40135-1-yasufum.o@gmail.com> (raw)

From: Yasufumi Ogawa <yasufum.o@gmail.com>

Lcore suggestion of SPP CLI does not care about layout of sockets, so it
possibly suggest a set of lcores on different sockets each other. For
considering optimization, it should be aware of the layout for
suggesting lcores on the same socket.

This update is to select lcores from the same socket if possible.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/controller/commands/pri.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/controller/commands/pri.py b/src/controller/commands/pri.py
index 654b7dd..eaf3d09 100644
--- a/src/controller/commands/pri.py
+++ b/src/controller/commands/pri.py
@@ -159,13 +159,14 @@ class SppPrimary(object):
         """Get lcore usage from spp-ctl for making launch options.
 
         Return value is a double dimension list of unsed lcores.
-          [[2,3,...], [16,17,...]]
+          [[0, 2, 4, ...], [1, 3, 5, ...]]
 
         To get the result, get CPU layout as an list first, then remove
         used lcores from the list.
         """
 
         sockets = []  # A set of CPU sockets.
+
         # Get list of CPU layout
         res = self.spp_ctl_cli.get('cpu_layout')
         if res is not None:
@@ -173,13 +174,14 @@ class SppPrimary(object):
                 try:
                     # Get layout of each of sockets as an array.
                     # [[0,1,2,3,..., 15], [16,17,18],...]]
-                    socket = []
                     for sock in res.json():
+                        socket = []
                         for ent in sock['cores']:
                             socket.append(ent['lcores'])
-                    socket.sort()
-                    socket = sum(socket, [])
-                    sockets.append(socket)
+
+                        socket = sum(socket, [])
+                        socket.sort()
+                        sockets.append(socket)
 
                 except KeyError as e:
                     print('Error: {} is not defined!'.format(e))
-- 
2.17.1


                 reply	other threads:[~2019-06-26  5:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20190626053711.40135-1-yasufum.o@gmail.com \
    --to=yasufum.o@gmail.com \
    --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).