From patchwork Wed Nov 9 09:41:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, DukaiX" X-Patchwork-Id: 119608 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5D6BFA00C4; Wed, 9 Nov 2022 10:46:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2DFEB400EF; Wed, 9 Nov 2022 10:46:14 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id BA70C400D7 for ; Wed, 9 Nov 2022 10:46:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667987172; x=1699523172; h=from:to:cc:subject:date:message-id; bh=fd3jBsq/DuhwRbPn7nLvOnttQryQ1VVWDUos8XePJIU=; b=eZ+HoWCeutCpM6DP3upaWFkxaLvlkRPTegE1/1NjPoN9HBWNm1WvnR9q /xXppCgH+ZipSOXzlJAaTVyFB4pN99y0+B7a0XBFZJ8NmyqL7+6Tg1+4t 0cCr97+t89nh3pMfW+ng4VvTqqEdPVm71fwaTr2dIFzJ2vcfR4+H7wd8r vx7uhf0dbmXnkcx0UnQvcxmUDqfUbNQ0lc5TU5t7KX0LxF7zTQsb9nh00 pjYgs/v5Tko/5HjVUa6JF/OVhc6EL2Gyc0f14AE9v35rRHwWH/WpX1SZy APAh9j4rCgt3cyq12XVl5nuRAq4JPyRVhN1Vwizy8JelZ25UPutCLDz5t Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10525"; a="397229742" X-IronPort-AV: E=Sophos;i="5.96,150,1665471600"; d="scan'208";a="397229742" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2022 01:46:11 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10525"; a="742331904" X-IronPort-AV: E=Sophos;i="5.96,150,1665471600"; d="scan'208";a="742331904" Received: from unknown (HELO localhost.localdomain) ([10.239.252.15]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2022 01:46:10 -0800 From: Dukai Yuan To: dts@dpdk.org Cc: Dukai Yuan Subject: [dts][PATCH V1] tests/hotplug modify_code_to_support_2M_hugepages Date: Wed, 9 Nov 2022 17:41:48 +0800 Message-Id: <20221109094148.6216-1-dukaix.yuan@intel.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Testsuite hotplug unsupport test with 2M hugepage. Modify test code to support 2M hugepage. Signed-off-by: Dukai Yuan --- tests/TestSuite_hotplug.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tests/TestSuite_hotplug.py b/tests/TestSuite_hotplug.py index 0f1e17fd..5cf0e933 100644 --- a/tests/TestSuite_hotplug.py +++ b/tests/TestSuite_hotplug.py @@ -36,6 +36,7 @@ class TestPortHotPlug(TestCase): else: self.driver_name = self.drivername self.path = self.dut.apps_name["test-pmd"] + self.session2 = self.dut.create_session(name="virtio_user") def set_up(self): """ @@ -122,6 +123,13 @@ class TestPortHotPlug(TestCase): ) pkt.send_pkt(self.tester, tx_port=self.txItf) + @property + def check_2M_env(self): + out = self.session2.send_expect( + "cat /proc/meminfo |grep Hugepagesize|awk '{print($2)}'", "# " + ) + return True if out == "2048" else False + def test_before_attach(self): """ first attach port after run testpmd @@ -185,6 +193,8 @@ class TestPortHotPlug(TestCase): eal_param = self.dut.create_eal_parameters( no_pci=True, fixed_prefix="virtio1", cores=cores[5:9] ) + if self.check_2M_env: + eal_param += "--single-file-segments" testpmd_cmd2 = "%s/%s " % (self.dut.base_dir, self.path) + eal_param + " -- -i" self.session2.send_expect(testpmd_cmd2, "testpmd>", timeout=60) self.session2.send_expect( @@ -207,11 +217,11 @@ class TestPortHotPlug(TestCase): self.verify( rx_pkts != 0 and tx_pkts != 0, "not received packets or transport packets" ) - self.session2.send_expect("show port stats 0", "testpmd", timeout=2) - self.session2.send_expect("stop", "testpmd", timeout=2) - self.session2.send_expect("quit", "#", timeout=2) - self.dut.send_expect("stop", "testpmd", timeout=2) - self.dut.send_expect("quit", "#", timeout=2) + self.session2.send_expect("show port stats 0", "testpmd") + self.session2.send_expect("stop", "testpmd") + self.session2.send_expect("quit", "#") + self.dut.send_expect("stop", "testpmd") + self.dut.send_expect("quit", "#") self.session2.close() def tear_down(self):