From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e23smtp01.au.ibm.com (e23smtp01.au.ibm.com [202.81.31.143]) by dpdk.org (Postfix) with ESMTP id 28D092C72 for ; Fri, 26 Feb 2016 11:18:22 +0100 (CET) Received: from localhost by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 26 Feb 2016 20:18:20 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp01.au.ibm.com (202.81.31.207) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 26 Feb 2016 20:18:18 +1000 X-IBM-Helo: d23dlp03.au.ibm.com X-IBM-MailFrom: gowrishankar.m@linux.vnet.ibm.com X-IBM-RcptTo: dts@dpdk.org Received: from d23relay07.au.ibm.com (d23relay07.au.ibm.com [9.190.26.37]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 608BB3578052 for ; Fri, 26 Feb 2016 21:18:18 +1100 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u1QAIAVC66846796 for ; Fri, 26 Feb 2016 21:18:18 +1100 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u1QAHkO6000630 for ; Fri, 26 Feb 2016 21:17:46 +1100 Received: from chozha.in.ibm.com ([9.79.215.216]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u1QAHhuw032599 for ; Fri, 26 Feb 2016 21:17:45 +1100 From: Gowrishankar To: dts Date: Fri, 26 Feb 2016 15:47:06 +0530 Message-Id: <1456481834-10027-2-git-send-email-gowrishankar.m@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1456481834-10027-1-git-send-email-gowrishankar.m@linux.vnet.ibm.com> References: <1456481834-10027-1-git-send-email-gowrishankar.m@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16022610-1618-0000-0000-0000271B7E1E Subject: [dts] [PATCH 1/9] framework: check hugepage size and add pages X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 10:18:24 -0000 Add number of huge pages according to enabled huge page size. Also, added expected number of pages in case ppc_64 is DUT platform. Signed-off-by: Gowrishankar --- framework/crb.py | 10 ++++++---- framework/dut.py | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/framework/crb.py b/framework/crb.py index f2009b9..c6fd9fb 100644 --- a/framework/crb.py +++ b/framework/crb.py @@ -161,18 +161,20 @@ class Crb(object): """ Set numbers of huge pages """ + page_size = self.send_expect("awk '/Hugepagesize/ {print $2}' /proc/meminfo", "# ") + if numa == -1: - self.send_expect('echo %d > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages' % huge_pages, '# ', 5) + self.send_expect('echo %d > /sys/kernel/mm/hugepages/hugepages-%skB/nr_hugepages' % (huge_pages, page_size), '# ', 5) else: #sometimes we set hugepage on kernel cmdline, so we need clear default hugepage - self.send_expect('echo 0 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages', '# ', 5) + self.send_expect('echo 0 > /sys/kernel/mm/hugepages/hugepages-%skB/nr_hugepages' % (page_size), '# ', 5) #some platform not support numa, example vm dut try: - self.send_expect('echo %d > /sys/devices/system/node/node%d/hugepages/hugepages-2048kB/nr_hugepages' % (huge_pages, numa), '# ', 5) + self.send_expect('echo %d > /sys/devices/system/node/node%d/hugepages/hugepages-%skB/nr_hugepages' % (huge_pages, numa, page_size), '# ', 5) except: self.logger.warning("set %d hugepage on socket %d error" % (huge_pages, numa)) - self.send_expect('echo %d > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages' % huge_pages, '# ', 5) + self.send_expect('echo %d > /sys/kernel/mm/hugepages/hugepages-%skB/nr_hugepages' % (huge_pages. page_size), '# ', 5) def set_speedup_options(self, read_cache, skip_setup): """ diff --git a/framework/dut.py b/framework/dut.py index bd437cb..c57aa79 100644 --- a/framework/dut.py +++ b/framework/dut.py @@ -301,6 +301,8 @@ class Dut(Crb): elif self.architecture == "x86_x32": arch_huge_pages = hugepages if hugepages > 0 else 256 force_socket = True + elif self.architecture == "ppc_64": + arch_huge_pages = hugepages if hugepages > 0 else 512 if total_huge_pages != arch_huge_pages: # before all hugepage average distribution by all socket, -- 1.7.10.4