From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 78269377E for ; Fri, 8 Sep 2017 08:45:20 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Sep 2017 23:45:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,360,1500966000"; d="scan'208";a="1170267007" Received: from unknown (HELO dpdk-fedora20.icx.intel.com) ([10.240.176.135]) by orsmga001.jf.intel.com with ESMTP; 07 Sep 2017 23:45:18 -0700 From: "xu,gang" To: dts@dpdk.org Cc: "xu,huilong" Date: Fri, 8 Sep 2017 14:46:34 +0800 Message-Id: <1504853194-8552-1-git-send-email-gangx.xu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V2] fix link status interrupt failed case 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, 08 Sep 2017 06:45:21 -0000 From: "xu,huilong" 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 --- 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