From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from emea01-db3-obe.outbound.protection.outlook.com (mail-db3on0090.outbound.protection.outlook.com [157.55.234.90]) by dpdk.org (Postfix) with ESMTP id A9A65374E for ; Thu, 29 Oct 2015 09:04:41 +0100 (CET) Received: from VI1PR05MB1583.eurprd05.prod.outlook.com (10.164.86.17) by VI1PR05MB1519.eurprd05.prod.outlook.com (10.164.85.149) with Microsoft SMTP Server (TLS) id 15.1.306.13; Thu, 29 Oct 2015 08:04:40 +0000 Received: from VI1PR05MB1582.eurprd05.prod.outlook.com (10.164.86.16) by VI1PR05MB1583.eurprd05.prod.outlook.com (10.164.86.17) with Microsoft SMTP Server (TLS) id 15.1.306.13; Thu, 29 Oct 2015 08:04:39 +0000 Received: from VI1PR05MB1582.eurprd05.prod.outlook.com ([10.164.86.16]) by VI1PR05MB1582.eurprd05.prod.outlook.com ([10.164.86.16]) with mapi id 15.01.0306.003; Thu, 29 Oct 2015 08:04:39 +0000 From: Raslan Darawsheh To: "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: AQHREH3w843ExTKm50eynoTaC3FvTZ6Bt7TwgABnFDA= Date: Thu, 29 Oct 2015 08:04:38 +0000 Message-ID: References: <1445926076-31279-1-git-send-email-rasland@mellanox.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rasland@mellanox.com; x-originating-ip: [188.225.180.234] x-microsoft-exchange-diagnostics: 1; VI1PR05MB1583; 5:qtuGgF+2q05XM3Qzsw2uZNvZjg3kSq5I2BfL64HTGPl+iHJJRHPsxBGzRAeNZyPVRpIR/nGVl8KyvUE3qtZmjIP/1kRWgU952ahngreM3hSCPCcgXcZqOAHLx1aTuM5RR94qDZsIB7owSfpbqPJjfw==; 24:vAPZ+/7DhP7D42v7DT0a5duDCh0zhRzmnQhUL2UsHXDna7V8zmFgxaQ5qYsSKqfjca2jEOtjXjm7NEnqRVSBuo26QsblVWLd8GqX0C9maoA=; 20:vMn6rj+bGz3dKVS8obhSwDumQNQDEYMLzjakrtvbrYqF85BOs5URQoeG65IPAsydifh3aMpXvIUVHg7hbmZhIw== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR05MB1583; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(34787635062028); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(520078)(3002001)(10201501046)(102215026); SRVR:VI1PR05MB1583; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB1583; x-forefront-prvs: 0744CFB5E8 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(13464003)(377454003)(189002)(199003)(66066001)(5004730100002)(189998001)(92566002)(5007970100001)(76576001)(11100500001)(5003600100002)(5001770100001)(81156007)(5002640100001)(74316001)(97736004)(87936001)(5008740100001)(5001960100002)(2950100001)(76176999)(50986999)(101416001)(10400500002)(54356999)(122556002)(106116001)(40100003)(2900100001)(105586002)(77096005)(33656002)(2501003)(86362001)(19580395003)(106356001)(102836002)(19580405001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB1583; H:VI1PR05MB1582.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2015 08:04:38.9390 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB1583 X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB1519; 2:bYsdytb7z9jUQpv9NY6m9BFipgA4nk/i+Et2xxqPWjyxvj/VREWEAYZ1UNrHXOtEMftlS+OLOHfyMyRS4lqt1v/q3qShAsBAgG/Dq56JWeafp6gR3zq5KHLfQWxg6cxVTKi9UhbINpCVkXqXGBDkoaMYN3Q4wrLRn4FO7rfF4zI=; 23:n2WKLd96kEi2Zma27mjDjmDEvhpqhpJ6xkZaF7H54+CLwgIKFLlJTH5WMU2ZMPxtYsKthiCDsXuqUdHR1+n91oNfKnkWDl7eO+VkmT42pPpDu43mKsP8YlSqxuqjwgfy+zQYKE3G2ynxg8oT+KvFDfkSW/wzxo6ay7yE/E/Td0Jlgwexc2/Tl5LNP9KJiB90 X-OriginatorOrg: Mellanox.com 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: Thu, 29 Oct 2015 08:04:41 -0000 Hi Xu, HuilongX , >>From what I changed it seems that it's only executed over the linux OS. And= there are an already "lspci" command executed inside the function.=20 Can you explain more ? Kindest regards=20 Raslan Darawsheh -----Original Message----- From: Xu, HuilongX [mailto:huilongx.xu@intel.com]=20 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 chec= k_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=20 > check_Mellanox_pci function to identify mellanox device >=20 > From: Raslsn Darawsheh >=20 > Signed-off-by: Raslsn Darawsheh > --- > framework/crb.py | 23 ++++++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) >=20 > diff --git a/framework/crb.py b/framework/crb.py index=20 > 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 >=20 > """ > CRB (customer reference board) basic functions and handlers @@ -54,6=20 > +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 >=20 > def send_expect(self, cmds, expected, timeout=3DTIMEOUT, > alt_session=3DFalse, verify=3DFalse): > @@ -79,6 +82,19 @@ class Crb(object): >=20 > return self.session.send_command(cmds, timeout) >=20 > + 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 differently > + """ > + 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=20 > @@ class Crb(object): > rexp =3D r"([\da-f]{2}:[\da-f]{2}.\d{1}) .*Eth.*?ernet=20 > .*?([\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 on= ly a ssh session function, when you exec "lspci" command, freebsd os not su= pport. 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