From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e23smtp05.au.ibm.com (e23smtp05.au.ibm.com [202.81.31.147]) by dpdk.org (Postfix) with ESMTP id 7FC212C4C for ; Tue, 8 Mar 2016 11:18:53 +0100 (CET) Received: from localhost by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Mar 2016 20:07:51 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 8 Mar 2016 20:07:49 +1000 X-IBM-Helo: d23dlp02.au.ibm.com X-IBM-MailFrom: gowrishankar.m@linux.vnet.ibm.com X-IBM-RcptTo: dts@dpdk.org Received: from d23relay10.au.ibm.com (d23relay10.au.ibm.com [9.190.26.77]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id E24112BB0054 for ; Tue, 8 Mar 2016 21:07:48 +1100 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u28A7efU2425148 for ; Tue, 8 Mar 2016 21:07:48 +1100 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u28A7GnP025508 for ; Tue, 8 Mar 2016 21:07:16 +1100 Received: from chozha.in.ibm.com (chozha.in.ibm.com [9.124.124.138] (may be forged)) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u28A7Dh0024744 for ; Tue, 8 Mar 2016 21:07:15 +1100 From: Gowrishankar To: dts Date: Tue, 8 Mar 2016 15:36:39 +0530 Message-Id: <1457431607-31596-2-git-send-email-gowrishankar.m@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1457431607-31596-1-git-send-email-gowrishankar.m@linux.vnet.ibm.com> References: <1457431607-31596-1-git-send-email-gowrishankar.m@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16030810-0017-0000-0000-00000301EEBB Subject: [dts] [PATCH v2 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: Tue, 08 Mar 2016 10:18:54 -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