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 7546FA00E6 for ; Tue, 6 Aug 2019 12:11:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 47AF21BE3A; Tue, 6 Aug 2019 12:11:51 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 6E15E1BE31 for ; Tue, 6 Aug 2019 12:11:49 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2019 03:11:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,353,1559545200"; d="scan'208";a="168255538" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga008.jf.intel.com with ESMTP; 06 Aug 2019 03:11:48 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 6 Aug 2019 03:11:47 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 6 Aug 2019 03:11:47 -0700 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 6 Aug 2019 03:11:47 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.80]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.15]) with mapi id 14.03.0439.000; Tue, 6 Aug 2019 18:11:45 +0800 From: "Tu, Lijuan" To: "Zhao, HaiyangX" , "dts@dpdk.org" CC: "Lin, Xueqin" , "Zhao, HaiyangX" Thread-Topic: [dts] [PATCH V1 2/2] tests/vf_rss: optmize vf_pmdrss and vf_pmdrss_reta Thread-Index: AQHVPhsuggI/DZ4oEEyEYbDBBQye4qbuAnaA Date: Tue, 6 Aug 2019 10:11:44 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BAFD699@SHSMSX101.ccr.corp.intel.com> References: <20190719181634.10735-1-haiyangx.zhao@intel.com> <20190719181634.10735-2-haiyangx.zhao@intel.com> In-Reply-To: <20190719181634.10735-2-haiyangx.zhao@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.600.7 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTMxOTE3MmUtZjc5OC00ZjYwLThjOTctZjFhNzJkMDY0NjExIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVW91aUh6NFdjQXB6azMraDZHdjJBSHBFNVBKODRKd0tBbmVSRDk2RTNrWU05elFlYXpBa0luaHdwc3RRS3RDYiJ9 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 2/2] tests/vf_rss: optmize vf_pmdrss and vf_pmdrss_reta 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 Haiyang Zhao > Sent: Saturday, July 20, 2019 2:17 AM > To: dts@dpdk.org > Cc: Lin, Xueqin ; Zhao, HaiyangX > > Subject: [dts] [PATCH V1 2/2] tests/vf_rss: optmize vf_pmdrss and > vf_pmdrss_reta >=20 > *.increase sent packet to 128 and check every queue can > receive packet in vf_pmdrss. > *.modify iptypes and add rss config command in rss_reta. > *.modify rss reta size for different nics. > *.fix pep8 issue. >=20 > Signed-off-by: Haiyang Zhao > --- > tests/TestSuite_vf_rss.py | 110 +++++++++++++++++++++++++------------- > 1 file changed, 73 insertions(+), 37 deletions(-) >=20 > diff --git a/tests/TestSuite_vf_rss.py b/tests/TestSuite_vf_rss.py index > e5c19e2..e19a9a5 100644 > --- a/tests/TestSuite_vf_rss.py > +++ b/tests/TestSuite_vf_rss.py > @@ -46,11 +46,12 @@ from test_case import TestCase from pmd_output > import PmdOutput from virt_common import VM >=20 > + > class TestVfRss(TestCase): >=20 > supported_vf_driver =3D ['pci-stub', 'vfio-pci'] >=20 > - def send_packet(self, itf, tran_type): > + def send_packet(self, itf, tran_type, queue, packet_count=3D16): > """ > Sends packets. > """ > @@ -63,28 +64,35 @@ class TestVfRss(TestCase): > mac =3D self.vm0_testpmd.get_port_mac(0) > # send packet with different source and dest ip > if tran_type =3D=3D "ipv4-other": > - for i in range(16): > + for i in range(packet_count): > packet =3D r'sendp([Ether(dst=3D"%s", > src=3D"02:00:00:00:00:00")/IP(src=3D"192.168.0.%d", dst=3D"192.168.0.%d")= ], > iface=3D"%s")' % ( > mac, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > self.tester.scapy_execute() > time.sleep(.5) > + elif tran_type =3D=3D "ipv4-frag": > + for i in range(packet_count): > + packet =3D r'sendp([Ether(dst=3D"%s", > src=3D"02:00:00:00:00:00")/IP(src=3D"192.168.0.%d", dst=3D"192.168.0.%d",= frag=3D1, > flags=3D"MF")], iface=3D"%s")' % ( > + mac, i + 1, i + 2, itf) > + self.tester.scapy_append(packet) > + self.tester.scapy_execute() > + time.sleep(.5) > elif tran_type =3D=3D "ipv4-tcp": > - for i in range(16): > + for i in range(packet_count): > packet =3D r'sendp([Ether(dst=3D"%s", > src=3D"02:00:00:00:00:00")/IP(src=3D"192.168.0.%d", > dst=3D"192.168.0.%d")/TCP(sport=3D1024,dport=3D1024)], iface=3D"%s")' % ( > mac, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > self.tester.scapy_execute() > time.sleep(.5) > elif tran_type =3D=3D "ipv4-udp": > - for i in range(16): > + for i in range(packet_count): > packet =3D r'sendp([Ether(dst=3D"%s", > src=3D"02:00:00:00:00:00")/IP(src=3D"192.168.0.%d", > dst=3D"192.168.0.%d")/UDP(sport=3D1024,dport=3D1024)], iface=3D"%s")' % ( > mac, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > self.tester.scapy_execute() > time.sleep(.5) > elif tran_type =3D=3D "ipv4-sctp": > - for i in range(16): > + for i in range(packet_count): > packet =3D r'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.= 0.%d", > dst=3D"192.168.0.%d")/SCTP(sport=3D1024,dport=3D1025,tag=3D1)], iface=3D"= %s")' % ( > mac, i + 1, i + 2, itf) > self.tester.scapy_append(packet) @@ -94,7 +102,7 @@ clas= s > TestVfRss(TestCase): > self.tester.scapy_execute() > time.sleep(.5) > elif tran_type =3D=3D "l2_payload": > - for i in range(16): > + for i in range(packet_count): > packet =3D r'sendp([Ether(src=3D"00:00:00:00:00:%02d",ds= t=3D"%s")], > iface=3D"%s")' % ( > i + 1, mac, itf) > self.tester.scapy_append(packet) @@ -102,28 +110,35 @@ c= lass > TestVfRss(TestCase): > time.sleep(.5) >=20 > elif tran_type =3D=3D "ipv6-other": > - for i in range(16): > + for i in range(packet_count): > packet =3D r'sendp([Ether(dst=3D"%s", > src=3D"02:00:00:00:00:00")/IPv6(src=3D"3ffe:2501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d")], iface=3D"%s")' % ( > mac, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > self.tester.scapy_execute() > time.sleep(.5) > + elif tran_type =3D=3D "ipv6-frag": > + for i in range(packet_count): > + packet =3D r'sendp([Ether(dst=3D"%s", > src=3D"02:00:00:00:00:00")/IPv6(src=3D"3ffe:2501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d", nh=3D44)/IPv6ExtHdrFragment()], iface=3D"%s"= )' % ( > + mac, i + 1, i + 2, itf) > + self.tester.scapy_append(packet) > + self.tester.scapy_execute() > + time.sleep(.5) > elif tran_type =3D=3D "ipv6-tcp": > - for i in range(16): > + for i in range(packet_count): > packet =3D r'sendp([Ether(dst=3D"%s", > src=3D"02:00:00:00:00:00")/IPv6(src=3D"3ffe:2501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d")/TCP(sport=3D1024,dport=3D1024)], iface=3D"%s= ")' % ( > mac, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > self.tester.scapy_execute() > time.sleep(.5) > elif tran_type =3D=3D "ipv6-udp": > - for i in range(16): > + for i in range(packet_count): > packet =3D r'sendp([Ether(dst=3D"%s", > src=3D"02:00:00:00:00:00")/IPv6(src=3D"3ffe:2501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d")/UDP(sport=3D1024,dport=3D1024)], iface=3D"%s= ")' % ( > mac, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > self.tester.scapy_execute() > time.sleep(.5) > elif tran_type =3D=3D "ipv6-sctp": > - for i in range(16): > + for i in range(packet_count): > packet =3D r'sendp([Ether(dst=3D"%s")/IPv6(src=3D"3ffe:2= 501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d", nh=3D132)/SCTP(sport=3D1024,dport=3D1025,tag= =3D1)], > iface=3D"%s")' % ( > mac, i + 1, i + 2, itf) > self.tester.scapy_append(packet) @@ -136,13 +151,14 @@ c= lass > TestVfRss(TestCase): > else: > print "\ntran_type error!\n" >=20 > - #out =3D self.vm_dut_0.send_expect("stop", "testpmd>") > out =3D self.vm_dut_0.get_session_output() > print '*******************************************' > print out > - if not reta_entries: > - self.verify('RSS hash=3D' in out, 'rss faied') > - return > + if not reta_entries: > + # for test_vfpmd_rss, check every queue can receive packet. > + for i in range(queue): > + self.verify('RSS queue=3D{}'.format(hex(i)) in out, 'que= ue {} did not > receive packets'.format(i)) > + return > lines =3D out.split("\r\n") > out =3D '' > reta_line =3D {} > @@ -153,13 +169,12 @@ class TestVfRss(TestCase): > if len(line) !=3D 0 and line.startswith(("src=3D",)): > for item in line.split("-"): > item =3D item.strip() > - if(item.startswith("RSS hash")): > + if item.startswith("RSS hash"): > name, value =3D item.split("=3D", 1) > print name + "-" + value > - > - reta_line[name.strip()] =3D value.strip() > - reta_lines.append(reta_line) > - reta_line =3D {} > + reta_line[name.strip()] =3D value.strip() > + reta_lines.append(reta_line) > + reta_line =3D {} > elif len(line) !=3D 0 and line.strip().startswith("port "): > rexp =3D r"port (\d)/queue (\d{1,2}): received (\d) pack= ets" > m =3D re.match(rexp, line.strip()) @@ -171,7 +186,6 @@ c= lass > TestVfRss(TestCase): > else: > pass > self.verifyResult() > - >=20 > def verifyResult(self): > """ > @@ -184,15 +198,19 @@ class TestVfRss(TestCase): > ['packet index', 'hash value', 'hash index', 'queue id', 'ac= tual queue id', > 'pass ']) >=20 > i =3D 0 > + self.verify(len(reta_lines) > 0, "The testpmd output has no RSS > + hash!") > for tmp_reta_line in reta_lines: > status =3D "false" > if self.kdriver =3D=3D "fm10k": > # compute the hash result of five tuple into the 7 LSBs = value. > hash_index =3D int(tmp_reta_line["RSS hash"], 16) % 128 > - else: > + elif self.kdriver =3D=3D 'i40e' or self.nic in ['sageville',= 'sagepond']: > # compute the hash result of five tuple into the 7 LSBs = value. > + hash_index =3D int(tmp_reta_line["RSS hash"], 16) % 64 > + else: > hash_index =3D int(tmp_reta_line["RSS hash"], 16) % 512 > - if(reta_entries[hash_index] =3D=3D int(tmp_reta_line["queue"= ])): > + > + if reta_entries[hash_index] =3D=3D int(tmp_reta_line["queue"= ]): > status =3D "true" > result.insert(i, 0) > else: > @@ -212,7 +230,8 @@ class TestVfRss(TestCase): > """ >=20 > self.verify( > - self.nic in ["niantic", "fortville_eagle", "fortville_spirit= ", > "fortville_spirit_single", "fortville_25g", "sageville", "fortpark_TLV"], > + self.nic in ["redrockcanyou", "atwood", "boulderrapid", > "fortville_eagle", "fortville_spirit", > + "fortville_spirit_single", "fortville_25g", > + "sageville", "sagepond", "fortpark_TLV"], > "NIC Unsupported: " + str(self.nic)) > self.dut_ports =3D self.dut.get_ports(self.nic) > self.verify(len(self.dut_ports) >=3D 1, "Not enough ports availa= ble") @@ - > 237,6 +256,7 @@ class TestVfRss(TestCase): > Run before each test case. > """ > pass > + > def setup_1pf_1vf_1vm_env(self, driver=3D'default'): >=20 > self.used_dut_port_0 =3D self.dut_ports[0] @@ -244,7 +264,6 @@ c= lass > TestVfRss(TestCase): > self.sriov_vfs_port_0 =3D > self.dut.ports_info[self.used_dut_port_0]['vfs_port'] >=20 > try: > - > for port in self.sriov_vfs_port_0: > port.bind_driver(self.vf_driver) >=20 > @@ -254,7 +273,7 @@ class TestVfRss(TestCase): > if driver =3D=3D 'igb_uio': > # start testpmd without the two VFs on the host > self.host_testpmd =3D PmdOutput(self.dut) > - eal_param =3D '-b %(vf0)s -b %(vf1)s' % {'vf0': > self.sriov_vfs_port_0[0].pci} > + eal_param =3D '-b %(vf0)s ' % {'vf0': > + self.sriov_vfs_port_0[0].pci} > self.host_testpmd.start_testpmd("1S/2C/2T", > eal_param=3Deal_param) >=20 > # set up VM0 ENV > @@ -301,15 +320,23 @@ class TestVfRss(TestCase): >=20 > def test_vf_pmdrss_reta(self): >=20 > - # niantic kernel host driver not support this case > - if self.nic is 'niantic' and not self.host_testpmd: > - self.logger.warning("niantic kernel host driver not support = this case") > - return > vm0dutPorts =3D self.vm_dut_0.get_ports('any') > localPort =3D self.tester.get_local_port(vm0dutPorts[0]) > itf =3D self.tester.get_interface(localPort) > self.vm0_ports_socket =3D self.vm_dut_0.get_numa_id(vm0dutPorts[= 0]) > - iptypes =3D ['IPV4'] > + iptypes =3D { > + 'ipv4-other': 'ip', > + 'ipv4-frag': 'ip', > + 'ipv4-udp': 'udp', > + 'ipv4-tcp': 'tcp', > + 'ipv4-sctp': 'sctp', > + 'ipv6-other': 'ip', > + 'ipv6-frag': 'ip', > + 'ipv6-udp': 'udp', > + 'ipv6-tcp': 'tcp', > + 'ipv6-sctp': 'sctp', > + # 'l2_payload': 'ether' > + } >=20 > self.vm_dut_0.kill_all() >=20 > @@ -320,33 +347,42 @@ class TestVfRss(TestCase): > self.vm0_testpmd.start_testpmd( > "all", "--rxq=3D%d --txq=3D%d %s" % (queue, queue, eal_p= aram), > socket=3Dself.vm0_ports_socket) >=20 > - for iptype in iptypes: > + for iptype, rss_type in iptypes.items(): > self.vm_dut_0.send_expect("set verbose 8", "testpmd> ") > self.vm_dut_0.send_expect("set fwd rxonly", "testpmd> ") > self.vm_dut_0.send_expect( > "set nbcore %d" % (queue + 1), "testpmd> ") >=20 > # configure the reta with specific mappings. > - if(self.nic in ["niantic", "redrockcanyou", "atwood", > "boulderrapid"]): > + if self.nic in ["redrockcanyou", "atwood", "boulderrapid= "]: > for i in range(128): > reta_entries.insert(i, random.randint(0, queue -= 1)) > self.vm_dut_0.send_expect( > "port config 0 rss reta (%d,%d)" % (i, reta_= entries[i]), > "testpmd> ") > + self.vm_dut_0.send_expect("port config all rss %s" %= rss_type, > "testpmd> ") > + elif self.kdriver =3D=3D 'i40e' or self.nic in ['sagevil= le', 'sagepond']: > + for i in range(64): > + reta_entries.insert(i, random.randint(0, queue -= 1)) > + self.vm_dut_0.send_expect( > + "port config 0 rss reta (%d,%d)" % (i, reta_= entries[i]), > "testpmd> ") > + self.vm_dut_0.send_expect("port config all rss %s" > + % rss_type, "testpmd> ") > else: > for i in range(512): > reta_entries.insert(i, random.randint(0, queue -= 1)) > self.vm_dut_0.send_expect( > "port config 0 rss reta (%d,%d)" % (i, reta_= entries[i]), > "testpmd> ") > + self.vm_dut_0.send_expect("port config all rss %s" > + % rss_type, "testpmd> ") >=20 > - self.send_packet(itf, iptype) > + self.send_packet(itf, iptype, queue) >=20 > self.vm_dut_0.send_expect("quit", "# ", 30) > + > def test_vf_pmdrss(self): > vm0dutPorts =3D self.vm_dut_0.get_ports('any') > localPort =3D self.tester.get_local_port(vm0dutPorts[0]) > itf =3D self.tester.get_interface(localPort) > self.vm0_ports_socket =3D self.vm_dut_0.get_numa_id(vm0dutPorts[= 0]) > - iptypes =3D {'ipv4-sctp':'ip', > + iptypes =3D { > 'ipv4-other':'ip', > 'ipv4-udp':'udp', > 'ipv4-tcp':'tcp', > @@ -367,7 +403,7 @@ class TestVfRss(TestCase): > self.vm0_testpmd.start_testpmd( > "all", "--rxq=3D%d --txq=3D%d %s" % (queue, queue, eal_p= aram), > socket=3Dself.vm0_ports_socket) >=20 > - for iptype,rsstype in iptypes.items(): > + for iptype, rsstype in iptypes.items(): > self.vm_dut_0.send_expect("set verbose 8", "testpmd> ") > self.vm_dut_0.send_expect("set fwd rxonly", "testpmd> ") > out =3D self.vm_dut_0.send_expect("port config all rss %= s" % rsstype, > "testpmd> ") @@ -375,9 +411,9 @@ class TestVfRss(TestCase): > self.vm_dut_0.send_expect( > "set nbcore %d" % (queue + 1), "testpmd> ") >=20 > - self.send_packet(itf, iptype) > - > + self.send_packet(itf, iptype, queue, 128) > self.vm_dut_0.send_expect("quit", "# ", 30) > + > def tear_down(self): > """ > Run after each test case. > -- > 2.17.1