From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 011CD5682 for ; Thu, 29 Oct 2015 03:00:45 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 28 Oct 2015 19:00:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,212,1444719600"; d="scan'208";a="837586337" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga002.jf.intel.com with ESMTP; 28 Oct 2015 19:00:45 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 28 Oct 2015 19:00:44 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.96]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.47]) with mapi id 14.03.0248.002; Thu, 29 Oct 2015 10:00:42 +0800 From: "Xu, HuilongX" To: Raslan Darawsheh , "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: AQHREH3w843ExTKm50eynoTaC3FvTZ6Bt7Tw Date: Thu, 29 Oct 2015 02:00:41 +0000 Message-ID: References: <1445926076-31279-1-git-send-email-rasland@mellanox.com> In-Reply-To: <1445926076-31279-1-git-send-email-rasland@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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: Thu, 29 Oct 2015 02:00:46 -0000 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 >=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 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 +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 @@ 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 n= ot 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