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 C42FC8D96 for ; Tue, 19 Jan 2016 07:05:44 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP; 18 Jan 2016 22:05:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,316,1449561600"; d="scan'208";a="31918711" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga004.fm.intel.com with ESMTP; 18 Jan 2016 22:05:34 -0800 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 18 Jan 2016 22:05:34 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 18 Jan 2016 22:05:33 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.218]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.117]) with mapi id 14.03.0248.002; Tue, 19 Jan 2016 14:05:13 +0800 From: "Liu, Yong" To: Raslan Darawsheh , "Xu, HuilongX" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device Thread-Index: AQHREe2u3sg9m6Nc2kqqFg4rLER7A56BlvIAgAAMOYCAABN+gIAAA2SAgBKfJ4CAbMCmgIABvRYQ Date: Tue, 19 Jan 2016 06:05:13 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E13B1073F@SHSMSX103.ccr.corp.intel.com> References: <1445926076-31279-1-git-send-email-rasland@mellanox.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzE2M2NiMzAtZjhkNy00Zjc2LTlmMTQtZDAwOWMyNjg4MTFlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjQuMTAuMTkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiSkFrR2MrNnpXaVZlOFZIZDNBMTlYRitsRUFpVjJjcGkrbkVUNklVS29VST0ifQ== 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 Cc: "rdarawsheh@asaltech.com" Subject: Re: [dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device 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, 19 Jan 2016 06:05:45 -0000 Hi Darawsheh, We have some questions about your patches. In your patch, crb module will c= heck whether Mellanox nic on board. Crb module focus on board operations in dts design and we do not want to in= volve any NIC concept. For those special NICs, we have created one folder named "nics" for place s= pecial nic modules. Could you please list what's the incompatibilities of dts, we hope to merge= in your patch without change framework design. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Raslan Darawsheh > Sent: Monday, January 18, 2016 7:18 PM > To: Xu, HuilongX; dts@dpdk.org > Cc: rdarawsheh@asaltech.com > Subject: Re: [dts] [PATCH 1/6] framework: crb :add some parameters and > check_Mellanox_pci function to identify mellanox device >=20 > Hi Xu, HuilongX , >=20 > This is a remainder of my patches to support Mellanox NICs in DTS. What > should I be done with them ? >=20 > Kindest regards > Raslan Darawsheh >=20 > -----Original Message----- > From: Raslan Darawsheh > Sent: Tuesday, November 10, 2015 8:33 AM > To: Xu, HuilongX ; dts@dpdk.org > Cc: rdarawsheh@asaltech.com > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and > check_Mellanox_pci function to identify mellanox device >=20 > Hi Xu, HuilongX , >=20 > When do you think you will apply the patches? >=20 > Kindest regards > Raslan Darawsheh >=20 >=20 > -----Original Message----- > From: Xu, HuilongX [mailto:huilongx.xu@intel.com] > Sent: Thursday, October 29, 2015 12:10 PM > To: Raslan Darawsheh; dts@dpdk.org > Cc: rdarawsheh@asaltech.com > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and > check_Mellanox_pci function to identify mellanox device >=20 > Hi Darawsheh, > I am very sorry, I am too careless. > Your changed in function " pci_devices_information_uncached_linux", so > it's no problem Thanks a lot > > -----Original Message----- > > From: Raslan Darawsheh [mailto:rasland@mellanox.com] > > Sent: Thursday, October 29, 2015 5:58 PM > > To: Xu, HuilongX; dts@dpdk.org > > Cc: rdarawsheh@asaltech.com > > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and > > check_Mellanox_pci function to identify mellanox device > > > > Hi Xu, HuilongX, > > > > I think you need to double check the patch, since in this patch it > > doesn't change anything to this function. > > > > Kindest regards > > Raslan Darawsheh > > > > -----Original Message----- > > From: Xu, HuilongX [mailto:huilongx.xu@intel.com] > > Sent: Thursday, October 29, 2015 10:48 AM > > To: Raslan Darawsheh ; dts@dpdk.org > > Cc: rdarawsheh@asaltech.com > > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and > > check_Mellanox_pci function to identify mellanox device > > > > Hi Darawsheh, > > Your changed can't work on FreeBSD OS, but function "get_session_output= " > > in crb.py need work on FreeBSD os. > > Thanks a lot > > > > > -----Original Message----- > > > From: Raslan Darawsheh [mailto:rasland@mellanox.com] > > > Sent: Thursday, October 29, 2015 4:05 PM > > > To: Xu, HuilongX; dts@dpdk.org > > > Cc: rdarawsheh@asaltech.com > > > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters > > > and check_Mellanox_pci function to identify mellanox device > > > > > > Hi Xu, HuilongX , > > > > > > From what I changed it seems that it's only executed over the linux O= S. > > > And there are an already "lspci" command executed inside the function= . > > > Can you explain more ? > > > Kindest regards > > > Raslan Darawsheh > > > > > > -----Original Message----- > > > From: Xu, HuilongX [mailto:huilongx.xu@intel.com] > > > Sent: Thursday, October 29, 2015 4:01 AM > > > To: Raslan Darawsheh ; dts@dpdk.org > > > Cc: rdarawsheh@asaltech.com > > > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters > > > and check_Mellanox_pci function to identify mellanox device > > > > > > > > > Hi darawsheh, > > > Pls see my comments as below., thanks a lot > > > > -----Original Message----- > > > > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Raslan > > > > Darawsheh > > > > Sent: Tuesday, October 27, 2015 2:08 PM > > > > To: dts@dpdk.org > > > > Cc: rdarawsheh@asaltech.com > > > > Subject: [dts] [PATCH 1/6] framework: crb :add some parameters and > > > > check_Mellanox_pci function to identify mellanox device > > > > > > > > From: Raslsn Darawsheh > > > > > > > > Signed-off-by: Raslsn Darawsheh > > > > --- > > > > framework/crb.py | 23 ++++++++++++++++++++++- > > > > 1 file changed, 22 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/framework/crb.py b/framework/crb.py index > > > > fcbd7d9..0acec3b 100644 > > > > --- a/framework/crb.py > > > > +++ b/framework/crb.py > > > > @@ -33,7 +33,7 @@ import time > > > > import dts > > > > import re > > > > import os > > > > -from settings import TIMEOUT, IXIA > > > > +from settings import TIMEOUT, IXIA, NICS > > > > > > > > """ > > > > CRB (customer reference board) basic functions and handlers @@ > > > > -54,6 > > > > +54,9 @@ class Crb(object): > > > > self.skip_setup =3D False > > > > self.serializer =3D serializer > > > > self.ports_info =3D None > > > > + self.isMellanox =3D False > > > > + self.mellanoxPortCount =3D 0 > > > > + self.mellanoxCardType =3D None > > > > > > > > def send_expect(self, cmds, expected, timeout=3DTIMEOUT, > > > > alt_session=3DFalse, verify=3DFalse): > > > > @@ -79,6 +82,19 @@ class Crb(object): > > > > > > > > return self.session.send_command(cmds, timeout) > > > > > > > > + def check_Mellanox_pci(self,pci_bus,pci_id): > > > > + """ > > > > + check if the PCI is Mellanox device or not > > > > + its used to set a flag to handle Mellanox ports differentl= y > > > > + """ > > > > + out =3D self.send_expect("lspci -nn | grep -i " + pci_bus= , > > > > + "# > > ") > > > > + if "Mell" in out: > > > > + self.isMellanox =3DTrue > > > > + if NICS['ConnectX_4'] in out: > > > > + self.mellanoxCardType =3D "cx4" > > > > + else: > > > > + self.mellanoxCardType =3D "cx3" > > > > + > > > > def get_session_output(self, timeout=3DTIMEOUT): > > > > """ > > > > Get session output message before timeout @@ -196,6 > > > > +212,11 @@ class Crb(object): > > > > rexp =3D r"([\da-f]{2}:[\da-f]{2}.\d{1}) .*Eth.*?ernet > > > > .*?([\da- f]{4}:[\da-f]{4})" > > > > pattern =3D re.compile(rexp) > > > > match =3D pattern.findall(out) > > > Could you not changed this function? because it not about dts > > > feature It only a ssh session function, when you exec "lspci" > > > command, freebsd os not support. > > > So some case will failed on freebesd. > > > > + out =3D self.send_expect( > > > > + "lspci -nn ", "# ", alt_session=3DTrue) > > > > + rexp =3D r"([\da-f]{2}:[\da-f]{2}.\d{1}) Network .*?([\da- > > > > f]{4}:[\da-f]{4})" > > > > + pattern =3D re.compile(rexp) > > > > + match +=3D pattern.findall(out) > > > > self.pci_devices_info =3D [] > > > > for i in range(len(match)): > > > > self.pci_devices_info.append((match[i][0], > > > > match[i][1])) > > > > -- > > > > 1.8.3.1