From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 1049D1B142 for ; Wed, 30 Jan 2019 04:07:44 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jan 2019 19:07:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,539,1539673200"; d="scan'208";a="130010529" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga002.jf.intel.com with ESMTP; 29 Jan 2019 19:07:44 -0800 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 29 Jan 2019 19:07:43 -0800 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 29 Jan 2019 19:07:42 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.162]) with mapi id 14.03.0415.000; Wed, 30 Jan 2019 11:07:40 +0800 From: "Tu, Lijuan" To: "Peng, Yuan" , "dts@dpdk.org" CC: "Peng, Yuan" Thread-Topic: [dts] [PATCH v2] tests: add check items for symmetric cases Thread-Index: AQHUsubvPeEYALvLUEGDVEvWbKW99aXHLBRA Date: Wed, 30 Jan 2019 03:07:40 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BA1EC4A@SHSMSX101.ccr.corp.intel.com> References: <1548225976-22823-1-git-send-email-yuan.peng@intel.com> In-Reply-To: <1548225976-22823-1-git-send-email-yuan.peng@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.400.15 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDQxYjYyOTEtZWQ0MS00NDUxLWI3NzItMjQ1YjA0YWFhMDNlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidExTSW40S3dobVlrcmw2Y1BGYUlKY3pPVFRCZEVVd3hLd3NUTVp0Z29UajI5ejhsUHFoUmpkbjVRQ0pmOG5qWiJ9 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 v2] tests: add check items for symmetric cases 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 Jan 2019 03:07:45 -0000 Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Peng Yuan > Sent: Wednesday, January 23, 2019 2:46 PM > To: dts@dpdk.org > Cc: Peng, Yuan > Subject: [dts] [PATCH v2] tests: add check items for symmetric cases >=20 > Add check items for symmetric cases of TestSuite_pmdrss_hash.py >=20 > Signed-off-by: Peng Yuan >=20 > diff --git a/tests/TestSuite_pmdrss_hash.py b/tests/TestSuite_pmdrss_hash= .py > index 07c47b4..60c9819 100644 > --- a/tests/TestSuite_pmdrss_hash.py > +++ b/tests/TestSuite_pmdrss_hash.py > @@ -41,9 +41,23 @@ import random > import re > import utils >=20 > -testQueues =3D [16] > +queue =3D 16 > reta_entries =3D [] > reta_num =3D 128 > +iptypes =3D {'ipv4-sctp': 'sctp', > + 'ipv4-other': 'ip', > + 'ipv4-frag': 'ip', > + 'ipv4-udp': 'udp', > + 'ipv4-tcp': 'tcp', > + # this hash not support in dpdk2.0 > + # 'l2_payload':'ether', > + 'ipv6-other': 'ip', > + 'ipv6-sctp': 'sctp', > + 'ipv6-udp': 'udp', > + 'ipv6-tcp': 'tcp', > + 'ipv6-frag': 'ip' > + } > + > # Use scapy to send packets with different source and dest ip. > # and collect the hash result of five tuple and the queue id. > from test_case import TestCase > @@ -389,19 +403,23 @@ class TestPmdrssHash(TestCase): >=20 > i =3D 0 > for tmp_reta_line in reta_lines: > - status =3D "true" > + status =3D "false" > # compute the hash result of five tuple into the 7 LSBs valu= e. > hash_index =3D int(tmp_reta_line["RSS hash"], 16) % reta_num > - > - if(i % 2 =3D=3D 1): > - if(pre_RSS_hash =3D=3D tmp_reta_line["RSS hash"]): > - status =3D "true" > - result.insert((i - 1) / 2, 0) > - else: > - status =3D "fail" > - result.insert((i - 1) / 2, 1) > - pre_RSS_hash =3D tmp_reta_line["RSS hash"] > - > + if(reta_entries[hash_index] =3D=3D int(tmp_reta_line["queue"= ])): > + status =3D "true" > + result.insert(i, 0) > + if(i % 2 =3D=3D 1): > + if(pre_RSS_hash =3D=3D tmp_reta_line["RSS hash"]): > + status =3D "true" > + result.insert(len(reta_lines) + (i - 1) / 2, 0) > + else: > + status =3D "fail" > + result.insert(len(reta_lines) + (i - 1) / 2, 1) > + pre_RSS_hash =3D tmp_reta_line["RSS hash"] > + else: > + status =3D "fail" > + result.insert(i, 1) > self.result_table_add( > [i, tmp_reta_line["RSS hash"], hash_index, reta_entries[= hash_index], > tmp_reta_line["queue"], status]) > i =3D i + 1 > @@ -417,19 +435,30 @@ class TestPmdrssHash(TestCase): >=20 > self.verify(self.nic in ["fortville_eagle", "fortville_spirit", > "fortville_spirit_single", "redrockcanyou", "atwood"= , > - "boulderrapid", "fortpark_TLV", "fortville_25g"], > + "boulderrapid", "fortpark_TLV", "fortville_25g", > + "niantic"], > "NIC Unsupported: " + str(self.nic)) > global reta_num > + global iptypes > + > if self.nic in ["fortville_eagle", "fortville_spirit", "fortvill= e_spirit_single", > "fortpark_TLV", "fortville_25g"]: > reta_num =3D 512 > elif self.nic in ["niantic"]: > reta_num =3D 128 > + iptypes =3D {'ipv4-other': 'ip', > + 'ipv4-frag': 'ip', > + 'ipv4-udp': 'udp', > + 'ipv4-tcp': 'tcp', > + 'ipv6-other': 'ip', > + 'ipv6-udp': 'udp', > + 'ipv6-tcp': 'tcp', > + 'ipv6-frag': 'ip' > + } > elif self.nic in ["redrockcanyou", "atwood", "boulderrapid"]: > reta_num =3D 128 > else: > self.verify(False, "NIC Unsupported:%s" % str(self.nic)) > ports =3D self.dut.get_ports(self.nic) > - self.verify(len(ports) >=3D 2, "Not enough ports available") > + self.verify(len(ports) >=3D 1, "Not enough ports available") >=20 > def set_up(self): > """ > @@ -442,49 +471,35 @@ class TestPmdrssHash(TestCase): > localPort =3D self.tester.get_local_port(dutPorts[0]) > itf =3D self.tester.get_interface(localPort) > global reta_num > - iptypes =3D {'ipv4-sctp': 'sctp', > - 'ipv4-other': 'ip', > - 'ipv4-frag': 'ip', > - 'ipv4-udp': 'udp', > - 'ipv4-tcp': 'tcp', > - # this hash not support in dpdk2.0 > - # 'l2_payload':'ether', > - 'ipv6-other': 'ip', > - 'ipv6-sctp': 'sctp', > - 'ipv6-udp': 'udp', > - 'ipv6-tcp': 'tcp', > - 'ipv6-frag': 'ip' > - } > + global iptypes >=20 > self.dut.kill_all() >=20 > # test with different rss queues > - for queue in testQueues: > + self.dut.send_expect( > + "./%s/app/testpmd -c fffff -n %d -- -i --coremask=3D0xffffe= --rxq=3D%d -- > txq=3D%d" % > + (self.target, self.dut.get_memory_channels(), queue, > + queue), "testpmd> ", 120) > + > + for iptype, rsstype in iptypes.items(): > + self.dut.send_expect("set verbose 8", "testpmd> ") > + self.dut.send_expect("set fwd rxonly", "testpmd> ") > self.dut.send_expect( > - "./%s/app/testpmd -c fffff -n %d -- -i --coremask=3D0xf= fffe --rxq=3D%d -- > txq=3D%d" % > - (self.target, self.dut.get_memory_channels(), queue, que= ue), "testpmd> > ", 120) > + "set nbcore %d" % (queue + 1), "testpmd> ") >=20 > - for iptype, rsstype in iptypes.items(): > - self.dut.send_expect("set verbose 8", "testpmd> ") > - self.dut.send_expect("set fwd rxonly", "testpmd> ") > + self.dut.send_expect("port stop all", "testpmd> ") > + self.dut.send_expect( > + "set_hash_global_config 0 toeplitz %s enable" % iptype,= "testpmd> ") > + self.dut.send_expect("port start all", "testpmd> ") > + out =3D self.dut.send_expect( > + "port config all rss %s" % rsstype, "testpmd> ") > + self.verify("error" not in out, "Configuration of RSS hash f= ailed: Invalid > argument") > + # configure the reta with specific mappings. > + for i in range(reta_num): > + reta_entries.insert(i, random.randint(0, queue - 1)) > self.dut.send_expect( > - "set nbcore %d" % (queue + 1), "testpmd> ") > + "port config 0 rss reta (%d,%d)" % (i, > + reta_entries[i]), "testpmd> ") >=20 > - self.dut.send_expect("port stop all", "testpmd> ") > - # self.dut.send_expect("port config all rss ip", "testpm= d> ") > - self.dut.send_expect( > - "set_hash_global_config 0 toeplitz %s enable" % ipt= ype, "testpmd> > ") > - self.dut.send_expect("port start all", "testpmd> ") > - out =3D self.dut.send_expect( > - "port config all rss %s" % rsstype, "testpmd> ") > - self.verify("error" not in out, "Configuration of RSS ha= sh failed: Invalid > argument") > - # configure the reta with specific mappings. > - for i in range(reta_num): > - reta_entries.insert(i, random.randint(0, queue - 1)) > - self.dut.send_expect( > - "port config 0 rss reta (%d,%d)" % (i, reta_entr= ies[i]), "testpmd> ") > - > - self.send_packet(itf, iptype) > + self.send_packet(itf, iptype) >=20 > self.dut.send_expect("quit", "# ", 30) >=20 > @@ -493,72 +508,48 @@ class TestPmdrssHash(TestCase): > localPort =3D self.tester.get_local_port(dutPorts[0]) > itf =3D self.tester.get_interface(localPort) > global reta_num > - iptypes =3D {'ipv4-sctp': 'sctp', > - 'ipv4-other': 'ip', > - 'ipv4-frag': 'ip', > - 'ipv4-udp': 'udp', > - 'ipv4-tcp': 'tcp', > - # this hash not support in dpdk2.0 > - # 'l2_payload':'ether', > - 'ipv6-other': 'ip', > - 'ipv6-sctp': 'sctp', > - 'ipv6-udp': 'udp', > - 'ipv6-tcp': 'tcp', > - 'ipv6-frag': 'ip' > - } > + global iptypes >=20 > self.dut.kill_all() >=20 > # test with different rss queues > - for queue in testQueues: > - self.dut.send_expect( > - "./%s/app/testpmd -c fffff -n %d -- -i --coremask=3D0xf= fffe --rxq=3D%d -- > txq=3D%d" % > - (self.target, self.dut.get_memory_channels(), queue, que= ue), "testpmd> > ", 120) > + self.dut.send_expect( > + "./%s/app/testpmd -c fffff -n %d -- -i --coremask=3D0xffffe= --rxq=3D%d -- > txq=3D%d" % > + (self.target, self.dut.get_memory_channels(), queue, > + queue), "testpmd> ", 120) >=20 > - for iptype, rsstype in iptypes.items(): > - self.dut.send_expect("set verbose 8", "testpmd> ") > - self.dut.send_expect("set fwd rxonly", "testpmd> ") > - self.dut.send_expect( > - "set nbcore %d" % (queue + 1), "testpmd> ") > + for iptype, rsstype in iptypes.items(): > + self.dut.send_expect("set verbose 8", "testpmd> ") > + self.dut.send_expect("set fwd rxonly", "testpmd> ") > + self.dut.send_expect( > + "set nbcore %d" % (queue + 1), "testpmd> ") >=20 > - self.dut.send_expect("port stop all", "testpmd> ") > - self.dut.send_expect( > - "set_hash_global_config 0 toeplitz %s enable" % ipty= pe, "testpmd> ") > + self.dut.send_expect("port stop all", "testpmd> ") > + self.dut.send_expect( > + "set_hash_global_config 0 toeplitz %s enable" % iptype, = "testpmd> ") > + self.dut.send_expect( > + "set_sym_hash_ena_per_port 0 enable", "testpmd> ") > + self.dut.send_expect("port start all", "testpmd> ") > + out =3D self.dut.send_expect( > + "port config all rss %s" % rsstype, "testpmd> ") > + self.verify("error" not in out, "Configuration of RSS hash > + failed: Invalid argument") > + > + # configure the reta with specific mappings. > + for i in range(reta_num): > + reta_entries.insert(i, random.randint(0, queue - 1)) > self.dut.send_expect( > - "set_sym_hash_ena_per_port 0 enable", "testpmd> ") > - self.dut.send_expect("port start all", "testpmd> ") > - out =3D self.dut.send_expect( > - "port config all rss %s" % rsstype, "testpmd> ") > - self.verify("error" not in out, "Configuration of RSS ha= sh failed: Invalid > argument") > + "port config 0 rss reta (%d,%d)" % (i, > + reta_entries[i]), "testpmd> ") >=20 > - # configure the reta with specific mappings. > - for i in range(reta_num): > - reta_entries.insert(i, random.randint(0, queue - 1)) > - self.dut.send_expect( > - "port config 0 rss reta (%d,%d)" % (i, reta_entr= ies[i]), "testpmd> ") > + self.send_packet_symmetric(itf, iptype) >=20 > - self.send_packet_symmetric(itf, iptype) > - > - self.dut.send_expect("quit", "# ", 30) > + self.dut.send_expect("quit", "# ", 30) >=20 > def test_simple(self): > dutPorts =3D self.dut.get_ports(self.nic) > localPort =3D self.tester.get_local_port(dutPorts[0]) > itf =3D self.tester.get_interface(localPort) > global reta_num > - iptypes =3D {'ipv4-sctp': 'sctp', > - 'ipv4-other': 'ip', > - 'ipv4-frag': 'ip', > - 'ipv4-udp': 'udp', > - 'ipv4-tcp': 'tcp', > - # this hass not support in dpdk 2.0 > - # 'l2_payload':'ether', > - 'ipv6-other': 'ip', > - 'ipv6-sctp': 'sctp', > - 'ipv6-udp': 'udp', > - 'ipv6-tcp': 'tcp', > - 'ipv6-frag': 'ip' > - } > + global iptypes > + > if self.kdriver in ["fm10k"]: > iptypes.pop('ipv4-sctp') > iptypes.pop('ipv6-sctp') > @@ -566,36 +557,34 @@ class TestPmdrssHash(TestCase): > self.dut.kill_all() >=20 > # test with different rss queues > - for queue in testQueues: > + self.dut.send_expect( > + "./%s/app/testpmd -c fffff -n %d -- -i --coremask=3D0xffffe= --rxq=3D%d -- > txq=3D%d" % > + (self.target, self.dut.get_memory_channels(), queue, > + queue), "testpmd> ", 120) > + > + for iptype, rsstype in iptypes.items(): > + self.logger.info("***********************%s rss > test********************************" % iptype) > + self.dut.send_expect("set verbose 8", "testpmd> ") > + self.dut.send_expect("set fwd rxonly", "testpmd> ") > self.dut.send_expect( > - "./%s/app/testpmd -c fffff -n %d -- -i --coremask=3D0xf= fffe --rxq=3D%d -- > txq=3D%d" % > - (self.target, self.dut.get_memory_channels(), queue, que= ue), "testpmd> > ", 120) > + "set nbcore %d" % (queue + 1), "testpmd> ") >=20 > - for iptype, rsstype in iptypes.items(): > - self.logger.info("***********************%s rss > test********************************" % iptype) > - self.dut.send_expect("set verbose 8", "testpmd> ") > - self.dut.send_expect("set fwd rxonly", "testpmd> ") > + self.dut.send_expect("port stop all", "testpmd> ") > + # some nic not support change hash algorithm > + if self.kdriver not in ["fm10k"]: > + self.dut.send_expect( > + "set_hash_global_config 0 simple_xor %s enable" % ip= type, > "testpmd> ") > + self.dut.send_expect("port start all", "testpmd> ") > + out =3D self.dut.send_expect( > + "port config all rss %s" % rsstype, "testpmd> ") > + self.verify("error" not in out, "Configuration of RSS hash f= ailed: Invalid > argument") > + # configure the reta with specific mappings. > + for i in range(reta_num): > + reta_entries.insert(i, random.randint(0, queue - 1)) > self.dut.send_expect( > - "set nbcore %d" % (queue + 1), "testpmd> ") > - > - self.dut.send_expect("port stop all", "testpmd> ") > - # some nic not support change hash algorithm > - if self.kdriver not in ["fm10k"]: > - self.dut.send_expect( > - "set_hash_global_config 0 simple_xor %s enable" = % iptype, > "testpmd> ") > - self.dut.send_expect("port start all", "testpmd> ") > - out =3D self.dut.send_expect( > - "port config all rss %s" % rsstype, "testpmd> ") > - self.verify("error" not in out, "Configuration of RSS ha= sh failed: Invalid > argument") > - # configure the reta with specific mappings. > - for i in range(reta_num): > - reta_entries.insert(i, random.randint(0, queue - 1)) > - self.dut.send_expect( > - "port config 0 rss reta (%d,%d)" % (i, reta_entr= ies[i]), "testpmd> ") > - > - self.send_packet(itf, iptype) > - > - self.dut.send_expect("quit", "# ", 30) > + "port config 0 rss reta (%d,%d)" % (i, reta_entries[= i]), "testpmd> ") > + self.send_packet(itf, iptype) > + > + self.dut.send_expect("quit", "# ", 30) >=20 > def test_simple_symmetric(self): >=20 > @@ -603,57 +592,46 @@ class TestPmdrssHash(TestCase): > localPort =3D self.tester.get_local_port(dutPorts[0]) > itf =3D self.tester.get_interface(localPort) > global reta_num > - iptypes =3D {'ipv4-sctp': 'sctp', > - 'ipv4-other': 'ip', > - 'ipv4-frag': 'ip', > - 'ipv4-udp': 'udp', > - 'ipv4-tcp': 'tcp', > - # this hash not support in dpdk2.0 > - # 'l2_payload':'ether', > - 'ipv6-other': 'ip', > - 'ipv6-sctp': 'sctp', > - 'ipv6-udp': 'udp', > - 'ipv6-tcp': 'tcp', > - 'ipv6-frag': 'ip' > - } > + global iptypes > self.dut.kill_all() >=20 > # test with different rss queues > - for queue in testQueues: > - self.dut.send_expect( > - "./%s/app/testpmd -c fffff -n %d -- -i --coremask=3D0xf= fffe --rxq=3D%d -- > txq=3D%d" % > - (self.target, self.dut.get_memory_channels(), queue, que= ue), "testpmd> > ", 120) > + self.dut.send_expect( > + "./%s/app/testpmd -c fffff -n %d -- -i --coremask=3D0xffffe= --rxq=3D%d -- > txq=3D%d" % > + (self.target, self.dut.get_memory_channels(), queue, > + queue), "testpmd> ", 120) >=20 > - for iptype, rsstype in iptypes.items(): > - self.dut.send_expect("set verbose 8", "testpmd> ") > - self.dut.send_expect("set fwd rxonly", "testpmd> ") > - self.dut.send_expect( > - "set nbcore %d" % (queue + 1), "testpmd> ") > + for iptype, rsstype in iptypes.items(): > + self.dut.send_expect("set verbose 8", "testpmd> ") > + self.dut.send_expect("set fwd rxonly", "testpmd> ") > + self.dut.send_expect( > + "set nbcore %d" % (queue + 1), "testpmd> ") >=20 > - self.dut.send_expect("port stop all", "testpmd> ") > - # self.dut.send_expect("port config all rss ip", "testpm= d> ") > - self.dut.send_expect( > - "set_hash_global_config 0 simple_xor %s enable" % ip= type, > "testpmd> ") > + self.dut.send_expect("port stop all", "testpmd> ") > + self.dut.send_expect( > + "set_hash_global_config 0 simple_xor %s enable" % iptype= , "testpmd> > ") > + self.dut.send_expect( > + "set_sym_hash_ena_per_port 0 enable", "testpmd> ") > + self.dut.send_expect("port start all", "testpmd> ") > + > + out =3D self.dut.send_expect( > + "port config all rss %s" % rsstype, "testpmd> ") > + self.verify("error" not in out, "Configuration of RSS hash f= ailed: Invalid > argument") > + # configure the reta with specific mappings. > + for i in range(reta_num): > + reta_entries.insert(i, random.randint(0, queue - 1)) > self.dut.send_expect( > - "set_sym_hash_ena_per_port 0 enable", "testpmd> ") > - self.dut.send_expect("port start all", "testpmd> ") > - > - out =3D self.dut.send_expect( > - "port config all rss %s" % rsstype, "testpmd> ") > - self.verify("error" not in out, "Configuration of RSS ha= sh failed: Invalid > argument") > - # configure the reta with specific mappings. > - for i in range(reta_num): > - reta_entries.insert(i, random.randint(0, queue - 1)) > - self.dut.send_expect( > - "port config 0 rss reta (%d,%d)" % (i, reta_entr= ies[i]), "testpmd> ") > + "port config 0 rss reta (%d,%d)" % (i, reta_entries[= i]), "testpmd> ") > + self.send_packet_symmetric(itf, iptype) >=20 > - self.send_packet_symmetric(itf, iptype) > - > - self.dut.send_expect("quit", "# ", 30) > + self.dut.send_expect("quit", "# ", 30) >=20 > def test_dynamic_rss_bond_config(self): >=20 > # setup testpmd and finish bond config > + self.verify(self.nic in ["fortville_eagle", "fortville_spirit", > + "fortpark_TLV", "fortville_25g"], > + "NIC Unsupported: " + str(self.nic)) > + > self.dut.send_expect("./%s/app/testpmd -c f -n 4 -- -i" % self.t= arget, > "testpmd> ", 120) > out =3D self.dut.send_expect("create bonded device 3 0", "testpm= d> ", 30) > bond_device_id =3D int(re.search("port \d+", out).group().split(= " ")[-1].strip()) > -- > 2.5.0