* [dts] [PATCH V2] fix link status interrupt failed case
@ 2017-09-08 6:46 xu,gang
2017-09-08 16:21 ` Liu, Yong
0 siblings, 1 reply; 2+ messages in thread
From: xu,gang @ 2017-09-08 6:46 UTC (permalink / raw)
To: dts; +Cc: xu,huilong
From: "xu,huilong" <huilongx.xu@intel.com>
update list:
1. update fortville nic test interrupt mode list
2. fix example setup failed
3. fix check port stats in example
4. fix check rx/tx packet get count number error
Signed-off-by: xu,huilong <huilongx.xu@intel.com>
---
tests/TestSuite_link_status_interrupt.py | 34 ++++++++++++++++++++++----------
1 file changed, 24 insertions(+), 10 deletions(-)
diff --git a/tests/TestSuite_link_status_interrupt.py b/tests/TestSuite_link_status_interrupt.py
index ae205cc..c31634b 100644
--- a/tests/TestSuite_link_status_interrupt.py
+++ b/tests/TestSuite_link_status_interrupt.py
@@ -61,6 +61,15 @@ class TestLinkStatusInterrupt(TestCase):
out = self.dut.build_dpdk_apps("./examples/link_status_interrupt")
self.verify("Error" not in out, "compilation error 1")
self.verify("No such file" not in out, "compilation error 2")
+ # from kernel 4.8+, kernel will not support legacy intr mode.
+ # detaile info:https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/drivers/pci/quirks.c?id=8bcf4525c5d43306c5fd07e132bc8650e3491aec
+ if self.nic in ["fortville_eagle", "fortville_spirit",
+ "fortville_spirt_single", "fortville_25g"]:
+ self.basic_intr_mode = ["msix"]
+ else:
+ self.basic_intr_mode = ["msix", "legacy"]
+ if self.drivername == "vfio-pci":
+ self.basic_intr_mode.append("msi")
def set_link_status_and_verify(self, dutPort, status):
"""
@@ -70,8 +79,9 @@ class TestLinkStatusInterrupt(TestCase):
self.tester.get_local_port(dutPort))
self.tester.send_expect("ifconfig %s %s" %
(self.intf, status.lower()), "# ", 10)
- verify_point = "Port %s Link %s" % (dutPort, status)
- self.dut.send_expect("", verify_point, 60)
+ verify_point = "Port %s Link %s" % (dutPort, status)
+ out = self.dut.get_session_output(timeout=60)
+ self.verify(verify_point in out, "link status update error")
def set_up(self):
"""
@@ -83,23 +93,27 @@ class TestLinkStatusInterrupt(TestCase):
"""
Verify Link status change
"""
+
if self.drivername == "igb_uio":
cmdline = self.path + " -c %s -n %s -- -p %s " % (
self.coremask, self.dut.get_memory_channels(), self.portmask)
- for mode in ["legacy", "msix"]:
+ for mode in self.basic_intr_mode:
self.dut.send_expect("rmmod -f igb_uio", "#", 20)
self.dut.send_expect(
'insmod %s/kmod/igb_uio.ko "intr_mode=%s"' % (self.target, mode), "# ")
self.dut.bind_interfaces_linux()
- self.dut.send_expect(cmdline, "Aggregate statistics", 60)
+ self.dut.send_command(cmdline, 180)
+ out = self.dut.get_session_output(timeout=60)
+ self.verify("Port statistics" in out, "setup example error")
+ time.sleep(10)
self.set_link_status_and_verify(self.dut_ports[0], 'Down')
self.set_link_status_and_verify(self.dut_ports[0], 'Up')
self.dut.send_expect("^C", "#", 60)
elif self.drivername == "vfio-pci":
- for mode in ["legacy", "msi", "msix"]:
+ for mode in self.basic_intr_mode:
cmdline = self.path + " -c %s -n %s --vfio-intr=%s -- -p %s" % (
self.coremask, self.dut.get_memory_channels(), mode, self.portmask)
- self.dut.send_expect(cmdline, "Aggregate statistics", 60)
+ self.dut.send_expect(cmdline, "statistics", 120)
self.set_link_status_and_verify(self.dut_ports[0], 'Down')
self.set_link_status_and_verify(self.dut_ports[0], 'Up')
self.dut.send_expect("^C", "#", 60)
@@ -112,7 +126,7 @@ class TestLinkStatusInterrupt(TestCase):
if self.drivername == "igb_uio":
cmdline = self.path + " -c %s -n %s -- -p %s " % (
self.coremask, self.dut.get_memory_channels(), self.portmask)
- for mode in ["legacy", "msix"]:
+ for mode in self.basic_intr_mode:
self.dut.send_expect("rmmod -f igb_uio", "#", 20)
self.dut.send_expect(
'insmod %s/kmod/igb_uio.ko "intr_mode=%s"' % (self.target, mode), "# ")
@@ -129,11 +143,11 @@ class TestLinkStatusInterrupt(TestCase):
pkt_send = re.findall("Total packets sent:\s*(\d*)", out)
pkt_received = re.findall(
"Total packets received:\s*(\d*)", out)
- self.verify(pkt_send == pkt_received == '1',
+ self.verify(pkt_send[-1] == pkt_received[-1] == '1',
"Error: sent packets != received packets")
self.dut.send_expect("^C", "#", 60)
elif self.drivername == "vfio-pci":
- for mode in ["legacy", "msi", "msix"]:
+ for mode in self.basic_intr_mode:
cmdline = self.path + " -c %s -n %s --vfio-intr=%s -- -p %s" % (
self.coremask, self.dut.get_memory_channels(), mode, self.portmask)
self.dut.send_expect(cmdline, "Aggregate statistics", 60)
@@ -148,7 +162,7 @@ class TestLinkStatusInterrupt(TestCase):
pkt_send = re.findall("Total packets sent:\s*(\d*)", out)
pkt_received = re.findall(
"Total packets received:\s*(\d*)", out)
- self.verify(pkt_send == pkt_received == '1',
+ self.verify(pkt_send[-1] == pkt_received[-1] == '1',
"Error: sent packets != received packets")
self.dut.send_expect("^C", "#", 60)
--
1.9.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dts] [PATCH V2] fix link status interrupt failed case
2017-09-08 6:46 [dts] [PATCH V2] fix link status interrupt failed case xu,gang
@ 2017-09-08 16:21 ` Liu, Yong
0 siblings, 0 replies; 2+ messages in thread
From: Liu, Yong @ 2017-09-08 16:21 UTC (permalink / raw)
To: xu,gang, dts; +Cc: xu,huilong
Thanks, huilong. Applied.
On 09/08/2017 02:46 PM, xu,gang wrote:
> From: "xu,huilong"<huilongx.xu@intel.com>
>
> update list:
> 1. update fortville nic test interrupt mode list
> 2. fix example setup failed
> 3. fix check port stats in example
> 4. fix check rx/tx packet get count number error
>
> Signed-off-by: xu,huilong<huilongx.xu@intel.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-09-08 7:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-08 6:46 [dts] [PATCH V2] fix link status interrupt failed case xu,gang
2017-09-08 16:21 ` Liu, Yong
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).