From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A52A8A0C53; Tue, 10 Aug 2021 08:58:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 673D240E6E; Tue, 10 Aug 2021 08:58:28 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 30D584068E for ; Tue, 10 Aug 2021 08:58:26 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10070"; a="214834464" X-IronPort-AV: E=Sophos;i="5.84,309,1620716400"; d="scan'208";a="214834464" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2021 23:58:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,309,1620716400"; d="scan'208";a="421739884" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga003.jf.intel.com with ESMTP; 09 Aug 2021 23:58:24 -0700 Received: from shsmsx604.ccr.corp.intel.com (10.109.6.214) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Mon, 9 Aug 2021 23:58:21 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX604.ccr.corp.intel.com (10.109.6.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Tue, 10 Aug 2021 14:58:19 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.2242.010; Tue, 10 Aug 2021 14:58:19 +0800 From: "Tu, Lijuan" To: "Xia, YanX" , "dts@dpdk.org" CC: "Xia, YanX" , "Peng, Yuan" Thread-Topic: [dts] [PATCH V3] tests/generic_flow_api: add test case dual_vlan Thread-Index: AQHXhQZ+4ZOgV54W10CzKZuIyjOdtqtsXm5w Date: Tue, 10 Aug 2021 06:58:19 +0000 Message-ID: References: <20210730141903.26737-1-yanx.xia@intel.com> In-Reply-To: <20210730141903.26737-1-yanx.xia@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V3] tests/generic_flow_api: add test case dual_vlan X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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" > -----Original Message----- > From: dts On Behalf Of Yan Xia > Sent: 2021=1B$BG/=1B(B7=1B$B7n=1B(B30=1B$BF|=1B(B 22:19 > To: dts@dpdk.org > Cc: Xia, YanX > Subject: [dts] [PATCH V3] tests/generic_flow_api: add test case dual_vlan >=20 > move test_dual_vlan in TestSuite_fortville_rss_granularity_config to > TestSuite_generic_flow_api, then modify lengacy command. >=20 > Signed-off-by: Yan Xia > --- > tests/TestSuite_generic_flow_api.py | 136 ++++++++++++++++++++++++++++ > 1 file changed, 136 insertions(+) >=20 > diff --git a/tests/TestSuite_generic_flow_api.py > b/tests/TestSuite_generic_flow_api.py > index e8171589..b97b49f2 100644 > --- a/tests/TestSuite_generic_flow_api.py > +++ b/tests/TestSuite_generic_flow_api.py > @@ -59,6 +59,8 @@ from scapy.utils import rdpcap >=20 > MAX_VLAN =3D 4095 > MAX_QUEUE =3D 15 > +testQueues =3D [16] > +reta_lines =3D [] > MAX_VFQUEUE =3D 3 > MAX_PORT =3D 65535 > MAX_TTL =3D 255 > @@ -642,6 +644,78 @@ class TestGeneric_flow_api(TestCase): > self.pkt_obj.append_pkt(pktstr) > self.pkt_obj.send_pkt(self.tester, tx_port=3Dself.tester_itf, co= unt=3Dcount) >=20 > + def send_packet(self, itf, tran_type, enable=3DNone): > + """ > + Sends packets for l2_payload. > + """ > + global reta_lines > + 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 > + if tran_type =3D=3D "l2_payload": > + if enable =3D=3D "ovlan": > + packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/Dot1Q(id=3D0x8100,vlan=3D4)/Dot1Q(id=3D0x8100,= vlan=3D2,ty > pe=3D0xaaaa)/Raw(load=3D"x"*60)], iface=3D"%s")' % ( > + mac, itf, itf) > + elif enable =3D=3D "ivlan": > + packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/Dot1Q(id=3D0x8100,vlan=3D1)/Dot1Q(id=3D0x8100,= vlan=3D3,ty > pe=3D0xaaaa)/Raw(load=3D"x"*60)], iface=3D"%s")' % ( > + mac, itf, itf) > + else: > + packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/Dot1Q(id=3D0x8100,vlan=3D1)/Dot1Q(id=3D0x8100,= vlan=3D2,ty > pe=3D0xaaaa)/Raw(load=3D"x"*60)], iface=3D"%s")' % ( > + mac, itf, 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) pack= ets" > + 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) > + > + self.append_result_table() > + > + def append_result_table(self): > + """ > + Append the hash value and queue id into table. > + """ > + > + global reta_lines > + > + # append the the hash value and queue id into table > + self.result_table_create( > + ['packet index', 'hash value', 'hash index', 'queue id']) > + i =3D 0 > + > + for tmp_reta_line in reta_lines: > + > + # compute the hash result of five tuple into the 7 LSBs valu= e. > + hash_index =3D int(tmp_reta_line["RSS hash"], 16) > + self.result_table_add( > + [i, tmp_reta_line["RSS hash"], hash_index, tmp_reta_line= ["queue"]]) > + i =3D i + 1 > + > def test_syn_filter(self): > """ > Only supported by ixgbe and igb. > @@ -2351,6 +2425,68 @@ class TestGeneric_flow_api(TestCase): > rule_num =3D extrapkt_rulenum['rulenum'] > self.verify_rulenum(rule_num) >=20 > + def test_dual_vlan(self): > + """ > + Test with flow type dual vlan(QinQ). > + """ > + flag =3D 1 > + > + for queue in testQueues: > + self.pmdout.start_testpmd( > + "Default", " --portmask=3D0x1 --rxq=3D%d --txq=3D%d" % = (queue, queue)) > + > + 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 extend on 0", "testpmd> ") > + self.dut.send_expect( > + "flow create 0 ingress pattern eth / end actions rss typ= es l2-payload > end queues end func toeplitz / end", "testpmd> ") > + self.dut.send_expect("port start all", "testpmd> ") > + res =3D self.pmdout.wait_link_status_up("all") > + self.verify(res is True, "link is down") > + > + self.send_packet(self.tester_itf, "l2_payload") > + > + # set flow rss type s-vlan c-vlan set by testpmd on dut > + self.dut.send_expect("flow create 0 ingress pattern eth / en= d actions rss > types s-vlan c-vlan end key_len 0 queues end / end", "testpmd> ") > + self.send_packet(self.tester_itf, "l2_payload") > + > + self.send_packet(self.tester_itf, "l2_payload", enable=3D"ov= lan") > + > + self.send_packet(self.tester_itf, "l2_payload", enable=3D"iv= lan") > + > + self.dut.send_expect("quit", "# ", 30) > + > + self.result_table_print() > + result_rows =3D self.result_table_getrows() > + self.verify(len(result_rows) > 1, "There is no data in the table= , testcase > failed!") If result_rows =3D3, it passed the verification. But how it can get "result= _rows[4][1]", so the exception will happen. > + > + # check the results > + if result_rows[1][1] =3D=3D result_rows[2][1]: > + flag =3D 0 > + self.verify(flag, "The packet index %d and %d hash values ar= e same, > rss_granularity_config failed!" %(result_rows[1][0],result_rows[2][0])) > + > + elif result_rows[1][1] =3D=3D result_rows[3][1]: > + flag =3D 0 > + self.verify(flag, "The packet index %d and %d hash values ar= e same, > rss_granularity_config failed!" %(result_rows[1][0],result_rows[3][0])) > + > + elif result_rows[1][1] =3D=3D result_rows[4][1]: > + flag =3D 0 > + self.verify(flag, "The packet index %d and %d hash values ar= e same, > rss_granularity_config failed!" %(result_rows[1][0],result_rows[4][0])) > + > + elif result_rows[2][1] =3D=3D result_rows[3][1]: > + flag =3D 0 > + self.verify(flag, "The packet index %d and %d hash values ar= e same, > rss_granularity_config failed!" %(result_rows[2][0],result_rows[3][0])) > + > + elif result_rows[2][1] =3D=3D result_rows[4][1]: > + flag =3D 0 > + self.verify(flag, "The packet index %d and %d hash values ar= e same, > rss_granularity_config failed!" %(result_rows[2][0],result_rows[4][0])) > + > + elif result_rows[3][1] =3D=3D result_rows[4][1]: > + flag =3D 0 > + self.verify(flag, "The packet index %d and %d hash values ar= e same, > rss_granularity_config failed!" %(result_rows[3][0],result_rows[4][0])) > + The test plans tells : 1). send packet as step 2, got hash value and queue value that output fr= om the testpmd on DUT, the value should be different with the values in step 2. 2). send packet as step 2 with changed ovlan id, got hash value and queu= e value that output from the testpmd on DUT, the value should be different with the values in step 2 & step 1). 3). send packet as step 2 with changed ivlan id, got hash value and queu= e value that output from the testpmd on DUT, the value should be different with the values in step 2 & step 1) & step 2). I don't think the message "The packet index %d and %d hash values are same,= rss_granularity_config failed!" could provide effective information to use= rs.=20 It is expected that user could roughly get where the issue happens, item 1,= 2 or 3. > def tear_down(self): > """ > Run after each test case. > -- > 2.17.1