From: Ali Alnubani <alialnu@mellanox.com>
To: "Liu, Yong" <yong.liu@intel.com>, "dts@dpdk.org" <dts@dpdk.org>
Cc: "dpdklab@iol.unh.edu" <dpdklab@iol.unh.edu>
Subject: Re: [dts] [PATCH for-next v2 2/3] nics/net_device: add a function to get nic speed
Date: Fri, 30 Mar 2018 22:55:54 +0000 [thread overview]
Message-ID: <DB6PR0501MB2630D4231BF2732BF1B77539D7A10@DB6PR0501MB2630.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <5ABDF54D.8000301@intel.com>
[-- Attachment #1: Type: text/plain, Size: 1762 bytes --]
Thank you for pointing that out Marvin.
Sent a v3 of the patchset.
Regards,
Ali
________________________________
From: Liu, Yong <yong.liu@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 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 <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):
> """
> return self.crb.get_pci_dev_id(self.domain_id, self.bus_id, self.devfun_id)
>
> + def get_nic_speed(self):
> + """
> + Get the speed of specified pci device.
> + """
> + nic_speed = None
> + command = ('cat /sys/bus/pci/devices/%s\:%s\:%s/net/*/speed' % ( \
> + self.domain_id, self.bus_id, self.devfun_id))
> + try:
> + nic_speed = 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):
> """
[-- Attachment #2: Type: text/html, Size: 3810 bytes --]
next prev parent reply other threads:[~2018-03-30 22:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-29 23:47 [dts] [PATCH for-next v2 0/3] nic_single_core_perf: add support for Mellanox's nics Ali Alnubani
2018-03-29 23:47 ` [dts] [PATCH for-next v2 1/3] framework/project_dpdk: pass modprobe if driver is mlx5_core Ali Alnubani
2018-03-29 23:47 ` [dts] [PATCH for-next v2 2/3] nics/net_device: add a function to get nic speed Ali Alnubani
2018-03-30 8:29 ` Liu, Yong
2018-03-30 22:55 ` Ali Alnubani [this message]
2018-03-29 23:47 ` [dts] [PATCH for-next v2 3/3] nic_single_core_perf: add support for Mellanox's nics Ali Alnubani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DB6PR0501MB2630D4231BF2732BF1B77539D7A10@DB6PR0501MB2630.eurprd05.prod.outlook.com \
--to=alialnu@mellanox.com \
--cc=dpdklab@iol.unh.edu \
--cc=dts@dpdk.org \
--cc=yong.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).