From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0072.outbound.protection.outlook.com [104.47.0.72]) by dpdk.org (Postfix) with ESMTP id 87F744D3A for ; Sat, 31 Mar 2018 00:55:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=P+jOelw0xvYdXgvADs7n7wHfKQXDEP/u3X/bmmjC7+Q=; b=SEKmFyG+C/4ZGF9q0KR4hJ2JDXoyeC+pCCt67bAdqqa64qZI3prM/HhhaZDo4Kq7EYc9ICfXybieMKDltxOoor9LfwThFKaQTyrRoNECmsUkYspoVVlyX2VqXPzpYTK1t1bwNVCkWaTPJx2/W/Fn2Za1M3knxH6x3QiWDvyYdxM= Received: from DB6PR0501MB2630.eurprd05.prod.outlook.com (10.172.225.12) by DB6PR0501MB2696.eurprd05.prod.outlook.com (10.172.225.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.631.10; Fri, 30 Mar 2018 22:55:54 +0000 Received: from DB6PR0501MB2630.eurprd05.prod.outlook.com ([fe80::6ced:f91b:4e53:b7c]) by DB6PR0501MB2630.eurprd05.prod.outlook.com ([fe80::6ced:f91b:4e53:b7c%17]) with mapi id 15.20.0609.012; Fri, 30 Mar 2018 22:55:54 +0000 From: Ali Alnubani To: "Liu, Yong" , "dts@dpdk.org" CC: "dpdklab@iol.unh.edu" Thread-Topic: [dts] [PATCH for-next v2 2/3] nics/net_device: add a function to get nic speed Thread-Index: AQHTx7+nePlMSbtsbUCnHlbmBcYyWaPpZHQr Date: Fri, 30 Mar 2018 22:55:54 +0000 Message-ID: References: <20180329234744.17716-1-alialnu@mellanox.com> <20180329234744.17716-3-alialnu@mellanox.com>,<5ABDF54D.8000301@intel.com> In-Reply-To: <5ABDF54D.8000301@intel.com> 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=alialnu@mellanox.com; x-originating-ip: [2606:4100:3880:1722:8074:69f0:749d:25bd] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0501MB2696; 7:hiS8ESaXDf5LyJwodvQyyaSk7fDD46FOSPMiV1tp3SpDGJRZH9Cc+BckNi2cKlR6zt8lr+wm8r2pHPc53l/wWyPqk+ibStTWqzquvHlbCIV4jdhsoiYHVZXQMaZSfv6QIfcQujhBN7Se3CAGyjxapVLZUNfEyEujkRrR0tpPyhclBQlXMo0hHU97VtLe8UOW4BbS4EhsPPfuCNu/QoS/l+bf6Oj21TsdvXatBItOWqL+8747HUU/83Qk1vBdvckD x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: fd8fba98-d0ec-4f75-f1ec-08d59691649f x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0501MB2696; x-ms-traffictypediagnostic: DB6PR0501MB2696: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DB6PR0501MB2696; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0501MB2696; x-forefront-prvs: 06274D1C43 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(39380400002)(39860400002)(346002)(376002)(189003)(199004)(110136005)(97736004)(46003)(6246003)(186003)(6116002)(8936002)(81166006)(81156014)(8676002)(53936002)(53546011)(486005)(446003)(11346002)(486005)(102836004)(5660300001)(476003)(86362001)(105586002)(68736007)(14454004)(7696005)(478600001)(99286004)(76176011)(6506007)(55016002)(106356001)(345774005)(6436002)(5250100002)(19627405001)(7736002)(229853002)(6606003)(9686003)(33656002)(54896002)(2501003)(74316002)(25786009)(2900100001)(316002)(3660700001)(3280700002)(4326008)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0501MB2696; H:DB6PR0501MB2630.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Ce6gcA3xHRrs5UHsdRLQbqXuGl+4IordgMptStIw4yXo9bKppsoaRn+kLHFPA2kz5UahsSA785n8qxAE9fG89BbA65C2IoAu+wh+mESxTU8aNOi3pu30I15mom1W2VMrBttnfuLQOfqkKDzJOHiKPf8IRXd5+R97tA3kwNKlojH3O+lHNDOaxezMf/WlymPjXEjCDtrGnU4n8FW0jhJUakRGeda0oe6LIgySLdO8jwFJ1EEIOIsClGBxKb/wBQ/Q5KWYmEFicnmvz/+pkU2To21uVVVGnfJqN3BUPpvsgXhBbK+kP6cNzLeTxsYi8Xq8BAl+1k6zfcMKYFQjdFD2Ha0yEaMbeUxDtomUOC++e1aNFiunLYhPnff6dDRJ44eDlMn4fSa12QZYhcUO0wn/4XiKvTqRNvEwoGdZdTnNYeM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_DB6PR0501MB2630D4231BF2732BF1B77539D7A10DB6PR0501MB2630_" MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: fd8fba98-d0ec-4f75-f1ec-08d59691649f X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Mar 2018 22:55:54.3858 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2696 Subject: Re: [dts] [PATCH for-next v2 2/3] nics/net_device: add a function to get nic speed 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: Fri, 30 Mar 2018 22:55:56 -0000 --_000_DB6PR0501MB2630D4231BF2732BF1B77539D7A10DB6PR0501MB2630_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thank you for pointing that out Marvin. Sent a v3 of the patchset. Regards, Ali ________________________________ From: Liu, Yong Sent: Friday, March 30, 2018 11:29:01 AM To: Ali Alnubani; dts@dpdk.org Cc: dpdklab@iol.unh.edu Subject: Re: [dts] [PATCH for-next v2 2/3] nics/net_device: add a function = to get nic speed Hi Ali, Since kernel module is the precondition of NIC interface, please add wrapper function nic_has_driver. Thanks, Marvin On 03/30/2018 07:47 AM, Ali Alnubani wrote: > Needed to differentiate between nics with same > device identifier, but with different speeds. > > Signed-off-by: Ali Alnubani > --- > nics/net_device.py | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/nics/net_device.py b/nics/net_device.py > index 4861145..0f4bac3 100644 > --- a/nics/net_device.py > +++ b/nics/net_device.py > @@ -539,6 +539,20 @@ class NetDevice(object): > """ > return self.crb.get_pci_dev_id(self.domain_id, self.bus_id, sel= f.devfun_id) > > + def get_nic_speed(self): > + """ > + Get the speed of specified pci device. > + """ > + nic_speed =3D None > + command =3D ('cat /sys/bus/pci/devices/%s\:%s\:%s/net/*/speed' %= ( \ > + self.domain_id, self.bus_id, self.devfun_id)) > + try: > + nic_speed =3D self.__send_expect(command, '# ') > + except Exception as e: > + print 'Failed to get the speed of the pci device [%s:%s:%s]:= %s' \ > + % (self.domain_id, self.bus_id, self.devfun_id, e) > + return nic_speed > + > @nic_has_driver > def get_sriov_vfs_pci(self): > """ --_000_DB6PR0501MB2630D4231BF2732BF1B77539D7A10DB6PR0501MB2630_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Thank you for pointing that out M= arvin.
Sent a v3 of the patchset.

Regards,
Ali


From: Liu, Yong <yong.li= u@intel.com>
Sent: Friday, March 30, 2018 11:29:01 AM
To: Ali Alnubani; dts@dpdk.org
Cc: dpdklab@iol.unh.edu
Subject: Re: [dts] [PATCH for-next v2 2/3] nics/net_device: add a fu= nction to get nic speed
 
Hi Ali,
Since kernel module is the precondition of NIC interface, please add
wrapper function nic_has_driver.

Thanks,
Marvin

On 03/30/2018 07:47 AM, Ali Alnubani wrote:
> Needed to differentiate between nics with same
> device identifier, but with different speeds.
>
> Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
> ---
>   nics/net_device.py | 14 +++++++= ;+++++++
>   1 file changed, 14 insertions(+)
>
> diff --git a/nics/net_device.py b/nics/net_device.py
> index 4861145..0f4bac3 100644
> --- a/nics/net_device.py
> +++ b/nics/net_device.py
> @@ -539,6 +539,20 @@ class NetDevice(object):
>           "&quo= t;"
>           return sel= f.crb.get_pci_dev_id(self.domain_id, self.bus_id, self.devfun_id)
>  
> +    def get_nic_speed(self):
> +        """
> +        Get the speed of speci= fied pci device.
> +        """
> +        nic_speed =3D None
> +        command =3D ('cat /sys= /bus/pci/devices/%s\:%s\:%s/net/*/speed' % ( \
> +           = ;     self.domain_id, self.bus_id, self.devfun_id))
> +        try:
> +           = ; nic_speed =3D self.__send_expect(command, '# ')
> +        except Exception as e:=
> +           = ; print 'Failed to get the speed of the pci device [%s:%s:%s]: %s' \
> +           = ;         % (self.domain_id, self.b= us_id, self.devfun_id, e)
> +        return nic_speed
> +
>       @nic_has_driver
>       def get_sriov_vfs_pci(self):
>           "&quo= t;"

--_000_DB6PR0501MB2630D4231BF2732BF1B77539D7A10DB6PR0501MB2630_--