From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DE10BA0561; Mon, 20 Apr 2020 04:17:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D46E81C2F7; Mon, 20 Apr 2020 04:17:32 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 1513B1C2F5 for ; Mon, 20 Apr 2020 04:17:30 +0200 (CEST) IronPort-SDR: YQRzAOYOG+8iSAsZTLweCRd7SpE6s4zGtMXSGtQHoIUijPKUleQhJ721E8VBtSAFqNTYDyWwIn W/QVLZBojojA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2020 19:17:29 -0700 IronPort-SDR: ySyxbSBR4hl/iOmtAYJqvHkBJW21u7CY0CgAwqKFV71mfH/y7WxoyaOHfDoKQIaTIL7d8V8xj+ 9F0b/NXG1A5Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,405,1580803200"; d="scan'208";a="333771276" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga001.jf.intel.com with ESMTP; 19 Apr 2020 19:17:29 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 19 Apr 2020 19:17:29 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 19 Apr 2020 19:17:29 -0700 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Sun, 19 Apr 2020 19:17:28 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.129]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.213]) with mapi id 14.03.0439.000; Mon, 20 Apr 2020 10:17:26 +0800 From: "Tu, Lijuan" To: "Chen, BoX C" , "dts@dpdk.org" CC: root , "Chen@dpdk.org" , "Chen, BoX C" Thread-Topic: [dts] [PATCH V1] tests/Kernelpf_iavf: add support i40e Thread-Index: AQHWDkmVNIsW/TyewUCnTJYv7lruAaiBVxUg Date: Mon, 20 Apr 2020 02:17:26 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BC0CCD0@SHSMSX101.ccr.corp.intel.com> References: <20200409162955.14009-1-box.c.chen@intel.com> In-Reply-To: <20200409162955.14009-1-box.c.chen@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.2.0.6 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] tests/Kernelpf_iavf: add support i40e 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Chen, Bo > Sent: Friday, April 10, 2020 12:30 AM > To: dts@dpdk.org > Cc: root ; Chen@dpdk.org; Chen, BoX C > > Subject: [dts] [PATCH V1] tests/Kernelpf_iavf: add support i40e >=20 > From: root >=20 > add i40e drive support >=20 > Signed-off-by: Chen, Bo > --- > tests/TestSuite_kernelpf_iavf.py | 113 ++++++++++++++++++++++++++++--- > 1 file changed, 103 insertions(+), 10 deletions(-) >=20 > diff --git a/tests/TestSuite_kernelpf_iavf.py > b/tests/TestSuite_kernelpf_iavf.py > index d5b2c7b..e1832d3 100644 > --- a/tests/TestSuite_kernelpf_iavf.py > +++ b/tests/TestSuite_kernelpf_iavf.py > @@ -171,10 +171,21 @@ class TestKernelpfIavf(TestCase): > except Exception as e: > self.destroy_vm_env() > raise Exception(e) > - > + netdev =3D self.dut.ports_info[0]['port'] > + nic_drive =3D netdev.get_nic_driver() > + if nic_drive =3D=3D "i40e": > + self.vm_dut.send_expect("sed -i > '/{ RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, > IAVF_DEV_ID_ADAPTIVE_VF) },/a { RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, > IAVF_DEV_ID_VF) },' drivers/net/iavf/iavf_ethdev.c", "# ") > + self.vm_dut.send_expect("sed -i -e > '/I40E_DEV_ID_VF/s/0x154C/0x164C/g' > drivers/net/i40e/base/i40e_devids.h", "# ") > + self.vm_dut.build_install_dpdk(self.target) > self.env_done =3D True >=20 > def destroy_vm_env(self): > + netdev =3D self.dut.ports_info[0]['port'] > + nic_drive =3D netdev.get_nic_driver() > + if nic_drive =3D=3D "i40e": > + self.vm_dut.send_expect("sed -i > '/{ RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_VF) },/d' > drivers/net/iavf/iavf_ethdev.c", "# ") > + self.vm_dut.send_expect("sed -i -e > '/I40E_DEV_ID_VF/s/0x164C/0x154C/g' > drivers/net/i40e/base/i40e_devids.h", "# ") > + self.vm_dut.build_install_dpdk(self.target) > if getattr(self, 'vm', None): > if getattr(self, 'vm_dut', None): > self.vm_dut.kill_all() > @@ -502,23 +513,58 @@ class TestKernelpfIavf(TestCase): > def test_vf_vlan_strip(self): > random_vlan =3D random.randint(1, MAX_VLAN) > self.vm_testpmd.start_testpmd("all") > + self.vm_testpmd.execute_cmd("port stop all") > + self.vm_testpmd.execute_cmd("vlan set filter off 0") > + self.vm_testpmd.execute_cmd("vlan set strip off 0") > self.vm_testpmd.execute_cmd("vlan set strip on 0") > + self.vm_testpmd.execute_cmd("port start all") > self.vm_testpmd.execute_cmd("set fwd mac") > self.vm_testpmd.execute_cmd("set verbose 1") > self.vm_testpmd.execute_cmd("start") > self.start_tcpdump(self.tester_intf) > - out =3D self.send_and_getout(vlan=3Drandom_vlan, pkt_type=3D"VLA= N_UDP") > + self.send_and_getout(vlan=3Drandom_vlan, pkt_type=3D"VLAN_UDP") > tcpdump_out =3D self.get_tcpdump_package() > receive_pkt =3D re.findall('vlan %s' % random_vlan, tcpdump_out) > self.verify(len(receive_pkt) =3D=3D 1, 'Failed to received vlan = packet!!!') >=20 > # disable strip > self.vm_testpmd.execute_cmd("vlan set strip off 0") > - if self.nic.startswith('columbiaville'): > - self.vm_testpmd.execute_cmd("vlan set filter on 0") > - self.vm_testpmd.execute_cmd("rx_vlan add %d 0" % random_vlan= ) > self.start_tcpdump(self.tester_intf) > + self.send_and_getout(vlan=3Drandom_vlan, pkt_type=3D"VLAN_UDP") > + tcpdump_out =3D self.get_tcpdump_package() > + receive_pkt =3D re.findall('vlan %s' % random_vlan, tcpdump_out) > + self.verify(len(receive_pkt) =3D=3D 2, 'Failed to not received v= lan > + packet!!!') > + > + def test_vf_vlan_filter(self): > + random_vlan =3D random.randint(2, MAX_VLAN) > + self.vm_testpmd.start_testpmd("all") > + self.vm_testpmd.execute_cmd("port stop all") > + self.vm_testpmd.execute_cmd("set promisc all off") > + self.vm_testpmd.execute_cmd("vlan set filter on 0") > + self.vm_testpmd.execute_cmd("rx_vlan add %d 0" % random_vlan) > + self.vm_testpmd.execute_cmd("vlan set strip on 0") > + self.vm_testpmd.execute_cmd("vlan set strip off 0") > + self.vm_testpmd.execute_cmd("port start all") > + self.vm_testpmd.execute_cmd("set fwd mac") > + self.vm_testpmd.execute_cmd("set verbose 1") > + self.vm_testpmd.execute_cmd("start") > + > + # error vlan id > + out =3D self.send_and_getout(vlan=3Drandom_vlan - 1, > pkt_type=3D"VLAN_UDP") > + receive_pkt =3D re.findall('received 1 packets', out) > + self.verify(len(receive_pkt) =3D=3D 0, 'Failed error received vl= an > + packet!') > + > + # passed vlan id > out =3D self.send_and_getout(vlan=3Drandom_vlan, pkt_type=3D"VLA= N_UDP") > + receive_pkt =3D re.findall('received 1 packets', out) > + self.verify(len(receive_pkt) =3D=3D 1, 'Failed pass received vla= n > + packet!') > + > + # disable filter > + self.vm_testpmd.execute_cmd("rx_vlan rm %d 0" % random_vlan) > + self.vm_testpmd.execute_cmd("vlan set filter off 0") > + self.start_tcpdump(self.tester_intf) > + self.send_and_getout(vlan=3Drandom_vlan, pkt_type=3D"VLAN_UDP") > + time.sleep(1) > tcpdump_out =3D self.get_tcpdump_package() > receive_pkt =3D re.findall('vlan %s' % random_vlan, tcpdump_out) > self.verify(len(receive_pkt) =3D=3D 2, 'Failed to received vlan = packet!!!') @@ - > 741,6 +787,7 @@ class TestKernelpfIavf(TestCase): > time.sleep(2) >=20 > def get_tcpdump_package(self): > + time.sleep(1) > self.tester.send_expect("killall tcpdump", "#") > return self.tester.send_expect("tcpdump -A -nn -e -vv -r > getPackageByTcpdump.cap", "#") >=20 > @@ -841,7 +888,48 @@ class TestKernelpfIavf(TestCase): > time.sleep(1) > self.destroy_2vf_in_2pf() >=20 > - def scapy_send_packet(self, mac, testinterface, count=3D1): > + def test_vf_unicast(self): > + self.vm_testpmd.start_testpmd("all") > + self.vm_testpmd.execute_cmd('set verbose 1') > + self.vm_testpmd.execute_cmd('set fwd mac') > + self.vm_testpmd.execute_cmd("set promisc all off") > + self.vm_testpmd.execute_cmd("set allmulti all off") > + self.vm_testpmd.execute_cmd('set fwd mac') > + self.vm_testpmd.execute_cmd("start") > + self.scapy_send_packet(self.wrong_mac, self.tester_intf, count= =3D10) > + out =3D self.vm_dut.get_session_output() > + packets =3D len(re.findall('received 1 packets', out)) > + self.verify(packets =3D=3D 0, "Not receive expected packet") > + > + self.scapy_send_packet(self.vf_mac, self.tester_intf, count=3D10= ) > + out =3D self.vm_dut.get_session_output() > + packets =3D len(re.findall('received 1 packets', out)) > + self.verify(packets =3D=3D 10, "Not receive expected packet") > + > + def test_vf_vlan_promisc(self): > + self.vm_testpmd.start_testpmd("all") > + self.vm_testpmd.execute_cmd("port stop all") > + self.vm_testpmd.execute_cmd("set promisc all on") > + self.vm_testpmd.execute_cmd("set fwd mac") > + self.vm_testpmd.execute_cmd("set verbose 1") > + self.vm_testpmd.execute_cmd("vlan set filter off 0") > + self.vm_testpmd.execute_cmd("vlan set strip off 0") > + self.vm_testpmd.execute_cmd("port start all") > + self.vm_testpmd.execute_cmd("start") > + > + # send 10 tagged packets, and check 10 tagged packets received > + self.scapy_send_packet(self.vf_mac, self.tester_intf, vlan_flags= =3DTrue, > count=3D10) > + out =3D self.vm_dut.get_session_output() > + packets =3D len(re.findall('received 1 packets', out)) > + self.verify(packets =3D=3D 10, "Not receive expected packet") > + > + # send 10 untagged packets, and check 10 untagged packets receiv= ed > + self.scapy_send_packet(self.vf_mac, self.tester_intf, count=3D10= ) > + out =3D self.vm_dut.get_session_output() > + packets =3D len(re.findall('received 1 packets', out)) > + self.verify(packets =3D=3D 10, "Not receive expected packet") > + > + def scapy_send_packet(self, mac, testinterface, vlan_flags=3DFalse, > count=3D1): > """ > Send a packet to port > """ > @@ -850,10 +938,15 @@ class TestKernelpfIavf(TestCase): > 'sendp([Ether(dst=3D"%s")/IP()/UDP()/'\ > 'Raw(\'X\'*18)], iface=3D"%s")' % (mac, testinte= rface)) > else: > - for i in range(16): > - self.tester.scapy_append( > - 'sendp([Ether(dst=3D"%s")/IP(dst=3D"127.0.0.%d")/UDP= ()/'\ > - 'Raw(\'X\'*18)], iface=3D"%s")' % (mac, i, t= estinterface)) > + for i in range(count): > + if vlan_flags: > + self.tester.scapy_append( > + 'sendp([Ether(dst=3D"%s")/Dot1Q(id=3D0x8100, > vlan=3D100)/IP(dst=3D"127.0.0.%d")/UDP()/Raw(\'X\'*18)], ' > + 'iface=3D"%s")' % (mac, i, testinterface)) > + else: > + self.tester.scapy_append( > + > 'sendp([Ether(dst=3D"%s")/IP(dst=3D"127.0.0.%d")/UDP()/Raw(\'X\'*18)], ' > + 'iface=3D"%s")' % (mac, i, testinterface)) > self.tester.scapy_execute() >=20 > def create_2vf_in_host(self, driver=3D''): > -- > 2.18.2