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 274C0A04F6; Tue, 7 Jan 2020 08:12:51 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D10361D91C; Tue, 7 Jan 2020 08:12:50 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id C5BDF1D918 for ; Tue, 7 Jan 2020 08:12:48 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jan 2020 23:12:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,404,1571727600"; d="scan'208";a="303108199" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga001.jf.intel.com with ESMTP; 06 Jan 2020 23:12:47 -0800 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 6 Jan 2020 23:12:46 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.30]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.210]) with mapi id 14.03.0439.000; Tue, 7 Jan 2020 15:12:44 +0800 From: "Tu, Lijuan" To: "He, Zhiwei" , "dts@dpdk.org" CC: "He, Zhiwei" Thread-Topic: [dts] [PATCH V2] tests:add gtp packet process to cover scapy 2.3 and 2.4 for RSS advanced feature in cvl Thread-Index: AQHVxQL0mtfU8ufdT0eVMnZdzDguIafeyaeg Date: Tue, 7 Jan 2020 07:12:43 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BBA3CCB@SHSMSX101.ccr.corp.intel.com> References: <1578364442-60435-1-git-send-email-zhiwei.he@intel.com> In-Reply-To: <1578364442-60435-1-git-send-email-zhiwei.he@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 V2] tests:add gtp packet process to cover scapy 2.3 and 2.4 for RSS advanced feature in cvl 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 > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of zhiwei.he > Sent: Tuesday, January 7, 2020 10:34 AM > To: dts@dpdk.org > Cc: He, Zhiwei > Subject: [dts] [PATCH V2] tests:add gtp packet process to cover scapy 2.3= and > 2.4 for RSS advanced feature in cvl >=20 > From: "zhiwei.he" >=20 > Signed-off-by: zhiwei.he > --- > tests/TestSuite_cvl_advanced_rss.py | 68 +++++++++++++++++++++----------= -- > ---- > 1 file changed, 39 insertions(+), 29 deletions(-) >=20 > diff --git a/tests/TestSuite_cvl_advanced_rss.py > b/tests/TestSuite_cvl_advanced_rss.py > index 4364b56..27c67b3 100644 > --- a/tests/TestSuite_cvl_advanced_rss.py > +++ b/tests/TestSuite_cvl_advanced_rss.py > @@ -2,7 +2,8 @@ import json > import time > import re > import packet > - > +import os > +from scapy.contrib.gtp import * > from test_case import TestCase > from pmd_output import PmdOutput > from utils import BLUE, RED > @@ -18,6 +19,16 @@ from scapy.layers.l2 import Dot1Q from > scapy.layers.sctp import SCTP, SCTPChunkData from nvgre import NVGRE >=20 > +out =3D os.popen("pip list|grep scapy ") > +version_result =3Dout.read() > +p=3Dre.compile('scapy\s+2\.3\.\d+') > +m=3Dp.search(version_result) > + > +if not m: > + GTP_TEID=3D "teid" > +else: > + GTP_TEID=3D "TEID" > + > tv_mac_ipv4_l3_src_only =3D { > "name":"tv_mac_ipv4_l3_src_only", > "rte_flow_pattern":"flow create 0 ingress pattern eth / ipv4 / end a= ctions > rss types ipv4 l3-src-only end key_len 0 queues end / end", @@ -356,34 > +367,54 @@ tv_mac_ipv4_pppoe_icmp=3D { > "check_func_param": {"expect_port":0} } >=20 > +pkt_str=3D[] > +pkt =3D > +['Ether(dst=3D"68:05:ca:a3:28:94")/IP()/UDP(dport=3D2152)/GTP_U_Header(G= TP > _TEID=3D0x123456)/IP(src=3D"192.168.0.%d")/ICMP()/("X"*480)' %i for i in > range(0,100)] for i in pkt: > + pkt_str.append(i.replace('GTP_TEID', GTP_TEID)) > + > tv_mac_ipv4_gtpu_icmp=3D { > "name":"tv_mac_ipv4_gtpu_icmp", > "rte_flow_pattern":"flow create 0 ingress pattern eth / ipv4 / udp /= gtpu / > gtp_psc / ipv4 / end actions rss types ipv4 l3-src-only end key_len 0 que= ues > end / end", > - > "scapy_str":['Ether(dst=3D"68:05:ca:a3:28:94")/IP()/UDP(dport=3D2152)/GTP= _U_H > eader(teid=3D0x123456)/IP(src=3D"192.168.0.%d")/ICMP()/("X"*480)' %i for = i in > range(0,100)], > + "scapy_str":pkt_str, > "check_func": rfc.check_packets_of_each_queue, > "check_func_param": {"expect_port":0} } >=20 > +pkt_str=3D[] > +pkt =3D > +['Ether(dst=3D"68:05:ca:a3:28:94")/IP()/UDP(dport=3D2152)/GTP_U_Header(G= TP > _TEID=3D0x123456)/IP(src=3D"192.168.0.%d", > frag=3D6)/UDP(dport=3D%d)/("X"*480)' %(i, i+10) for i in range(0,100)] fo= r i in pkt: > + pkt_str.append(i.replace('GTP_TEID', GTP_TEID)) > + > tv_mac_ipv4_gtpu_udp_frag=3D { > "name":"tv_mac_ipv4_gtpu_udp_frag", > "rte_flow_pattern":"flow create 0 ingress pattern eth / ipv4 / udp /= gtpu / > gtp_psc / ipv4 / udp / end actions rss types ipv4 end key_len 0 queues en= d / > end", > - > "scapy_str":['Ether(dst=3D"68:05:ca:a3:28:94")/IP()/UDP(dport=3D2152)/GTP= _U_H > eader(teid=3D0x123456)/IP(src=3D"192.168.0.%d", > frag=3D6)/UDP(dport=3D%d)/("X"*480)' %(i, i+10) for i in range(0,100)], > + "scapy_str":pkt_str, > "check_func": rfc.check_packets_of_each_queue, > "check_func_param": {"expect_port":0} } >=20 > +pkt_str=3D[] > +pkt =3D > +['Ether(dst=3D"68:05:ca:a3:28:94")/IP()/UDP(dport=3D2152)/GTP_U_Header(G= TP > _TEID=3D0x123456)/IP(src=3D"192.168.0.%d", frag=3D6)/("X"*480)' %i for i = in > range(0,100)] for i in pkt: > + pkt_str.append(i.replace('GTP_TEID', GTP_TEID)) > + > tv_mac_ipv4_gtpu_ipv4_frag=3D { > "name":"tv_mac_ipv4_gtpu_ipv4_frag", > "rte_flow_pattern":"flow create 0 ingress pattern eth / ipv4 / udp /= gtpu / > gtp_psc / ipv4 / end actions rss types ipv4 l3-src-only end key_len 0 que= ues > end / end", > - > "scapy_str":['Ether(dst=3D"68:05:ca:a3:28:94")/IP()/UDP(dport=3D2152)/GTP= _U_H > eader(teid=3D0x123456)/IP(src=3D"192.168.0.%d", frag=3D6)/("X"*480)' %i f= or i in > range(0,100)], > + "scapy_str":pkt_str, > "check_func": rfc.check_packets_of_each_queue, > "check_func_param": {"expect_port":0} } >=20 > +pkt_str=3D[] > +pkt > +=3D['Ether(dst=3D"68:05:ca:a3:28:94")/IP()/UDP(dport=3D2152)/GTP_U_Heade= r(GT > P_TEID=3D0x123456)/IP(src=3D"192.168.0.%d", > frag=3D6)/TCP(dport=3D%d)/("X"*480)' %(i, i+10) for i in range(0,100)] fo= r i in pkt: > + pkt_str.append(i.replace('GTP_TEID', GTP_TEID)) > + > tv_mac_ipv4_gtpu_tcp=3D { > "name":"tv_mac_ipv4_gtpu_tcp", > "rte_flow_pattern":"flow create 0 ingress pattern eth / ipv4 / udp /= gtpu / > gtp_psc / ipv4 / tcp / end actions rss types ipv4 l3-src-only end key_len= 0 > queues end / end", > - > "scapy_str":['Ether(dst=3D"68:05:ca:a3:28:94")/IP()/UDP(dport=3D2152)/GTP= _U_H > eader(teid=3D0x123456)/IP(src=3D"192.168.0.%d", > frag=3D6)/TCP(dport=3D%d)/("X"*480)' %(i, i+10) for i in range(0,100)], > + "scapy_str":pkt_str, > "check_func": rfc.check_packets_of_each_queue, > "check_func_param": {"expect_port":0} } @@ -799,7 +830,9 @@ class > AdvancedRSSTest(TestCase): > self.pf_mac =3D self.dut.get_mac_address(0) > self.pf_pci =3D self.dut.ports_info[self.dut_ports[0]]['pci'] > self.verify(self.nic in ["columbiaville_25g","columbiaville_100g= "], "%s nic > not support ethertype filter" % self.nic) > - > + > + > + > def set_up(self): > """ > Run before each test case. > @@ -830,28 +863,6 @@ class AdvancedRSSTest(TestCase): > command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, > all_eal_param, "--rxq=3D64 --txq=3D64") > return command >=20 > - > - def create_testpmd_command_pipeline_mode(self): > - """ > - Create testpmd command for pipeline mode > - """ > - #Prepare testpmd EAL and parameters > - all_eal_param =3D self.dut.create_eal_parameters(ports=3D[0], > port_options=3D{0:"pipeline-mode-support=3D1"}) > - print all_eal_param #print eal parameters > - command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, > all_eal_param, "--rxq=3D64 --txq=3D64") > - return command > - > - > - def get_rule_number(self,outstring): > - """ > - get the rule number. > - """ > - result_scanner =3D r'Flow rule #(\d+) created' > - scanner =3D re.compile(result_scanner, re.DOTALL) > - m =3D scanner.search(outstring) > - rule_num =3D int(m.group(1)) > - return rule_num > - > def _rte_flow_validate_pattern(self, test_vectors, command, is_vxlan= ): >=20 > global test_results > @@ -951,4 +962,3 @@ class AdvancedRSSTest(TestCase): > command =3D self.create_testpmd_command() > self._rte_flow_validate_pattern(tvs_mac_rss_simple_xor, command= , > is_vxlan =3D True) >=20 > - > -- > 1.8.3.1