test suite reviews and discussions
 help / color / mirror / Atom feed
From: Yong Liu <yong.liu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH 2/2] framework dut: fix hugepage not allocate to all numa
Date: Thu, 21 Jan 2016 10:57:00 +0800	[thread overview]
Message-ID: <1453345020-19042-2-git-send-email-yong.liu@intel.com> (raw)
In-Reply-To: <1453345020-19042-1-git-send-email-yong.liu@intel.com>

From: Marvin Liu <yong.liu@intel.com>

When numa allocate only to numa 0, testpmd may failed to startup for NIC
attached to numa 1.

Signed-off-by: Marvin Liu <yong.liu@intel.com>

diff --git a/framework/dut.py b/framework/dut.py
index afb5204..bd437cb 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -289,21 +289,27 @@ class Dut(Crb):
             return
         hugepages_size = self.send_expect("awk '/Hugepagesize/ {print $2}' /proc/meminfo", "# ")
         total_huge_pages = self.get_total_huge_pages()
+        force_socket = False
 
         if int(hugepages_size) < (1024 * 1024):
             if self.architecture == "x86_64":
                 arch_huge_pages = hugepages if hugepages > 0 else 4096
             elif self.architecture == "i686":
                 arch_huge_pages = hugepages if hugepages > 0 else 512
+                force_socket = True
             # set huge pagesize for x86_x32 abi target
             elif self.architecture == "x86_x32":
                 arch_huge_pages = hugepages if hugepages > 0 else 256
+                force_socket = True
 
             if total_huge_pages != arch_huge_pages:
-                 # before all hugepage  average distribution  by all socket, 
-                 # but sometimes crete mbuf pool on socket 0 failed when setup testpmd, 
+                 # before all hugepage average distribution  by all socket,
+                 # but sometimes create mbuf pool on socket 0 failed when setup testpmd,
                  # so set all huge page on socket 0
-                self.set_huge_pages(arch_huge_pages, 0)
+                if force_socket:
+                    self.set_huge_pages(arch_huge_pages, 0)
+                else:
+                    self.set_huge_pages(arch_huge_pages)
 
         self.mount_huge_pages()
         self.hugepage_path = self.strip_hugepage_path()
-- 
2.4.3

      reply	other threads:[~2016-01-21  2:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21  2:56 [dts] [PATCH 1/2] framework: fix packet load function missed Yong Liu
2016-01-21  2:57 ` Yong Liu [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=1453345020-19042-2-git-send-email-yong.liu@intel.com \
    --to=yong.liu@intel.com \
    --cc=dts@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).