From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id E985CA0096 for ; Thu, 11 Apr 2019 19:54:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A8E703772; Thu, 11 Apr 2019 19:54:05 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 3D9A03256 for ; Thu, 11 Apr 2019 19:54:03 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2019 10:54:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,338,1549958400"; d="scan'208";a="335925561" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 11 Apr 2019 10:54:01 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 11 Apr 2019 10:54:01 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 11 Apr 2019 10:54:00 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.164]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.149]) with mapi id 14.03.0415.000; Fri, 12 Apr 2019 01:53:58 +0800 From: "Tu, Lijuan" To: "Xiao, QimaiX" , "dts@dpdk.org" CC: "Xiao, QimaiX" Thread-Topic: [dts] [PATCH V1] optimize tests/TestSuite_rss_to_rte_flow to run more effectively Thread-Index: AQHU74K217uJPvkAe0iyE0attL1cXKY3PM7A Date: Thu, 11 Apr 2019 17:53:57 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BA60577@SHSMSX101.ccr.corp.intel.com> References: <1554889990-17323-1-git-send-email-qimaix.xiao@intel.com> In-Reply-To: <1554889990-17323-1-git-send-email-qimaix.xiao@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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDg2M2M3ZTQtODllMS00OTIyLTgyNDUtYTRmN2I5MmQwNjhmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQ1BQYmdLOXhrVnV6YlArek5DM09uXC8xUHpLaVVIN1wvbVpOVGJsMTdFTGlGZ2ZQZzBJTW0yYmExRW9XWDdsVElzIn0= 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] optimize tests/TestSuite_rss_to_rte_flow to run more effectively 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" A bunch of useless changes. More comments inline. Could you please give me a reason why I should merge this patch next time w= hen you file patches? Thanks Lijuan > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xiao,qimai > Sent: Wednesday, April 10, 2019 2:53 AM > To: dts@dpdk.org > Cc: Xiao, QimaiX > Subject: [dts] [PATCH V1] optimize tests/TestSuite_rss_to_rte_flow to run > more effectively >=20 > Signed-off-by: xiao,qimai > --- > tests/TestSuite_rss_to_rte_flow.py | 103 ++++++++++++----------------- > 1 file changed, 42 insertions(+), 61 deletions(-) >=20 > diff --git a/tests/TestSuite_rss_to_rte_flow.py > b/tests/TestSuite_rss_to_rte_flow.py > index 12c13e7..244e2c4 100644 > --- a/tests/TestSuite_rss_to_rte_flow.py > +++ b/tests/TestSuite_rss_to_rte_flow.py > @@ -36,18 +36,11 @@ Test moving RSS to rte_flow. >=20 > """ >=20 > -import utils > -import time > import re > +import time [Lijuan] what does it mean that move "import time" to another line. >=20 > -from test_case import TestCase > -from settings import HEADER_SIZE > from pmd_output import PmdOutput > -from settings import DRIVERS > - > -from project_dpdk import DPDKdut > -from dut import Dut > -from packet import Packet > +from test_case import TestCase >=20 >=20 > class TestRSS_to_Rteflow(TestCase): > @@ -99,14 +92,13 @@ class TestRSS_to_Rteflow(TestCase): > """ > get the queue which packet enter. > """ > - outstring =3D self.dut.send_expect("stop", "testpmd> ") > - time.sleep(2) > - result_scanner =3D r"Forward Stats for RX Port=3D %s/Queue=3D\s?= ([0-9]+)" % > self.dut_ports[0] > + outstring =3D self.pmdout.get_output() > + result_scanner =3D r'port\s?%s/queue\s?(\d+):\s?received \d+ > + packets' % self.dut_ports[0] > scanner =3D re.compile(result_scanner, re.DOTALL) > m =3D scanner.search(outstring) > queue_id =3D m.group(1) > - print "queue is %s" % queue_id > - self.dut.send_expect("start", "testpmd> ") > + print("queue is %s" % queue_id) [Lijuan] the original statement is python style, do not try to change it to= a C style. > + self.pmdout.execute_cmd("clear port stats all") > return queue_id >=20 > def send_and_check(self, pkt, rss_queue): > @@ -115,7 +107,6 @@ class TestRSS_to_Rteflow(TestCase): > """ > self.tester.scapy_append('sendp(%s, iface=3D"%s")' % (pkt, self.= tester_itf)) > self.tester.scapy_execute() > - time.sleep(2) [Lijuan] you'd better to keep it, I do not like to get another patch that s= ays time is not enough. > queue =3D self.get_queue_number() > self.verify(queue in rss_queue, "the packet doesn't enter the ex= pected > RSS queue.") > return queue > @@ -134,8 +125,8 @@ class TestRSS_to_Rteflow(TestCase): > packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/IP(src=3D"192.168.0.%d", dst=3D"192.168.0.%d")= ], > iface=3D"%s")' % ( > self.pf_mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(2) > + self.tester.scapy_execute() > + time.sleep(2) >=20 > def check_packet_queue(self, queue, out): > """ > @@ -212,10 +203,12 @@ class TestRSS_to_Rteflow(TestCase): > if (self.nic in ["fortville_eagle", "fortville_spirit", > "fortville_spirit_single", "fortpark_TLV", "for= tville_25g"]): > self.dut.send_expect( > - "show port 0 rss-hash", "all ipv4-frag ipv4-tcp ipv4-udp= ipv4-sctp > ipv4-other ipv6-frag ipv6-tcp ipv6-udp ipv6-sctp ipv6-other l2-payload ip= udp > tcp sctp") > + "show port 0 rss-hash", > + "all ipv4-frag ipv4-tcp ipv4-udp ipv4-sctp ipv4-other > + ipv6-frag ipv6-tcp ipv6-udp ipv6-sctp ipv6-other l2-payload ip udp tcp > + sctp") [Lijuan] what's the difference? > else: > self.dut.send_expect( > - "show port 0 rss-hash", "all ipv4 ipv4-tcp ipv4-udp ipv6= ipv6-tcp > ipv6-udp ipv6-ex ipv6-tcp-ex ipv6-udp-ex ip udp tcp") > + "show port 0 rss-hash", > + "all ipv4 ipv4-tcp ipv4-udp ipv6 ipv6-tcp ipv6-udp > + ipv6-ex ipv6-tcp-ex ipv6-udp-ex ip udp tcp") [Lijuan] what's the difference? > # send the packets and verify the results > self.send_packet("ipv4-other", self.tester_itf) > out =3D self.dut.send_expect("stop", "testpmd> ", 120) @@ -360,7= +353,8 > @@ class TestRSS_to_Rteflow(TestCase): >=20 > # Create a rss queue rule > self.dut.send_expect( > - "flow create 0 ingress pattern end actions rss types udp ipv= 4-tcp > ipv6-sctp ipv4-other end queues 1 4 7 end / end", "created") > + "flow create 0 ingress pattern end actions rss types udp ipv= 4-tcp > ipv6-sctp ipv4-other end queues 1 4 7 end / end", > + "created") [Lijuan] what's the difference? > # send the packets and verify the results > if (self.nic in ["fortville_eagle", "fortville_spirit", > "fortville_spirit_single", "fortpark_TLV", "for= tville_25g"]): > @@ -396,7 +390,8 @@ class TestRSS_to_Rteflow(TestCase): > """ > # Only supported by i40e > self.verify(self.nic in ["fortville_eagle", "fortville_spirit", > - "fortville_spirit_single", "fortpark_TL= V", "fortville_25g"], > "NIC Unsupported: " + str(self.nic)) > + "fortville_spirit_single", "fortpark_TL= V", "fortville_25g"], > + "NIC Unsupported: " + str(self.nic)) [Lijuan] what's the difference? > pkt1 =3D "Ether(dst=3D'%s')/IP(src=3D'0.0.0.0',dst=3D'4.0.0.0')/= UDP(sport=3D100, > dport=3D200)/('X'*48)" % self.pf_mac > pkt2 =3D "Ether(dst=3D'%s')/IP(src=3D'0.0.0.0',dst=3D'4.0.0.0')/= UDP(sport=3D100, > dport=3D201)/('X'*48)" % self.pf_mac > pkt3 =3D "Ether(dst=3D'%s')/IP(src=3D'0.0.0.0',dst=3D'4.0.0.0')/= UDP(sport=3D101, > dport=3D201)/('X'*48)" % self.pf_mac @@ -422,10 +417,10 @@ class > TestRSS_to_Rteflow(TestCase): > list1 =3D [queue1, queue2, queue3, queue4, queue5] >=20 > # Create a rss key rule > - self.dut.send_expect("flow flush 0", "testpmd> ") > - key =3D > "1234567890123456789012345678901234567890FFFFFFFFFFFF1234567890123 > 456789012345678901234567890FFFFFFFFFFFF" > self.dut.send_expect( > - "flow create 0 ingress pattern end actions rss types ipv4-ud= p end > key %s / end" % key, "created") > + "flow flush 0", "testpmd> ") > + self.dut.send_expect( > + "flow create 0 ingress pattern end actions rss types > + ipv4-udp end key 67108863 / end", "created") [Lijuan] Could you explain why change key, more short? > out2 =3D self.dut.send_expect("show port 0 rss-hash key", "testp= md> ", > 120) > key_queue1 =3D self.send_and_check(pkt1, rss_queue) > key_queue2 =3D self.send_and_check(pkt2, rss_queue) @@ -434,39 > +429,18 @@ class TestRSS_to_Rteflow(TestCase): > key_queue5 =3D self.send_and_check(pkt5, rss_queue) > list2 =3D [key_queue1, key_queue2, key_queue3, key_queue4, > key_queue5] >=20 > - self.verify((key in out2) and (out1 !=3D out2) and (list1 !=3D l= ist2), "the key > setting doesn't take effect.") > + self.verify((out1 !=3D out2) and (list1 !=3D list2), "the key > + setting doesn't take effect.") [Lijuan] what's the difference? >=20 > - # Create a rss rult with truncating key_len > - self.dut.send_expect("flow flush 0", "testpmd> ") > - key =3D > "1234567890123456789012345678901234567890FFFFFFFFFFFF1234567890123 > 456789012345678901234567890FFFFFFFFFFFF" > - key_len =3D "50" > + # Create a rss key_len rule > self.dut.send_expect( > - "flow create 0 ingress pattern end actions rss types ipv4-ud= p end > key %s key_len %s / end" % (key, key_len), "created") > - out3 =3D self.dut.send_expect("show port 0 rss-hash key", "testp= md> ", > 120) > - key_queue1 =3D self.send_and_check(pkt1, rss_queue) > - key_queue2 =3D self.send_and_check(pkt2, rss_queue) > - key_queue3 =3D self.send_and_check(pkt3, rss_queue) > - key_queue4 =3D self.send_and_check(pkt4, rss_queue) > - key_queue5 =3D self.send_and_check(pkt5, rss_queue) [Lijuan] why remove these tests? > - list3 =3D [key_queue1, key_queue2, key_queue3, key_queue4, > key_queue5] > - > - self.verify((key not in out3) and (out3 !=3D out1 !=3D out2) and= (list3 !=3D > list1 !=3D list2), "the key setting doesn't take effect.") > - > - # Create a rss rule with padding key_len > - self.dut.send_expect("flow flush 0", "testpmd> ") > - key =3D > "1234567890123456789012345678901234567890FFFFFFFFFFFF1234567890123 > 456789012345678901234567890FFFFFF" > - key_len =3D "52" > + "flow flush 0", "testpmd> ") > self.dut.send_expect( > - "flow create 0 ingress pattern end actions rss types ipv4-ud= p end > key %s key_len %s / end" % (key, key_len), "created") > - out4 =3D self.dut.send_expect("show port 0 rss-hash key", "testp= md> ", > 120) > - key_queue1 =3D self.send_and_check(pkt1, rss_queue) > - key_queue2 =3D self.send_and_check(pkt2, rss_queue) > - key_queue3 =3D self.send_and_check(pkt3, rss_queue) > - key_queue4 =3D self.send_and_check(pkt4, rss_queue) > - key_queue5 =3D self.send_and_check(pkt5, rss_queue) > - list4 =3D [key_queue1, key_queue2, key_queue3, key_queue4, > key_queue5] > - > - self.verify((key in out4) and (out4 !=3D out1 !=3D out2 !=3D out= 3) and (list4 !=3D > list1 !=3D list2), "the key setting doesn't take effect.") > + "flow create 0 ingress pattern end actions rss types ipv4-ud= p end > key_len 3 / end", "created") > + # Create a rss key rule > + self.dut.send_expect( > + "flow flush 0", "testpmd> ") > + self.dut.send_expect( > + "flow create 0 ingress pattern end actions rss types > + ipv4-udp end key 67108863 key_len 3 / end", "created") >=20 > def test_disable_rss_in_commandline(self): > """ > @@ -493,7 +467,8 @@ class TestRSS_to_Rteflow(TestCase): > time.sleep(2) > # Create a rss queue rule > self.dut.send_expect( > - "flow create 0 ingress pattern end actions rss types ipv6-tc= p ipv4-udp > sctp ipv6-other end queues 5 6 7 end / end", "created") > + "flow create 0 ingress pattern end actions rss types ipv6-tc= p ipv4- > udp sctp ipv6-other end queues 5 6 7 end / end", > + "created") > # send the packets and verify the results > if (self.nic in ["fortville_eagle", "fortville_spirit", > "fortville_spirit_single", "fortpark_TLV", "for= tville_25g"]): > @@ -551,14 +526,16 @@ class TestRSS_to_Rteflow(TestCase): > if (self.nic in ["bartonhills", "powerville"]): > # Create a flow director rule > self.dut.send_expect( > - "flow create 0 ingress pattern eth / ipv4 proto is 6 / u= dp dst is 50 / > end actions queue index 1 / end", "created") > + "flow create 0 ingress pattern eth / ipv4 proto is 6 / u= dp dst is 50 / > end actions queue index 1 / end", > + "created") > rss_queue =3D ["1"] > pkt =3D > "Ether(dst=3D'%s')/IP(src=3D'10.0.0.1',dst=3D'192.168.0.2',proto=3D6)/UDP= (dport=3D50, > sport=3D50)/('X'*48)" % self.pf_mac > self.send_and_check(pkt, rss_queue) > else: > # Create a flow director rule > self.dut.send_expect( > - "flow create 0 ingress pattern eth / ipv4 src is 10.0.0.= 1 dst is > 192.168.0.2 / udp src is 50 dst is 50 / end actions queue index 1 / end", > "created") > + "flow create 0 ingress pattern eth / ipv4 src is 10.0.0.= 1 dst is > 192.168.0.2 / udp src is 50 dst is 50 / end actions queue index 1 / end", > + "created") > # send the packets and verify the results > rss_queue =3D ["1"] > self.send_and_check(self.pkt2, rss_queue) @@ -572,7 +549,8 @= @ > class TestRSS_to_Rteflow(TestCase): > Set RSS queue rule with queue region API. > """ > self.verify(self.nic in ["fortville_eagle", "fortville_spirit", > - "fortville_spirit_single", "fortpark_TL= V", "fortville_25g"], > "NIC Unsupported: " + str(self.nic)) > + "fortville_spirit_single", "fortpark_TL= V", "fortville_25g"], > + "NIC Unsupported: " + str(self.nic)) > self.pmdout.start_testpmd("%s" % self.cores, "--rxq=3D16 --txq= =3D16 --port- > topology=3Dchained") > self.dut.send_expect("set fwd rxonly", "testpmd> ", 120) > self.dut.send_expect("set verbose 1", "testpmd> ", 120) @@ -581,= 7 > +559,8 @@ class TestRSS_to_Rteflow(TestCase): >=20 > # Create a rss queue rule. > self.dut.send_expect( > - "flow create 0 ingress pattern end actions rss types tcp end= queues 7 > 8 10 11 12 14 15 end / end", "created") > + "flow create 0 ingress pattern end actions rss types tcp end= queues 7 > 8 10 11 12 14 15 end / end", > + "created") > # send the packets and verify the results > rss_queue =3D ["7", "8", "10", "11", "12", "14", "15"] > queue1 =3D self.send_and_check(self.prio_pkt1, rss_queue) @@ -61= 6,7 > +595,8 @@ class TestRSS_to_Rteflow(TestCase): > Set RSS queue rule with invalid parameter in queue region API. > """ > self.verify(self.nic in ["fortville_eagle", "fortville_spirit", > - "fortville_spirit_single", "fortpark_TL= V", "fortville_25g"], > "NIC Unsupported: " + str(self.nic)) > + "fortville_spirit_single", "fortpark_TL= V", "fortville_25g"], > + "NIC Unsupported: " + str(self.nic)) > self.pmdout.start_testpmd("%s" % self.cores, "--rxq=3D16 --txq= =3D16 --port- > topology=3Dchained") > self.dut.send_expect("set fwd rxonly", "testpmd> ", 120) > self.dut.send_expect("set verbose 1", "testpmd> ", 120) @@ -642,= 7 > +622,8 @@ class TestRSS_to_Rteflow(TestCase): > The queue region is priority to RSS queue rule. > """ > self.verify(self.nic in ["fortville_eagle", "fortville_spirit", > - "fortville_spirit_single", "fortpark_TL= V", "fortville_25g"], > "NIC Unsupported: " + str(self.nic)) > + "fortville_spirit_single", "fortpark_TL= V", "fortville_25g"], > + "NIC Unsupported: " + str(self.nic)) > self.pmdout.start_testpmd("%s" % self.cores, "--rxq=3D16 --txq= =3D16 --port- > topology=3Dchained") > self.dut.send_expect("port config all rss all", "testpmd> ", 120= ) > self.dut.send_expect("set fwd rxonly", "testpmd> ", 120) > -- > 2.19.1