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 1C2272BE6 for ; Tue, 12 Apr 2016 05:41:48 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP; 11 Apr 2016 20:41:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,471,1455004800"; d="scan'208";a="782950752" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga003.jf.intel.com with ESMTP; 11 Apr 2016 20:41:24 -0700 Received: from fmsmsx151.amr.corp.intel.com (10.18.125.4) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 11 Apr 2016 20:41:24 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX151.amr.corp.intel.com (10.18.125.4) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 11 Apr 2016 20:41:24 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.136]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.10]) with mapi id 14.03.0248.002; Tue, 12 Apr 2016 11:41:22 +0800 From: "Liu, Yong" To: "Ding, HengX" , "dts@dpdk.org" CC: "Ding, HengX" Thread-Topic: [dts] [PATCH] dut.py: sort port list to ensure RRC nics will be configured correctly Thread-Index: AQHRlFwMC+VvIM78ME6iHE9y397dQp+FsQ0Q Date: Tue, 12 Apr 2016 03:41:22 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E14EF0C60@SHSMSX101.ccr.corp.intel.com> References: <1460425081-7185-1-git-send-email-hengx.ding@intel.com> In-Reply-To: <1460425081-7185-1-git-send-email-hengx.ding@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTg1MDdhMWQtMDgxYi00OGNhLWIxZWMtMDljNDNmY2JmZTVkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjlFQjZCV2JvdDBLXC90MzBiT0lFaDJ5cVQzcFBxSWZHTnNuRW1rRDZxaVo0PSJ9 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] dut.py: sort port list to ensure RRC nics will be configured correctly 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: Tue, 12 Apr 2016 03:41:49 -0000 Hi Heng, I think we do not need to sort all ports in self.pci_devices_info. Only nee= d to swap the first port and second port of RRC nic. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Ding Heng > Sent: Tuesday, April 12, 2016 9:38 AM > To: dts@dpdk.org > Cc: Ding, HengX > Subject: [dts] [PATCH] dut.py: sort port list to ensure RRC nics will be > configured correctly >=20 > Signed-off-by: Ding Heng >=20 > diff --git a/framework/dut.py b/framework/dut.py > index bd437cb..291fef0 100644 > --- a/framework/dut.py > +++ b/framework/dut.py > @@ -627,6 +627,20 @@ class Dut(Crb): > """ > Scan ports information or just read it from cache file. > """ > + #sort ports and ensure that first port of RRC nics will be > + #initialized first > + sorted_ports =3D [] > + ports_cfg =3D self.conf.get_ports_config() > + for port_cfg_all in ports_cfg.keys(): > + if 'tp_path' in ports_cfg[port_cfg_all].keys(): > + for port in self.pci_devices_info: > + sorted_port =3D [port] > + if port_cfg_all in port: > + self.pci_devices_info.remove(port) > + for i in self.pci_devices_info: > + sorted_port.append(i) > + self.pci_devices_info =3D sorted_port > + > if self.read_cache: > self.load_serializer_ports() > self.scan_ports_cached() > -- > 1.9.3