From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id C75A73B5 for ; Fri, 10 Feb 2017 03:14:52 +0100 (CET) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP; 09 Feb 2017 18:14:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,138,1484035200"; d="scan'208";a="62950165" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga005.jf.intel.com with ESMTP; 09 Feb 2017 18:14:51 -0800 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 9 Feb 2017 18:14:51 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 9 Feb 2017 18:14:50 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0248.002; Fri, 10 Feb 2017 10:14:49 +0800 From: "Liu, Yong" To: "Xu, GangX" , "dts@dpdk.org" CC: "Xu, GangX" Thread-Topic: [dts] [PATCH V1] add test suite interrupt pmd Thread-Index: AQHSgrxmYbnG+mwzJkm55LZmguYKcaFhf+mQ Date: Fri, 10 Feb 2017 02:14:48 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E62D5DC4E@SHSMSX103.ccr.corp.intel.com> References: <1486634908-21999-1-git-send-email-gangx.xu@intel.com> In-Reply-To: <1486634908-21999-1-git-send-email-gangx.xu@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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] add test suite interrupt pmd 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, 10 Feb 2017 02:14:53 -0000 Hi Gang, I think this suite is lack of lsc status check and vfio/uio_generic driver = check. And some comments below. Thanks, Marvin > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,gang > Sent: Thursday, February 09, 2017 6:08 PM > To: dts@dpdk.org > Cc: Xu, GangX > Subject: [dts] [PATCH V1] add test suite interrupt pmd >=20 > Signed-off-by: xu,gang > --- > tests/TestSuite_interrupt_pmd.py | 156 > +++++++++++++++++++++++++++++++++++++++ > 1 file changed, 156 insertions(+) > create mode 100644 tests/TestSuite_interrupt_pmd.py >=20 > diff --git a/tests/TestSuite_interrupt_pmd.py > b/tests/TestSuite_interrupt_pmd.py > new file mode 100644 > index 0000000..6acb99d > --- /dev/null > +++ b/tests/TestSuite_interrupt_pmd.py > @@ -0,0 +1,156 @@ > +# BSD LICENSE > +# > +# Copyright(c) 2010-2017 Intel Corporation. All rights reserved. > +# All rights reserved. > +# > +# Redistribution and use in source and binary forms, with or without > +# modification, are permitted provided that the following conditions > +# are met: > +# > +# * Redistributions of source code must retain the above copyright > +# notice, this list of conditions and the following disclaimer. > +# * Redistributions in binary form must reproduce the above copyright > +# notice, this list of conditions and the following disclaimer in > +# the documentation and/or other materials provided with the > +# distribution. > +# * Neither the name of Intel Corporation nor the names of its > +# contributors may be used to endorse or promote products derived > +# from this software without specific prior written permission. > +# > +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS > +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR > +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT > +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, > +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT > +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, > +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE > +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + > +""" > +DPDK Test suite. > +Test interrupt pmd. > +""" > + > +import string > +import re > +import time > +import utils > +from test_case import TestCase > +from utils import create_mask > +from packet import Packet, sniff_packets, load_sniff_packets > + > + > +class TestIntrPmd(TestCase): > + > + def set_up_all(self): > + """ > + Run before each test suite. > + """ > + self.dut_ports =3D self.dut.get_ports(self.nic) > + self.verify(len(self.dut_ports) >=3D 2, "Insufficient ports") > + self.portmask =3D utils.create_mask(self.dut_ports) > + > + self.path =3D "./examples/l3fwd-power/build/l3fwd-power" > + # build sample app > + out =3D self.dut.send_expect("make -C examples/l3fwd-power", "# = ") > + self.verify("Error" not in out, "compilation error 1") > + self.verify("No such file" not in out, "compilation error 2") > + > + def set_up(self): > + """ > + Run before each test case. > + """ > + pass > + > + def scapy_send_packet(self,num =3D 1): > + """ > + Send a packet to port > + """ > + self.dmac =3D self.dut.get_mac_address(self.dut_ports[0]) > + txport =3D self.tester.get_local_port(self.dut_ports[0]) > + self.txItf =3D self.tester.get_interface(txport) > + pkt =3D Packet(pkt_type=3D'UDP') > + pkt.config_layer('ether', {'dst': self.dmac,}) > + pkt.send_pkt(tx_port=3Dself.txItf,count=3Dnum) > + > + def test_basal(self): > + """ > + Verify interrupt pmd work fine when nic bound to vfio > + """ > + cores =3D self.dut.get_core_list("1S/2C/1T") > + coremask =3D create_mask(cores) > + cmd =3D self.path + " -c %s -n %d -- -p %s -P " \ > + "--config=3D\"(0,0,%s),(1,0,%s)\" " \ > + % (coremask, self.dut.get_memory_channels(), > + self.portmask, cores[0], cores[1]) > + out1=3Dself.dut.send_expect(cmd, "sleeps until interrupt trigger= s", > 60) > + self.scapy_send_packet() > + out =3D self.dut.get_session_output(timeout=3D5) > + self.dut.send_expect("^C", "# ") > + self.verify_status(out) > + > + def test_pf_multiqueue(self): > + """ > + Verify interrupt pmd work fine with multi queues > + """ > + cores =3D self.dut.get_core_list("1S/4C/1T") > + coremask =3D create_mask(cores) > + cmd =3D self.path + " -c %s -n %d -- -p %s -P " \ > + "--config=3D\"(0,0,%s),(0,1,%s),(1,0,%s),(1,1,%s)\"" \ > + % (coremask, self.dut.get_memory_channels(), > + self.portmask, cores[0], cores[1], cores[2], cores[3]) > + self.dut.send_expect(cmd, "sleeps until interrupt triggers", 60) > + self.scapy_send_packet() > + out =3D self.dut.get_session_output(timeout=3D5) > + self.dut.send_expect("^C", "# ") > + self.verify_status(out) > + > + def test_pf_maxqueue(self): > + """ > + Verify interrupt pmd work fine with maximum queues > + """ > + cores =3D self.dut.get_core_list("2S/16C/2T") I've heard that some users are running DTS on host with only 4 cores. Sugge= st to use 1S/4C/1T for this case. > + coremask =3D create_mask(cores) > + config_cmd =3D "--config=3D\"" > + #At most 15 intr queues supported > + max_queue =3D 15 Max queues for different NICs may be different. So need to determine the va= lue by nic type. > + for idx in range(max_queue): > + config_cmd +=3D "(0,%d,%s)," % (idx, cores[idx]) > + for idx in range(max_queue): > + config_cmd +=3D "(1,%d,%s)," % (idx, cores[idx + max_queue]) > + config_cmd +=3D "\"" > + cmd =3D self.path + " -c %s -n %d -- -p %s -P " % (coremask, > self.dut.get_memory_channels(),self.portmask) > + cmd +=3D config_cmd > + put=3Dself.dut.send_expect(cmd, "sleeps until interrupt triggers= ", > 60) > + self.scapy_send_packet() > + out =3D self.dut.get_session_output(timeout=3D5) > + self.dut.send_expect("^C", "# ") > + self.verify_status(out) > + > + def verify_status(self,out): > + """ > + Verify core status change > + """ > + # make sure core normally waked up > + wakeup_msg =3D "waked up from rx interrupt" > + self.verify(wakeup_msg in out, "Expected core not waked up") Only wake up message is not enough for function check, here also need to ch= eck core id. > + # make sure core normally sleep > + sleep_msg =3D "sleeps until interrupt triggers" > + self.verify(sleep_msg in out, "Expected core not sleep") > + > + def tear_down(self): > + """ > + Run after each test suite. > + """ > + self.dut.kill_all() > + time.sleep(2) > + pass > + > + def tear_down_all(self): > + """ > + Run after each test suite. > + """ > + pass > -- > 1.9.3