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 80FD5A00E6 for ; Mon, 13 May 2019 07:25:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 40AC92BC1; Mon, 13 May 2019 07:25:17 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 19F6C11C5 for ; Mon, 13 May 2019 07:25:15 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 May 2019 22:25:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,464,1549958400"; d="scan'208";a="171068843" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 12 May 2019 22:25:14 -0700 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 12 May 2019 22:25:14 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 12 May 2019 22:25:14 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.70]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.129]) with mapi id 14.03.0415.000; Mon, 13 May 2019 13:25:12 +0800 From: "Li, WenjieX A" To: "Xiao, QimaiX" , "dts@dpdk.org" CC: "Xiao, QimaiX" , "Li, WenjieX A" Thread-Topic: [dts] [PATCH V2] update function send_packet of pmdrss_hash to reduce runtime Thread-Index: AQHU/nH5kfuIgRX9pUy247G/jH4UVqZomv/Q Date: Mon, 13 May 2019 05:25:11 +0000 Message-ID: <8688172CD5C0B74590FAE19D9579F94B536E387C@SHSMSX103.ccr.corp.intel.com> References: <1556532095-20759-1-git-send-email-qimaix.xiao@intel.com> In-Reply-To: <1556532095-20759-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: 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] update function send_packet of pmdrss_hash to reduce runtime 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" Reviewed-by: Li, WenjieX A > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xiao,qimai > Sent: Monday, April 29, 2019 6:02 PM > To: dts@dpdk.org > Cc: Xiao, QimaiX > Subject: [dts] [PATCH V2] update function send_packet of pmdrss_hash to > reduce runtime >=20 > optimize function send_packet in pmdrss_hash >=20 > Signed-off-by: xiao,qimai > --- > tests/TestSuite_pmdrss_hash.py | 148 ++++++++++++++------------------- > 1 file changed, 64 insertions(+), 84 deletions(-) >=20 > diff --git a/tests/TestSuite_pmdrss_hash.py b/tests/TestSuite_pmdrss_hash= .py > index 283a545..32dc263 100644 > --- a/tests/TestSuite_pmdrss_hash.py > +++ b/tests/TestSuite_pmdrss_hash.py > @@ -85,79 +85,79 @@ class TestPmdrssHash(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")' % ( > mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_execute() > + time.sleep(.5) > elif tran_type =3D=3D "ipv4-tcp": > for i in range(10): > 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")/TCP(sport=3D1024,dport=3D1024)], iface=3D"%s")' % ( > mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_execute() > + time.sleep(.5) > elif tran_type =3D=3D "ipv4-udp": > for i in range(10): > 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")/UDP(sport=3D1024,dport=3D1024)], iface=3D"%s")' % ( > mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_execute() > + time.sleep(.5) > elif tran_type =3D=3D "ipv4-sctp": > for i in range(10): > 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")/SCTP(sport=3D1024,dport=3D1024,tag=3D1)], iface=3D"= %s")' % ( > mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_execute() > + time.sleep(.5) > elif tran_type =3D=3D "ipv4-frag": > for i in range(10): > 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",frag=3D1,flags=3D"MF")], iface=3D"%s")' % ( > mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_execute() > + time.sleep(.5) > elif tran_type =3D=3D "l2_payload": > for i in range(10): > packet =3D r'sendp([Ether(src=3D"00:00:00:00:00:0%d",dst= =3D"%s")], > iface=3D"%s")' % ( > i + 1, mac, itf) > self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_execute() > + time.sleep(.5) >=20 > elif tran_type =3D=3D "ipv6-other": > for i in range(10): > packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/IPv6(src=3D"3ffe:2501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d")], iface=3D"%s")' % ( > mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_execute() > + time.sleep(.5) > elif tran_type =3D=3D "ipv6-tcp": > for i in range(10): > packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/IPv6(src=3D"3ffe:2501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d")/TCP(sport=3D1024,dport=3D1024)], iface=3D"%s= ")' % ( > mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_execute() > + time.sleep(.5) > elif tran_type =3D=3D "ipv6-udp": > for i in range(10): > packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/IPv6(src=3D"3ffe:2501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d")/UDP(sport=3D1024,dport=3D1024)], iface=3D"%s= ")' % ( > mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_execute() > + time.sleep(.5) > elif tran_type =3D=3D "ipv6-sctp": > for i in range(10): > packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/IPv6(src=3D"3ffe:2501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d", nh=3D132)/SCTP(sport=3D1024,dport=3D1024,tag= =3D1)], > iface=3D"%s")' % ( > mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_execute() > + time.sleep(.5) > elif tran_type =3D=3D "ipv6-frag": > for i in range(10): > packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/IPv6(src=3D"3ffe:2501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d",nh=3D44)/IPv6ExtHdrFragment()], iface=3D"%s")= ' % ( > mac, itf, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_execute() > + time.sleep(.5) > else: > print "\ntran_type error!\n" >=20 > @@ -235,131 +235,111 @@ class TestPmdrssHash(TestCase): > packet =3D r'sendp([Ether(dst=3D"%s")/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) > - packet =3D r'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.= 0.%d", > dst=3D"192.168.0.%d")], iface=3D"%s")' % ( > + packet2 =3D > + r'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.%d", dst=3D"192.168.0.%d= ")], > + iface=3D"%s")' % ( > mac, i + 2, i + 1, itf) > - self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_append(packet2) > + self.tester.scapy_execute() > + time.sleep(.5) >=20 > elif tran_type =3D=3D "ipv4-tcp": > for i in range(4): > packet =3D r'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.= 0.%d", > dst=3D"192.168.0.%d")/TCP(sport=3D1024,dport=3D1025)], iface=3D"%s")' % ( > mac, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > - packet =3D r'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.= 0.%d", > dst=3D"192.168.0.%d")/TCP(sport=3D1025,dport=3D1024)], iface=3D"%s")' % ( > + packet2 =3D > + r'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.%d", > + dst=3D"192.168.0.%d")/TCP(sport=3D1025,dport=3D1024)], iface=3D"%s")' %= ( > mac, i + 2, i + 1, itf) > - self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_append(packet2) > + self.tester.scapy_execute() > + time.sleep(.5) > elif tran_type =3D=3D "ipv4-udp": > for i in range(4): > packet =3D r'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.= 0.%d", > dst=3D"192.168.0.%d")/UDP(sport=3D1024,dport=3D1025)], iface=3D"%s")' % ( > mac, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > - packet =3D r'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.= 0.%d", > dst=3D"192.168.0.%d")/UDP(sport=3D1025,dport=3D1024)], iface=3D"%s")' % ( > + packet2 =3D > + r'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.%d", > + dst=3D"192.168.0.%d")/UDP(sport=3D1025,dport=3D1024)], iface=3D"%s")' %= ( > mac, i + 2, i + 1, itf) > - self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_append(packet2) > + self.tester.scapy_execute() > + time.sleep(.5) > elif tran_type =3D=3D "ipv4-sctp": > for i in range(4): > 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) > - self.tester.scapy_execute() > - time.sleep(.5) > - packet =3D r'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.= 0.%d", > dst=3D"192.168.0.%d")/SCTP(sport=3D1025,dport=3D1024,tag=3D1)], iface=3D"= %s")' % ( > + packet2 =3D > + r'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.%d", > + dst=3D"192.168.0.%d")/SCTP(sport=3D1025,dport=3D1024,tag=3D1)], iface= =3D"%s")' % > + ( > mac, i + 2, i + 1, itf) > - self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_append(packet2) > + self.tester.scapy_execute() > + time.sleep(.5) > elif tran_type =3D=3D "ipv4-frag": > for i in range(10): > packet =3D r'sendp([Ether(dst=3D"%s")/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) > - packet =3D r'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.= 0.%d", > dst=3D"192.168.0.%d",frag=3D1,flags=3D"MF")], iface=3D"%s")' % ( > + packet2 =3D > + r'sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.%d", > + dst=3D"192.168.0.%d",frag=3D1,flags=3D"MF")], iface=3D"%s")' % ( > mac, i + 2, i + 1, itf) > - self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_append(packet2) > + self.tester.scapy_execute() > + time.sleep(.5) > elif tran_type =3D=3D "l2_payload": > for i in range(10): > 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) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_execute() > + time.sleep(.5) > elif tran_type =3D=3D "ipv6-other": > for i in range(4): > packet =3D r'sendp([Ether(dst=3D"%s")/IPv6(src=3D"3ffe:2= 501: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) > - packet =3D r'sendp([Ether(dst=3D"%s")/IPv6(src=3D"3ffe:2= 501:200:3::%d", > dst=3D"3ffe:2501:200:1fff::%d")], iface=3D"%s")' % ( > + packet2 =3D > + r'sendp([Ether(dst=3D"%s")/IPv6(src=3D"3ffe:2501:200:3::%d", > + dst=3D"3ffe:2501:200:1fff::%d")], iface=3D"%s")' % ( > mac, i + 2, i + 1, itf) > - self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_append(packet2) > + self.tester.scapy_execute() > + time.sleep(.5) >=20 > elif tran_type =3D=3D "ipv6-tcp": > for i in range(4): > packet =3D r'sendp([Ether(dst=3D"%s")/IPv6(src=3D"3ffe:2= 501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d")/TCP(sport=3D1024,dport=3D1025)], iface=3D"%s= ")' % ( > mac, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > - packet =3D r'sendp([Ether(dst=3D"%s")/IPv6(src=3D"3ffe:2= 501:200:3::%d", > dst=3D"3ffe:2501:200:1fff::%d")/TCP(sport=3D1025,dport=3D1024)], iface=3D= "%s")' % ( > + packet2 =3D > + r'sendp([Ether(dst=3D"%s")/IPv6(src=3D"3ffe:2501:200:3::%d", > + dst=3D"3ffe:2501:200:1fff::%d")/TCP(sport=3D1025,dport=3D1024)], > + iface=3D"%s")' % ( > mac, i + 2, i + 1, itf) > - self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_append(packet2) > + self.tester.scapy_execute() > + time.sleep(.5) >=20 > elif tran_type =3D=3D "ipv6-udp": > for i in range(4): > packet =3D r'sendp([Ether(dst=3D"%s")/IPv6(src=3D"3ffe:2= 501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d")/UDP(sport=3D1024,dport=3D1025)], iface=3D"%s= ")' % ( > mac, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > - packet =3D r'sendp([Ether(dst=3D"%s")/IPv6(src=3D"3ffe:2= 501:200:1fff::%d", > dst=3D"3ffe:2501:200:3::%d")/UDP(sport=3D1025,dport=3D1024)], iface=3D"%s= ")' % ( > + packet2 =3D > + r'sendp([Ether(dst=3D"%s")/IPv6(src=3D"3ffe:2501:200:1fff::%d", > + dst=3D"3ffe:2501:200:3::%d")/UDP(sport=3D1025,dport=3D1024)], iface=3D"= %s")' % > + ( > mac, i + 2, i + 1, itf) > - self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_append(packet2) > + self.tester.scapy_execute() > + time.sleep(.5) > elif tran_type =3D=3D "ipv6-sctp": > for i in range(4): > 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) > - self.tester.scapy_execute() > - time.sleep(.5) > - 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=3D1025,dport=3D1024,tag= =3D1)], > iface=3D"%s")' % ( > + packet2 =3D > + r'sendp([Ether(dst=3D"%s")/IPv6(src=3D"3ffe:2501:200:1fff::%d", > + dst=3D"3ffe:2501:200:3::%d", nh=3D132)/SCTP(sport=3D1025,dport=3D1024,t= ag=3D1)], > + iface=3D"%s")' % ( > mac, i + 2, i + 1, itf) > - self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_append(packet2) > + self.tester.scapy_execute() > + time.sleep(.5) > elif tran_type =3D=3D "ipv6-frag": > for i in range(4): > 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=3D44)/IPv6ExtHdrFragment()], iface=3D"%s")= ' % ( > mac, i + 1, i + 2, itf) > self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > - 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=3D44)/IPv6ExtHdrFragment()], iface=3D"%s")= ' % ( > + packet2 =3D > + r'sendp([Ether(dst=3D"%s")/IPv6(src=3D"3ffe:2501:200:1fff::%d", > + dst=3D"3ffe:2501:200:3::%d",nh=3D44)/IPv6ExtHdrFragment()], iface=3D"%s= ")' % > + ( > mac, i + 2, i + 1, itf) > - self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(.5) > + self.tester.scapy_append(packet2) > + self.tester.scapy_execute() > + time.sleep(.5) > else: > print "\ntran_type error!\n" >=20 > -- > 2.17.1