From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 5F1C7B460 for ; Wed, 22 Jun 2016 10:25:14 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP; 22 Jun 2016 01:25:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,509,1459839600"; d="scan'208";a="833010356" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga003.jf.intel.com with ESMTP; 22 Jun 2016 01:25:12 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 22 Jun 2016 01:25:12 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 22 Jun 2016 01:25:11 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.147]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.107]) with mapi id 14.03.0248.002; Wed, 22 Jun 2016 16:25:10 +0800 From: "Pei, Yulong" To: "Peng, Yuan" , "dts@dpdk.org" CC: "Peng, Yuan" Thread-Topic: [dts] [PATCH] tests: add fortville rss granularity script Thread-Index: AQHRx21EhUjTMLU460CcsafI5uD7KZ/1Lmig Date: Wed, 22 Jun 2016 08:25:09 +0000 Message-ID: <188971FCDA171749BED5DA74ABF3E6F0035952CD@shsmsx102.ccr.corp.intel.com> References: <1466039979-20539-1-git-send-email-yuan.peng@intel.com> <1466039979-20539-2-git-send-email-yuan.peng@intel.com> In-Reply-To: <1466039979-20539-2-git-send-email-yuan.peng@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNWM4NjZjNWQtZDQyNS00NTdlLWE2NDgtOGJmMDYxYjQ3YTkzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkhBOFBsT0hvYVlBbjJHS3hJS3QrXC9oVURWekY1R2h6M1ZMVVlldWZtb1FZPSJ9 x-ctpclassification: CTP_IC 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] tests: add fortville rss granularity script 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, 22 Jun 2016 08:25:15 -0000 Hi, See my comment below, -----Original Message----- From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of pengyuan Sent: Thursday, June 16, 2016 9:20 AM To: dts@dpdk.org Cc: Peng, Yuan Subject: [dts] [PATCH] tests: add fortville rss granularity script Signed-off-by: pengyuan diff --git a/test_plans/fortville_rss_granularity_config_test_plan.rst b/te= st_plans/fortville_rss_granularity_config_test_plan.rst new file mode 100644 index 0000000..28d3b49 --- /dev/null +++ b/test_plans/fortville_rss_granularity_config_test_plan.rst @@ -0,0 +1,340 @@ +.. Copyright (c) <2015>, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Fortville - support granularity configuration of RSS, support 32-bit=20 +GRE keys=20 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Description +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +This document provides test plan for testing the function of Fortville: + +1. Support granularity configuration of RSS + +By default Fortville uses hash input set preloaded from NVM image which=20 +includes all fields +- IPv4/v6+TCP/UDP port. Potential problem for this is global=20 +configuration per device and can affect all ports. It is required that=20 +hash input set can be configurable, such as using IPv4 only or IPv6 only = or IPv4/v6+TCP/UDP. + +2. support 32-bit GRE keys + +By default Fortville extracts only 24 bits of GRE key to FieldVector=20 +(NVGRE use case) but for Telco use cases full 32-bit GRE key is needed.=20 +It is required that both 24-bit and 32-bit keys for GRE should be=20 +supported. the test plan is to test the API to switch between 24-bit=20 +and 32-bit keys + + +Prerequisites +------------- + +1. Hardware: + 1x Fortville_eagle NIC (4x 10G) + 1x Fortville_spirit NIC (2x 40G) + 2x Fortville_spirit_single NIC (1x 40G) + +2. software:=20 + dpdk: http://dpdk.org/git/dpdk + scapy: http://www.secdev.org/projects/scapy/ + + +Test Case 1: test with flow type ipv4-tcp=20 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D + +1. config testpmd on DUT + +1). set up testpmd with fortville NICs:: + ./testpmd -c 0x1ffff -n 4 -- -i --coremask=3D0x1fffe --portmask=3D0x3 =20 +--rxq=3D16 --txq=3D16 --txqflags=3D0 + +2). Reta Configuration(optional, if not set, will use default):: + testpmd> port config 0 rss reta (hash_index,queue_id) + +3). PMD fwd only receive the packets:: + testpmd> set fwd rxonly + =20 +4). rss recived package type configuration:: + testpmd> port config all rss tcp + +5). set hash function:: =20 + testpmd>set_hash_global_config 0 toeplitz ipv4-tcp enable + +6). verbose configuration:: + testpmd> set verbose 8 + +7). start packet receive:: + testpmd> start + =20 +2. using scapy to send packets with ipv4-tcp on tester, + =20 + sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.%d",=20 + dst=3D"192.168.0.%d")/TCP(sport=3D1024,dport=3D1025)], iface=3D"%s") + =20 +then got hash value and queue value that output from the testpmd on DUT.=20 + +3. set hash input set to "none" by testpmd on dut, + +testpmd> set_hash_input_set 0 ipv4-tcp none select + +send packet as step 2, got hash value and queue value that output from=20 +the testpmd on DUT, the values shoud be different from the values in step = 2. + +4. set hash input set by testpmd on dut, enable src-ipv4 & dst-ipv4, + +testpmd> set_hash_input_set 0 ipv4-tcp src-ipv4 add set_hash_input_set=20 +testpmd> 0 ipv4-tcp dst-ipv4 add + +send packet as step 2, got hash value and queue value that output from=20 +the testpmd on DUT, the values shoud be different from the values in step = 2. + +5. set hash input set by testpmd on dut, enable src-ipv4, dst-ipv4,=20 +tcp-src-port, tcp-dst-port + +testpmd> set_hash_input_set 0 ipv4-tcp tcp-src-port add=20 +testpmd> set_hash_input_set 0 ipv4-tcp tcp-dst-port add + +send packet as step 2, got hash value and queue value that output from=20 +the testpmd on DUT, the values shoud be should be different with the value= s from step 3 & step 4, should be same as step 2. + +6. set hash input set by testpmd on dut, enable tcp-src-port,=20 +tcp-dst-port + +testpmd> set_hash_input_set 0 ipv4-tcp none select set_hash_input_set 0=20 +testpmd> ipv4-tcp tcp-src-port add set_hash_input_set 0 ipv4-tcp=20 +testpmd> tcp-dst-port add + +send packet as step 2, got hash value and queue value that output from=20 +the testpmd on DUT, the values shoud be should be different with the value= s from step2 & step 3 & step 4 & step 5. + +So it can be approved that with flow type ipv4-tcp, rss hash can be=20 +calculated by only included IPv4 fields or only included TCP fields or bot= h IPv4+TCP fields. + + +Test Case 2: test with flow type ipv4-udp=20 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +1. config testpmd on DUT + +1). set up testpmd with fortville NICs:: + ./testpmd -c 0x1ffff -n 4 -- -i --coremask=3D0x1fffe --portmask=3D0x3 =20 +--rxq=3D16 --txq=3D16 --txqflags=3D0 + +2). Reta Configuration(optional, if not set, will use default):: + testpmd> port config 0 rss reta (hash_index,queue_id) + +3). PMD fwd only receive the packets:: + testpmd> set fwd rxonly + =20 +4). rss recived package type configuration:: + testpmd> port config all rss udp + +5). set hash function:: =20 + testpmd>set_hash_global_config 0 toeplitz ipv4-udp enable + +6). verbose configuration:: + testpmd> set verbose 8 + +7). start packet receive:: + testpmd> start + =20 +2. using scapy to send packets with ipv4-udp on tester:: + =20 + sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.%d",=20 + dst=3D"192.168.0.%d")/UDP(sport=3D1024,dport=3D1025)], iface=3D"%s")) + =20 +then got hash value and queue value that output from the testpmd on DUT.=20 + +3. set hash input set to "none" by testpmd on dut, + +testpmd> set_hash_input_set 0 ipv4-udp none select + +send packet as step 2, got hash value and queue value that output from=20 +the testpmd on DUT, the values shoud be different from the values in step = 2. + +4. set hash input set by testpmd on dut, enable src-ipv4 and dst-ipv4, + +testpmd> set_hash_input_set 0 ipv4-udp src-ipv4 add set_hash_input_set=20 +testpmd> 0 ipv4-udp dst-ipv4 add + +send packet as step 2, got hash value and queue value that output from=20 +the testpmd on DUT, the values shoud be different from the values in step = 2 & step 3. + +5. set hash input set by testpmd on dut, enable src-ipv4, dst-ipv4,=20 +udp-src-port, udp-dst-port + +testpmd> set_hash_input_set 0 ipv4-udp udp-src-port add=20 +testpmd> set_hash_input_set 0 ipv4-udp udp-dst-port add + +send packet as step 2, got hash value and queue value that output from=20 +the testpmd on DUT, the values shoud be should be different with the value= s from step 3 & step 4, should be same as step 2. + +6. set hash input set by testpmd on dut, enable udp-src-port,=20 +udp-dst-port + +testpmd> set_hash_input_set 0 ipv4-udp none select set_hash_input_set 0=20 +testpmd> ipv4-udp udp-src-port add set_hash_input_set 0 ipv4-udp=20 +testpmd> udp-dst-port add + +send packet as step 2, got hash value and queue value that output from=20 +the testpmd on DUT, the values shoud be should be different with the value= s from step2 & step 3 & step 4 & step 5. + +So it can be approved that with flow type ipv4-udp, rss hash can be=20 +calculated by only included IPv4 fields or only included UDP fields or bot= h IPv4+UDP fields. + +Test Case 3: test with flow type ipv6-tcp=20 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +test mothed is same as Test Case 1, but it need change all ipv4 to=20 +ipv6, and using scapy to send packets with ipv6-tcp on tester, + +sendp([Ether(dst=3D"%s")/IPv6(src=3D"3ffe:2501:200:1fff::%d",=20 +dst=3D"3ffe:2501:200:3::%d")/TCP(sport=3D1024,dport=3D1025)], iface=3D"%s"= ) + +and the test result should be same as Test Case 1. + + +Test Case 4: test with flow type ipv6-udp=20 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +test mothed is same as Test Case 2, but it need change all ipv4 to=20 +ipv6, and using scapy to send packets with ipv6-udp on tester, + +sendp([Ether(dst=3D"%s")/IPv6(src=3D"3ffe:2501:200:1fff::%d",=20 +dst=3D"3ffe:2501:200:3::%d")/UDP(sport=3D1024,dport=3D1025)], iface=3D"%s"= ) + +and the test result should be same as Test Case 2. + +Test Case 5: test dual vlan(QinQ) +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D +1. config testpmd on DUT + +1). set up testpmd with fortville NICs:: + ./testpmd -c 0x1ffff -n 4 -- -i --coremask=3D0x1fffe --portmask=3D0x3 =20 +--rxq=3D16 --txq=3D16 --txqflags=3D0 + +2). set qinq on:: + testpmd> vlan set qinq on +=20 +3). Reta Configuration(optional, if not set, will use default):: + testpmd> port config 0 rss reta (hash_index,queue_id) + +4). PMD fwd only receive the packets:: + testpmd> set fwd rxonly + =20 +5). verbose configuration:: + testpmd> set verbose 8 + +6). start packet receive:: + testpmd> start + +7). rss recived package type configuration:: + testpmd> port config all rss ether =20 + +2. using scapy to send packets with dual vlan (QinQ) on tester:: + =20 + =20 + sendp([Ether(dst=3D"%s")/Dot1Q(id=3D0x8100,vlan=3D%s)/Dot1Q(id=3D0x8100,v= lan=3D% + s)], iface=3D"%s") +=20 +then got hash value and queue value that output from the testpmd on DUT. + +3. set hash input set to "none" by testpmd on dut:: + +testpmd> set_hash_input_set 0 l2_payload none select + +send packet as step 2, got hash value and queue value that output from=20 +the testpmd on DUT, the value shoud be same with the values in step 2. + +4. set hash input set by testpmd on dut, enable ovlan field:: + +testpmd> set_hash_input_set 0 l2_payload ovlan add + +send packet as step 2, got hash value and queue value that output from=20 +the testpmd on DUT, the value shoud be different with the values in step 2= . + +5. set hash input set by testpmd on dut, enable ovlan, ivlan field:: + +testpmd> set_hash_input_set 0 l2_payload ivlan add + +send packet as step 2, got hash value and queue value that output from=20 +the testpmd on DUT, the value shoud be different with the values in step 2= . + +Test Case 6: 32-bit GRE keys and 24-bit GRE keys test=20 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D + +1. config testpmd on DUT + +1). set up testpmd with fortville NICs:: + ./testpmd -c 0x1ffff -n 4 -- -i --coremask=3D0x1fffe --portmask=3D0x3 =20 +--rxq=3D16 --txq=3D16 --txqflags=3D0 + +2). Reta Configuration(optional, if not set, will use default):: + testpmd> port config 0 rss reta (hash_index,queue_id) + +3). PMD fwd only receive the packets:: + testpmd> set fwd rxonly + =20 +4). rss recived package type configuration:: + testpmd> port config all rss all + +5). set hash function:: =20 + testpmd>set_hash_global_config 0 toeplitz ipv4-other enable + +6). verbose configuration:: + testpmd> set verbose 8 + +7). start packet receive:: + testpmd> start + +2. using scapy to send packets with GRE header on tester:: + =20 + =20 + sendp([Ether(dst=3D"%s")/IP(src=3D"192.168.0.1",dst=3D"192.168.0.2",proto= =3D47 + )/GRE(key_present=3D1,proto=3D2048,key=3D67108863)/IP()], iface=3D"%s") +=20 +then got hash value and queue value that output from the testpmd on DUT. + +3. set hash input set to "none" by testpmd on dut, + +testpmd> set_hash_input_set 0 ipv4-other none select + +send packet as step 2, got hash value and queue value that output from=20 +the testpmd on DUT, the value shoud be different with the values in step 2= . + +4. set hash input set by testpmd on dut, enable src-ipv4, dst-ipv4 + +testpmd> set_hash_input_set 0 ipv4-other src-ipv4 add=20 +testpmd> set_hash_input_set 0 ipv4-other dst-ipv4 add + +send packet as step 2, got hash value and queue value that output from=20 +the testpmd on DUT, the value shoud be same with the values in step 2. + +4. set hash input set and gre-key-len=3D3 by testpmd on dut, enable=20 +gre-key + +testpmd> global_config 0 gre-key-len 3 +testpmd> set_hash_input_set 0 ipv4-other gre-key add + +send packet as step 2, got hash value and queue value that output from=20 +the testpmd on DUT, the values shoud be different with the values in step = 2. + +5. set gre-key-len=3D4 by testpmd on dut, enable gre-key + +testpmd> global_config 0 gre-key-len 4 + +send packet as step 2, got hash value and queue value that output from=20 +the testpmd on DUT, the values shoud be different with the values in step = 4. + +So with gre-key-len=3D3 (24bit gre key) or gre-key-len=3D4 (32bit gre key)= ,=20 +different rss hash value and queue value can be got, it can be proved that= 32bit & 24bit gre key are supported by fortville. diff --git a/tests/TestSuite_fortville_rss_granularity_config.py b/tests/Te= stSuite_fortville_rss_granularity_config.py new file mode 100644 index 0000000..4982344 --- /dev/null +++ b/tests/TestSuite_fortville_rss_granularity_config.py @@ -0,0 +1,634 @@ +# BSD LICENSE +# +# Copyright(c) 2010-2014 Intel Corporation. All rights reserved. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without #=20 +modification, are permitted provided that the following conditions #=20 +are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS #=20 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #=20 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR #=20 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT #=20 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, #=20 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT #=20 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, #=20 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY #=20 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT #=20 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #=20 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +""" +DPDK Test suite. + +Test DPDK2.3 feature:=20 +1.Fortville support granularity configuration of RSS. +By default Fortville uses hash input set preloaded from NVM image which=20 +includes all fields +- IPv4/v6+TCP/UDP port. Potential problem for this is global=20 +configuration per device and can affect all ports. It is required that=20 +hash input set can be configurable, such as using IPv4 only or IPv6 only = or IPv4/v6+TCP/UDP. + +2.Fortville support 32-bit GRE keys. +By default Fortville extracts only 24 bits of GRE key to FieldVector=20 +(NVGRE use case) but for Telco use cases full 32-bit GRE key is needed.=20 +It is required that both 24-bit and 32-bit keys for GRE should be=20 +supported. the test plan is to test the API to switch between 24-bit=20 +and 32-bit keys + +Support 4*10G, 1*40G and 2*40G NICs. +""" +import time +import random +import re +import dts +import dut + +testQueues =3D [16] +reta_entries =3D [] +reta_lines =3D [] +reta_num =3D 128 + +# 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 +# +# +# Test class. +# +class TestFortvilleRssGranularityConfig(TestCase): + # + # + # Utility methods and other non-test code. + # + def set_up_all(self): + """ + Run at the start of each test suite. + """ + + self.verify(self.nic in ["fortville_eagle", "fortville_spirit", + "fortville_spirit_single", "redrockcanyou", "atwood", = "boulderrapid", "fortpark_TLV"], + "NIC Unsupported: " + str(self.nic)) + global reta_num + if self.nic in ["fortville_eagle", "fortville_spirit", "fortville_= spirit_single", "fortpark_TLV"]: + reta_num =3D 512 + elif self.nic in ["niantic"]: + reta_num =3D 128 + elif self.nic in ["redrockcanyou", "atwood", "boulderrapid"]: + reta_num =3D 128 This feature only supported by Fortville, why it need care other nics ? Best Regards Yulong Pei + else: + self.verify(False, "NIC Unsupported:%s" % str(self.nic)) + ports =3D self.dut.get_ports(self.nic) + self.verify(len(ports) >=3D 1, "Not enough ports available") + + def set_up(self): + """ + Run before each test case. + """ + pass + def send_packet(self, itf, tran_type): + """ + Sends packets. + """ + global reta_lines + global reta_num + self.tester.scapy_foreground() + self.dut.send_expect("start", "testpmd>") + mac =3D self.dut.get_mac_address(0) + + # send packet with different source and dest ip + i =3D 0 + if tran_type =3D=3D "ipv4-other": + 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", proto=3D47)/GRE(key_prese= nt=3D1,proto=3D2048,key=3D67108863)/IP()], iface=3D"%s")' % ( + mac, itf, i + 1, i + 2, itf) + self.tester.scapy_append(packet) + self.tester.scapy_execute() + time.sleep(.5) + elif tran_type =3D=3D "ipv4-tcp": + 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=3D= 1024)], iface=3D"%s")' % ( + mac, itf, i + 1, i + 2, itf) + self.tester.scapy_append(packet) + self.tester.scapy_execute() + time.sleep(.5) + elif tran_type =3D=3D "ipv4-udp": + 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=3D= 1024)], iface=3D"%s")' % ( + mac, itf, i + 1, i + 2, itf) + self.tester.scapy_append(packet) + self.tester.scapy_execute() + time.sleep(.5) + elif tran_type =3D=3D "l2_payload": + packet =3D r'sendp([Ether(dst=3D"%s", src=3Dget_if_hwaddr("%s"= ))/Dot1Q(id=3D0x8100,vlan=3D%s)/Dot1Q(id=3D0x8100,vlan=3D%s)], iface=3D"%s"= )' % ( + mac, itf, i + 1, i + 2, itf) + self.tester.scapy_append(packet) + self.tester.scapy_execute() + time.sleep(.5) + elif tran_type =3D=3D "ipv6-tcp": + 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(sp= ort=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) + elif tran_type =3D=3D "ipv6-udp": + 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(sp= ort=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) + else: + print "\ntran_type error!\n" + + out =3D self.dut.get_session_output(timeout=3D1) + self.dut.send_expect("stop", "testpmd>") + lines =3D out.split("\r\n") + reta_line =3D {} + # collect the hash result and the queue id + for line in lines: + line =3D line.strip() + if len(line) !=3D 0 and line.strip().startswith("port "): + reta_line =3D {} + rexp =3D r"port (\d)/queue (\d{1,2}): received (\d) packet= s" + m =3D re.match(rexp, line.strip()) + if m: + reta_line["port"] =3D m.group(1) + reta_line["queue"] =3D m.group(2) + + elif len(line) !=3D 0 and line.startswith(("src=3D",)): + for item in line.split("-"): + item =3D item.strip() + if(item.startswith("RSS hash")): + name, value =3D item.split("=3D", 1) + + reta_line[name.strip()] =3D value.strip() + reta_lines.append(reta_line) + =20 + self.append_result_table() +=20 + def append_result_table(self): + """ + Append the hash value and queue id into table. + """ + + global reta_lines + global reta_num + + #append the the hash value and queue id into table + dts.results_table_add_header( + ['packet index', 'hash value', 'hash index', 'queue id']) + + i =3D 0 + + for tmp_reta_line in reta_lines: + =20 + # compute the hash result of five tuple into the 7 LSBs value. + hash_index =3D int(tmp_reta_line["RSS hash"], 16) % reta_num + dts.results_table_add_row( + [i, tmp_reta_line["RSS hash"], hash_index, tmp_reta_line["= queue"]]) + i =3D i + 1 + + + def test_ipv4_tcp(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 + global reta_lines + flag =3D 1 + self.dut.kill_all() + + # test with different rss queues + for queue in testQueues: + self.dut.send_expect( + "./%s/app/testpmd -c fffff -n %d -- -i --coremask=3D0xfff= fe --portmask=3D0x3 --rxq=3D%d --txq=3D%d --txqflags=3D0" % + (self.target, self.dut.get_memory_channels(), queue,=20 + queue), "testpmd> ", 120) + + 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 ipv4-tcp enable", "tes= tpmd> ") + self.dut.send_expect("port start all", "testpmd> ") + self.dut.send_expect( + "port config all rss tcp", "testpmd> ") + self.send_packet(itf, "ipv4-tcp") + =20 + #set hash input set to "none" by testpmd on dut + self.dut.send_expect("set_hash_input_set 0 ipv4-tcp none select", "te= stpmd> ") + self.send_packet(itf, "ipv4-tcp") + + #set hash input set by testpmd on dut, enable src-ipv4 & dst-ipv4 + self.dut.send_expect("set_hash_input_set 0 ipv4-tcp src-ipv4 add", "t= estpmd> ") + self.dut.send_expect("set_hash_input_set 0 ipv4-tcp dst-ipv4 add", "t= estpmd> ") + self.send_packet(itf, "ipv4-tcp") + + #set hash input set by testpmd on dut, enable src-ipv4, dst-ipv4, tcp= -src-port, tcp-dst-port + self.dut.send_expect("set_hash_input_set 0 ipv4-tcp tcp-src-port add"= , "testpmd> ") + self.dut.send_expect("set_hash_input_set 0 ipv4-tcp tcp-dst-po= rt add", "testpmd> ") + self.send_packet(itf, "ipv4-tcp") + + #set hash input set by testpmd on dut, enable tcp-src-port, tcp-dst-p= ort + self.dut.send_expect("set_hash_input_set 0 ipv4-tcp none select", "te= stpmd> ") + self.dut.send_expect("set_hash_input_set 0 ipv4-tcp tcp-src-port add"= , "testpmd> ") + self.dut.send_expect("set_hash_input_set 0 ipv4-tcp tcp-dst-po= rt add", "testpmd> ") + self.send_packet(itf, "ipv4-tcp") + + self.dut.send_expect("quit", "# ", 30) + dts.results_table_print() + self.verify(len(dts.results_table_rows) > 1, "There is no data in the=20 +table, testcase failed!") + +=09 + if ((dts.results_table_rows[1][1]=3D=3Ddts.results_table_rows[2][1])or(dt= s.results_table_rows[1][3]=3D=3Ddts.results_table_rows[2][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granularity_= config failed!") + elif ((dts.results_table_rows[1][1]=3D=3Ddts.results_table_rows[3][1])or(= dts.results_table_rows[1][3]=3D=3Ddts.results_table_rows[3][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[2][1]=3D=3Ddts.results_table_rows[3][1])or(= dts.results_table_rows[2][3]=3D=3Ddts.results_table_rows[3][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[1][1]=3D=3Ddts.results_table_rows[5][1])or(= dts.results_table_rows[1][3]=3D=3Ddts.results_table_rows[5][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[2][1]=3D=3Ddts.results_table_rows[5]= [1])or(dts.results_table_rows[2][3]=3D=3Ddts.results_table_rows[5][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[3][1]=3D=3Ddts.results_table_rows[5][1])or(= dts.results_table_rows[3][3]=3D=3Ddts.results_table_rows[5][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[1][1]!=3Ddts.results_table_rows[4][1])or(dt= s.results_table_rows[1][3]!=3Ddts.results_table_rows[4][3])): + flag =3D 0 + self.verify(flag, "The two hash values are different,=20 +rss_granularity_config failed!") + + reta_lines =3D [] + =20 + def test_ipv4_udp(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 + global reta_lines + flag =3D 1 + self.dut.kill_all() + + # test with different rss queues + for queue in testQueues: + self.dut.send_expect( + "./%s/app/testpmd -c fffff -n %d -- -i --coremask=3D0xfff= fe --portmask=3D0x3 --rxq=3D%d --txq=3D%d --txqflags=3D0" % + (self.target, self.dut.get_memory_channels(), queue,=20 + queue), "testpmd> ", 120) + + 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 ipv4-udp enable", "tes= tpmd> ") + self.dut.send_expect("port start all", "testpmd> ") + self.dut.send_expect( + "port config all rss udp", "testpmd> ") + self.send_packet(itf, "ipv4-udp") + + #set hash input set to "none" by testpmd on dut + self.dut.send_expect("set_hash_input_set 0 ipv4-udp none selec= t", "testpmd> ") + self.send_packet(itf, "ipv4-udp") + + #set hash input set by testpmd on dut, enable src-ipv4 & dst-i= pv4 + self.dut.send_expect("set_hash_input_set 0 ipv4-udp src-ipv4 a= dd", "testpmd> ") + self.dut.send_expect("set_hash_input_set 0 ipv4-udp dst-ipv4 a= dd", "testpmd> ") + self.send_packet(itf, "ipv4-udp") + + #set hash input set by testpmd on dut, enable src-ipv4, dst-ip= v4, udp-src-port, udp-dst-port + self.dut.send_expect("set_hash_input_set 0 ipv4-udp udp-src-po= rt add", "testpmd> ") + self.dut.send_expect("set_hash_input_set 0 ipv4-udp udp-dst-po= rt add", "testpmd> ") + self.send_packet(itf, "ipv4-udp") + + #set hash input set by testpmd on dut, enable udp-src-port, ud= p-dst-port + self.dut.send_expect("set_hash_input_set 0 ipv4-udp none selec= t", "testpmd> ") + self.dut.send_expect("set_hash_input_set 0 ipv4-udp udp-src-po= rt add", "testpmd> ") + self.dut.send_expect("set_hash_input_set 0 ipv4-udp udp-dst-po= rt add", "testpmd> ") + self.send_packet(itf, "ipv4-udp") + + self.dut.send_expect("quit", "# ", 30) + dts.results_table_print() + self.verify(len(dts.results_table_rows) > 1, "There is no data=20 + in the table, testcase failed!") + + #check the results =20 + if ((dts.results_table_rows[1][1]=3D=3Ddts.results_table_rows[2][1= ])or(dts.results_table_rows[1][3]=3D=3Ddts.results_table_rows[2][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[1][1]=3D=3Ddts.results_table_rows[3]= [1])or(dts.results_table_rows[1][3]=3D=3Ddts.results_table_rows[3][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[2][1]=3D=3Ddts.results_table_rows[3]= [1])or(dts.results_table_rows[2][3]=3D=3Ddts.results_table_rows[3][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[1][1]=3D=3Ddts.results_table_rows[5]= [1])or(dts.results_table_rows[1][3]=3D=3Ddts.results_table_rows[5][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[2][1]=3D=3Ddts.results_table_rows[5]= [1])or(dts.results_table_rows[2][3]=3D=3Ddts.results_table_rows[5][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[3][1]=3D=3Ddts.results_table_rows[5]= [1])or(dts.results_table_rows[3][3]=3D=3Ddts.results_table_rows[5][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[1][1]!=3Ddts.results_table_rows[4][1= ])or(dts.results_table_rows[1][3]!=3Ddts.results_table_rows[4][3])): + flag =3D 0 + self.verify(flag, "The two hash values are different,=20 + rss_granularity_config failed!") + + reta_lines =3D [] + + def test_ipv6_tcp(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 + global reta_lines + flag =3D 1 + self.dut.kill_all() + + # test with different rss queues + for queue in testQueues: + self.dut.send_expect( + "./%s/app/testpmd -c fffff -n %d -- -i --coremask=3D0xfff= fe --portmask=3D0x3 --rxq=3D%d --txq=3D%d --txqflags=3D0" % + (self.target, self.dut.get_memory_channels(), queue,=20 + queue), "testpmd> ", 120) + + 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 ipv6-tcp enable", "tes= tpmd> ") + self.dut.send_expect("port start all", "testpmd> ") + self.dut.send_expect( + "port config all rss tcp", "testpmd> ") + self.send_packet(itf, "ipv6-tcp") + + #set hash input set to "none" by testpmd on dut + self.dut.send_expect("set_hash_input_set 0 ipv6-tcp none selec= t", "testpmd> ") + self.send_packet(itf, "ipv6-tcp") + + #set hash input set by testpmd on dut, enable src-ipv6 & dst-i= pv6 + self.dut.send_expect("set_hash_input_set 0 ipv6-tcp src-ipv6 a= dd", "testpmd> ") + self.dut.send_expect("set_hash_input_set 0 ipv6-tcp dst-ipv6 a= dd", "testpmd> ") + self.send_packet(itf, "ipv6-tcp") + + #set hash input set by testpmd on dut, enable src-ipv6, dst-ip= v6, tcp-src-port, tcp-dst-port + self.dut.send_expect("set_hash_input_set 0 ipv6-tcp tcp-src-po= rt add", "testpmd> ") + self.dut.send_expect("set_hash_input_set 0 ipv6-tcp tcp-dst-po= rt add", "testpmd> ") + self.send_packet(itf, "ipv6-tcp") + + #set hash input set by testpmd on dut, enable tcp-src-port, tc= p-dst-port + self.dut.send_expect("set_hash_input_set 0 ipv6-tcp none selec= t", "testpmd> ") + self.dut.send_expect("set_hash_input_set 0 ipv6-tcp tcp-src-po= rt add", "testpmd> ") + self.dut.send_expect("set_hash_input_set 0 ipv6-tcp tcp-dst-po= rt add", "testpmd> ") + self.send_packet(itf, "ipv6-tcp") + + self.dut.send_expect("quit", "# ", 30) + dts.results_table_print() + self.verify(len(dts.results_table_rows) > 1, "There is no data=20 +in the table, testcase failed!") + + #check the results + if ((dts.results_table_rows[1][1]=3D=3Ddts.results_table_rows[2][1= ])or(dts.results_table_rows[1][3]=3D=3Ddts.results_table_rows[2][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[1][1]=3D=3Ddts.results_table_rows[3]= [1])or(dts.results_table_rows[1][3]=3D=3Ddts.results_table_rows[3][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[2][1]=3D=3Ddts.results_table_rows[3]= [1])or(dts.results_table_rows[2][3]=3D=3Ddts.results_table_rows[3][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[1][1]=3D=3Ddts.results_table_rows[5]= [1])or(dts.results_table_rows[1][3]=3D=3Ddts.results_table_rows[5][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[2][1]=3D=3Ddts.results_table_rows[5]= [1])or(dts.results_table_rows[2][3]=3D=3Ddts.results_table_rows[5][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[3][1]=3D=3Ddts.results_table_rows[5]= [1])or(dts.results_table_rows[3][3]=3D=3Ddts.results_table_rows[5][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[1][1]!=3Ddts.results_table_rows[4][1= ])or(dts.results_table_rows[1][3]!=3Ddts.results_table_rows[4][3])): + flag =3D 0 + self.verify(flag, "The two hash values are different,=20 + rss_granularity_config failed!") + + reta_lines =3D [] + + def test_ipv6_udp(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 + global reta_lines + flag =3D 1 + self.dut.kill_all() + + # test with different rss queues + for queue in testQueues: + self.dut.send_expect( + "./%s/app/testpmd -c fffff -n %d -- -i --coremask=3D0xfff= fe --portmask=3D0x3 --rxq=3D%d --txq=3D%d --txqflags=3D0" % + (self.target, self.dut.get_memory_channels(), queue,=20 + queue), "testpmd> ", 120) + + 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 ipv6-udp enable", "tes= tpmd> ") + self.dut.send_expect("port start all", "testpmd> ") + self.dut.send_expect( + "port config all rss udp", "testpmd> ") + self.send_packet(itf, "ipv6-udp") + + #set hash input set to "none" by testpmd on dut + self.dut.send_expect("set_hash_input_set 0 ipv6-udp none selec= t", "testpmd> ") + self.send_packet(itf, "ipv6-udp") + + #set hash input set by testpmd on dut, enable src-ipv6 & dst-i= pv6 + self.dut.send_expect("set_hash_input_set 0 ipv6-udp src-ipv6 a= dd", "testpmd> ") + self.dut.send_expect("set_hash_input_set 0 ipv6-udp dst-ipv6 a= dd", "testpmd> ") + self.send_packet(itf, "ipv6-udp") + + #set hash input set by testpmd on dut, enable src-ipv6, dst-ip= v6, udp-src-port, udp-dst-port + self.dut.send_expect("set_hash_input_set 0 ipv6-udp udp-src-po= rt add", "testpmd> ") + self.dut.send_expect("set_hash_input_set 0 ipv6-udp udp-dst-po= rt add", "testpmd> ") + self.send_packet(itf, "ipv6-udp") + + #set hash input set by testpmd on dut, enable udp-src-port, ud= p-dst-port + self.dut.send_expect("set_hash_input_set 0 ipv6-udp none selec= t", "testpmd> ") + self.dut.send_expect("set_hash_input_set 0 ipv6-udp udp-src-po= rt add", "testpmd> ") + self.dut.send_expect("set_hash_input_set 0 ipv6-udp udp-dst-po= rt add", "testpmd> ") + self.send_packet(itf, "ipv6-udp") + + self.dut.send_expect("quit", "# ", 30) + dts.results_table_print() + self.verify(len(dts.results_table_rows) > 1, "There is no data=20 + in the table, testcase failed!") + + #check the results + if ((dts.results_table_rows[1][1]=3D=3Ddts.results_table_rows[2][1= ])or(dts.results_table_rows[1][3]=3D=3Ddts.results_table_rows[2][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[1][1]=3D=3Ddts.results_table_rows[3]= [1])or(dts.results_table_rows[1][3]=3D=3Ddts.results_table_rows[3][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[2][1]=3D=3Ddts.results_table_rows[3]= [1])or(dts.results_table_rows[2][3]=3D=3Ddts.results_table_rows[3][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[1][1]=3D=3Ddts.results_table_rows[5]= [1])or(dts.results_table_rows[1][3]=3D=3Ddts.results_table_rows[5][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[2][1]=3D=3Ddts.results_table_rows[5]= [1])or(dts.results_table_rows[2][3]=3D=3Ddts.results_table_rows[5][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[3][1]=3D=3Ddts.results_table_rows[5]= [1])or(dts.results_table_rows[3][3]=3D=3Ddts.results_table_rows[5][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[1][1]!=3Ddts.results_table_rows[4][1= ])or(dts.results_table_rows[1][3]!=3Ddts.results_table_rows[4][3])): + flag =3D 0 + self.verify(flag, "The two hash values are different,=20 + rss_granularity_config failed!") + + reta_lines =3D [] + + def test_dual_vlan(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 + global reta_lines + flag =3D 1 + self.dut.kill_all() + + # test with different rss queues + for queue in testQueues: + self.dut.send_expect( + "./%s/app/testpmd -c fffff -n %d -- -i --coremask=3D0xfff= fe --portmask=3D0x3 --rxq=3D%d --txq=3D%d --txqflags=3D0" % + (self.target, self.dut.get_memory_channels(), queue,=20 + queue), "testpmd> ", 120) + + 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("vlan set qinq on 0", "testpmd> ") + self.dut.send_expect( + "set_hash_global_config 0 toeplitz l2_payload enable", "t= estpmd> ") + self.dut.send_expect("port start all", "testpmd> ") + self.dut.send_expect( + "port config all rss ether", "testpmd> ") + self.send_packet(itf, "l2_payload") + + #set hash input set to "none" by testpmd on dut + self.dut.send_expect("set_hash_input_set 0 l2_payload none sel= ect", "testpmd> ") + self.send_packet(itf, "l2_payload") + + #set hash input set by testpmd on dut, enable ovlan + self.dut.send_expect("set_hash_input_set 0 l2_payload ovlan ad= d", "testpmd> ") + self.send_packet(itf, "l2_payload") + + #set hash input set by testpmd on dut, enable ovlan & ivlan + self.dut.send_expect("set_hash_input_set 0 l2_payload ivlan ad= d", "testpmd> ") + self.send_packet(itf, "l2_payload") + + + self.dut.send_expect("quit", "# ", 30) + dts.results_table_print() + self.verify(len(dts.results_table_rows) > 1, "There is no data=20 +in the table, testcase failed!") + + #check the results + if ((dts.results_table_rows[1][1]!=3Ddts.results_table_rows[2][1])= or(dts.results_table_rows[1][3]!=3Ddts.results_table_rows[2][3])): + flag =3D 0 + self.verify(flag, "The two hash values are different, rss_gran= ularity_config failed!") + elif ((dts.results_table_rows[1][1]=3D=3Ddts.results_table_rows[3]= [1])or(dts.results_table_rows[1][3]=3D=3Ddts.results_table_rows[3][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[1][1]=3D=3Ddts.results_table_rows[4]= [1])or(dts.results_table_rows[1][3]=3D=3Ddts.results_table_rows[4][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[3][1]=3D=3Ddts.results_table_rows[4]= [1])or(dts.results_table_rows[3][3]=3D=3Ddts.results_table_rows[4][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same,=20 + rss_granularity_config failed!") + + reta_lines =3D [] + + def test_GRE_keys(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 + global reta_lines + flag =3D 1 + self.dut.kill_all() + + # test with different rss queues + for queue in testQueues: + self.dut.send_expect( + "./%s/app/testpmd -c fffff -n %d -- -i --coremask=3D0xfff= fe --portmask=3D0x3 --rxq=3D%d --txq=3D%d --txqflags=3D0" % + (self.target, self.dut.get_memory_channels(), queue,=20 + queue), "testpmd> ", 120) + + 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 ipv4-other enable", "t= estpmd> ") + self.dut.send_expect("port start all", "testpmd> ") + self.dut.send_expect( + "port config all rss all", "testpmd> ") + self.send_packet(itf, "ipv4-other") + + #set hash input set to "none" by testpmd on dut + self.dut.send_expect("set_hash_input_set 0 ipv4-other none sel= ect", "testpmd> ") + self.send_packet(itf, "ipv4-other") + + #set hash input set by testpmd on dut, enable src-ipv4 & dst-i= pv4 + self.dut.send_expect("set_hash_input_set 0 ipv4-other src-ipv4= add", "testpmd> ") + self.dut.send_expect("set_hash_input_set 0 ipv4-other dst-ipv4= add", "testpmd> ") + self.send_packet(itf, "ipv4-other") + + #set hash input set by testpmd on dut, enable src-ipv4, dst-ip= v4, gre-key-len 3 + self.dut.send_expect("global_config 0 gre-key-len 3", "testpmd= > ") + self.dut.send_expect("set_hash_input_set 0 ipv4-other gre-key add", "= testpmd> ") + self.send_packet(itf, "ipv4-other") + + #set hash input set by testpmd on dut, enable src-ipv4, dst-ipv4, gre= -key-len 4 + self.dut.send_expect("global_config 0 gre-key-len 4", "testpmd= > ") + self.send_packet(itf, "ipv4-other") + + self.dut.send_expect("quit", "# ", 30) + dts.results_table_print() + self.verify(len(dts.results_table_rows) > 1, "There is no data=20 + in the table, testcase failed!") + + #check the results + if ((dts.results_table_rows[1][1]=3D=3Ddts.results_table_rows[2][1])or(= dts.results_table_rows[1][3]=3D=3Ddts.results_table_rows[2][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[1][1]!=3Ddts.results_table_rows[3][1= ])or(dts.results_table_rows[1][3]!=3Ddts.results_table_rows[3][3])): + flag =3D 0 + self.verify(flag, "The two hash values are different, rss_gran= ularity_config failed!") + elif ((dts.results_table_rows[1][1]=3D=3Ddts.results_table_rows[4]= [1])or(dts.results_table_rows[1][3]=3D=3Ddts.results_table_rows[4][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same, rss_granu= larity_config failed!") + elif ((dts.results_table_rows[4][1]=3D=3Ddts.results_table_rows[5]= [1])or(dts.results_table_rows[4][3]=3D=3Ddts.results_table_rows[5][3])): + flag =3D 0 + self.verify(flag, "The two hash values are the same,=20 + rss_granularity_config failed!") + + reta_lines =3D [] + +=09 + def tear_down(self): + """ + Run after each test case. + """ + pass + + def tear_down_all(self): + """ + Run after each test suite. + """ + pass + -- 2.5.0