From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 991D529D6 for ; Wed, 30 Aug 2017 11:07:26 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP; 30 Aug 2017 02:07:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,448,1498546800"; d="scan'208";a="123967206" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga004.jf.intel.com with ESMTP; 30 Aug 2017 02:07:25 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 30 Aug 2017 02:07:24 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.219]) by shsmsx102.ccr.corp.intel.com ([169.254.2.39]) with mapi id 14.03.0319.002; Wed, 30 Aug 2017 17:07:21 +0800 From: "Liu, Yong" To: "Xu, HuilongX" , "dts@dpdk.org" CC: "Xu, HuilongX" Thread-Topic: [dts] [PATCH V1] fix link status interrupt failed case Thread-Index: AQHTHXFJbiyVW3x01EaRrLuXqKJLOKKcobww Date: Wed, 30 Aug 2017 09:07:21 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E62E957C3@SHSMSX103.ccr.corp.intel.com> References: <1503645095-90269-1-git-send-email-huilongx.xu@intel.com> In-Reply-To: <1503645095-90269-1-git-send-email-huilongx.xu@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1] 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: Wed, 30 Aug 2017 09:07:27 -0000 Huilong, Some comments and questions below. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,huilong > Sent: Friday, August 25, 2017 3:12 PM > To: dts@dpdk.org > Cc: Xu, HuilongX > Subject: [dts] [PATCH V1] fix link status interrupt failed case >=20 > 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 >=20 > Signed-off-by: xu,huilong > --- > tests/TestSuite_link_status_interrupt.py | 34 +++++++++++++++++++++++---= - > ----- > 1 file changed, 25 insertions(+), 9 deletions(-) >=20 > diff --git a/tests/TestSuite_link_status_interrupt.py > b/tests/TestSuite_link_status_interrupt.py > index ae205cc..2249cf1 100644 > --- a/tests/TestSuite_link_status_interrupt.py > +++ b/tests/TestSuite_link_status_interrupt.py > @@ -61,6 +61,15 @@ class TestLinkStatusInterrupt(TestCase): > out =3D self.dut.build_dpdk_apps("./examples/link_status_interru= pt") > self.verify("Error" not in out, "compilation error 1") > self.verify("No such file" not in out, "compilation error 2") > + # fortville NIC not support legacy intr mode > + if self.nic in ["fortville_eagle", "fortville_spirit", > + "fortville_spirt_single", "fortville_25g"]: > + self.basic_intr_mode =3D ["msix"] > + else: > + self.basic_intr_mode =3D ["msix", "legacy"] > + # vfio support msi intr mode > + if self.drivername =3D=3D "vfio-pci": > + self.basic_intr_mode.append("msi") Please add link of dpdk release note in the commit log. >=20 > def set_link_status_and_verify(self, dutPort, status): > """ > @@ -71,7 +80,9 @@ class TestLinkStatusInterrupt(TestCase): > self.tester.send_expect("ifconfig %s %s" % > (self.intf, status.lower()), "# ", 10) > verify_point =3D "Port %s Link %s" % (dutPort, status) > - self.dut.send_expect("", verify_point, 60) > + > + out =3D self.dut.get_session_output(timeout=3D60) > + self.verify(verify_point in out,"link status update error") >=20 > def set_up(self): > """ > @@ -86,20 +97,23 @@ class TestLinkStatusInterrupt(TestCase): > if self.drivername =3D=3D "igb_uio": > cmdline =3D 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=3D%s"' % > (self.target, mode), "# ") > self.dut.bind_interfaces_linux() > - self.dut.send_expect(cmdline, "Aggregate statistics", 60= ) > + self.dut.send_expect(cmdline, "", 180) If there's nothing to check in output, you can use function "self.dut.send_= command(timeout=3Dtime)". And 180 seconds is too long, what is waiting for? > + out =3D self.dut.get_session_output(timeout=3D60) Function "get_session_output" just return all output after timeout. Normall= y we will use default value, why enlarge time out value to 60 seconds? > + 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 =3D=3D "vfio-pci": > - for mode in ["legacy", "msi", "msix"]: > + for mode in self.basic_intr_mode : Pep issue here, please modify it. > cmdline =3D self.path + " -c %s -n %s --vfio-intr=3D%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 statistics", > 120) A bit tricky here, why double "statistics" here? > 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 =3D=3D "igb_uio": > cmdline =3D 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=3D%s"' % > (self.target, mode), "# ") > @@ -129,11 +143,12 @@ class TestLinkStatusInterrupt(TestCase): > pkt_send =3D re.findall("Total packets sent:\s*(\d*)", o= ut) > pkt_received =3D re.findall( > "Total packets received:\s*(\d*)", out) > - self.verify(pkt_send =3D=3D pkt_received =3D=3D '1', > + # example will print rx/tx packet info by loop so only > check last one > + self.verify(pkt_send[-1] =3D=3D pkt_received[-1] =3D=3D = '1', > "Error: sent packets !=3D received packets") > self.dut.send_expect("^C", "#", 60) > elif self.drivername =3D=3D "vfio-pci": > - for mode in ["legacy", "msi", "msix"]: > + for mode in self.basic_intr_mode: > cmdline =3D self.path + " -c %s -n %s --vfio-intr=3D%s -= - - > p %s" % ( > self.coremask, self.dut.get_memory_channels(), mode, > self.portmask) > self.dut.send_expect(cmdline, "Aggregate statistics", 60= ) > @@ -148,7 +163,8 @@ class TestLinkStatusInterrupt(TestCase): > pkt_send =3D re.findall("Total packets sent:\s*(\d*)", o= ut) > pkt_received =3D re.findall( > "Total packets received:\s*(\d*)", out) > - self.verify(pkt_send =3D=3D pkt_received =3D=3D '1', > + # example will print rx/tx packet info by loop so only > check last one > + self.verify(pkt_send[-1] =3D=3D pkt_received[-1] =3D=3D = '1', > "Error: sent packets !=3D received packets") > self.dut.send_expect("^C", "#", 60) >=20 > -- > 1.9.3