From: Dukai Yuan <dukaix.yuan@intel.com>
To: dts@dpdk.org
Cc: Dukai Yuan <dukaix.yuan@intel.com>
Subject: [dts][PATCH V2] tests/hotplug modify code to support 2M hugepages
Date: Thu, 10 Nov 2022 09:42:34 +0800 [thread overview]
Message-ID: <20221110014234.29418-1-dukaix.yuan@intel.com> (raw)
Add `--single-file-segments` parameter when start virtio-user side
to support running in 2M hugepage size testbed.
Signed-off-by: Dukai Yuan <dukaix.yuan@intel.com>
---
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):
--
2.17.1
next reply other threads:[~2022-11-10 1:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-10 1:42 Dukai Yuan [this message]
2022-11-11 2:42 ` Chen, LingliX
2022-11-18 8:18 ` lijuan.tu
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=20221110014234.29418-1-dukaix.yuan@intel.com \
--to=dukaix.yuan@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).