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 932F1A00E6 for ; Thu, 8 Aug 2019 07:41:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8B77A231E; Thu, 8 Aug 2019 07:41:36 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 6FA70F04 for ; Thu, 8 Aug 2019 07:41:34 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Aug 2019 22:41:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,360,1559545200"; d="scan'208";a="193078726" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga001.fm.intel.com with ESMTP; 07 Aug 2019 22:41:33 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 7 Aug 2019 22:41:32 -0700 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 7 Aug 2019 22:41:32 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.80]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.15]) with mapi id 14.03.0439.000; Thu, 8 Aug 2019 13:41:30 +0800 From: "Tu, Lijuan" To: "Mo, YufengX" , "dts@dpdk.org" CC: "Mo, YufengX" Thread-Topic: [dts] [PATCH V1 3/4] [next]framework/dut: add check condition for trex port Thread-Index: AQHVRa+6qz2U4ddTGEqPubRxHaOnw6bwzHBw Date: Thu, 8 Aug 2019 05:41:29 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BAFF5C6@SHSMSX101.ccr.corp.intel.com> References: <1564364921-33333-1-git-send-email-yufengx.mo@intel.com> <1564364921-33333-4-git-send-email-yufengx.mo@intel.com> In-Reply-To: <1564364921-33333-4-git-send-email-yufengx.mo@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-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTNkOTk1MjctZTE0OC00ZDM4LWE3MDAtYzcxN2ZkM2JjNGM0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoielwvemh3VFBSU3JDd1k5cGxwalU4M2ZaTkpwYVp1ZUpBZ085RFpWK2JGdElISDdYcWpqaERZQURYWEV1VElkbHQifQ== 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 3/4] [next]framework/dut: add check condition for trex port 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, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of yufengmx > Sent: Monday, July 29, 2019 9:49 AM > To: dts@dpdk.org > Cc: Mo, YufengX > Subject: [dts] [PATCH V1 3/4] [next]framework/dut: add check condition fo= r > trex port >=20 > mapping >=20 > add check condition for trex port mapping and fix indentation issue. >=20 > Signed-off-by: yufengmx > --- > framework/dut.py | 59 ++++++++++++++++++++++++++++++--------------------= ---- > -- > 1 file changed, 32 insertions(+), 27 deletions(-) >=20 > diff --git a/framework/dut.py b/framework/dut.py index cc36f72..48a5326 > 100644 > --- a/framework/dut.py > +++ b/framework/dut.py > @@ -937,7 +937,12 @@ class Dut(Crb): > dutpci =3D self.ports_info[dutPort]['pci'] > if peer is not None: > for remotePort in range(len(self.tester.ports_info)): > - if self.tester.ports_info[remotePort]['pci'].lower()= =3D=3D peer.lower(): > + if self.tester.ports_info[remotePort]['type'].lower(= ) =3D=3D 'trex': > + if self.tester.ports_info[remotePort]['intf'].lo= wer() =3D=3D > peer.lower(): > + hits[remotePort] =3D True > + self.ports_map[dutPort] =3D remotePort > + break > + elif self.tester.ports_info[remotePort]['pci'].lower= () =3D=3D > peer.lower(): > hits[remotePort] =3D True > self.ports_map[dutPort] =3D remotePort > break > @@ -959,34 +964,34 @@ class Dut(Crb): > ipv6 =3D self.get_ipv6_address(dutPort) > if ipv6 =3D=3D "Not connected": > if self.tester.ports_info[remotePort].has_key('ipv4'= ): > - out =3D self.tester.send_ping( > - dutPort, > self.tester.ports_info[remotePort]['ipv4'], > - self.get_mac_address(dutPort)) > - else: > - continue > - else: > + out =3D self.tester.send_ping( > + dutPort, self.tester.ports_info[remotePort][= 'ipv4'], > + self.get_mac_address(dutPort)) > + else: > + continue > + else: > if getattr(self, 'send_ping6', None): > - out =3D self.send_ping6( > - dutPort, self.tester.ports_info[remotePort]['ip= v6'], > - self.get_mac_address(dutPort)) > + out =3D self.send_ping6( > + dutPort, self.tester.ports_info[remotePort][= 'ipv6'], > + self.get_mac_address(dutPort)) > else: > - out =3D self.tester.send_ping6( > - remotePort, ipv6, > self.get_mac_address(dutPort)) > - > - if ('64 bytes from' in out): > - self.logger.info("PORT MAP: [dut %d: tester %d]" % (= dutPort, > remotePort)) > - self.ports_map[dutPort] =3D remotePort > - hits[remotePort] =3D True > - if self.crb['IP'] =3D=3D self.crb['tester IP']: > - # remove dut port act as tester port > - remove_port =3D self.get_port_info(remotepci) > - if remove_port is not None: > - remove.append(remove_port) > - # skip ping from those port already act as dut p= ort > - testerPort =3D self.tester.get_local_index(dutpc= i) > - if testerPort !=3D -1: > - hits[testerPort] =3D True > - break > + out =3D self.tester.send_ping6( > + remotePort, ipv6, > + self.get_mac_address(dutPort)) > + > + if ('64 bytes from' in out): > + self.logger.info("PORT MAP: [dut %d: tester %d]"= % (dutPort, > remotePort)) > + self.ports_map[dutPort] =3D remotePort > + hits[remotePort] =3D True > + if self.crb['IP'] =3D=3D self.crb['tester IP']: > + # remove dut port act as tester port > + remove_port =3D self.get_port_info(remotepci= ) > + if remove_port is not None: > + remove.append(remove_port) > + # skip ping from those port already act as d= ut port > + testerPort =3D self.tester.get_local_index(d= utpci) > + if testerPort !=3D -1: > + hits[testerPort] =3D True > + break >=20 > for port in remove: > self.ports_info.remove(port) > -- > 1.9.3