From: "Mcnamara, John" <john.mcnamara@intel.com>
To: "Mussar, Gary" <gmussar@ciena.com>,
"Dey, Souvik" <sodey@sonusnet.com>,
Stephen Hemminger <stephen@networkplumber.org>
Cc: "nhorman@tuxdriver.com" <nhorman@tuxdriver.com>,
"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface issue.
Date: Thu, 1 Sep 2016 10:59:50 +0000 [thread overview]
Message-ID: <B27915DBBA3421428155699D51E4CFE2025EBB8E@IRSMSX103.ger.corp.intel.com> (raw)
In-Reply-To: <C281A17C31CFD745B242416D0E96EC63AB81F535@ONWVEXCHMB04.ciena.com>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Mussar, Gary
> Sent: Monday, August 29, 2016 4:10 PM
> To: Dey, Souvik <sodey@sonusnet.com>; Stephen Hemminger
> <stephen@networkplumber.org>
> Cc: nhorman@tuxdriver.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface
> issue.
>
> We did this slightly differently. This is 100% python and is a bit more
> general. We search for the first "net" directory under the specific device
> directory.
>
> -------------------------------------------
> --- tools/dpdk-devbind.py 2016-08-29 11:02:35.594202888 -0400
> +++ ../dpdk/tools/dpdk-devbind.py 2016-08-29 11:00:34.897677233 -0400
> @@ -221,11 +221,11 @@
> name = name.strip(":") + "_str"
> device[name] = value
> # check for a unix interface name
> - sys_path = "/sys/bus/pci/devices/%s/net/" % dev_id
> - if exists(sys_path):
> - device["Interface"] = ",".join(os.listdir(sys_path))
> - else:
> - device["Interface"] = ""
> + device["Interface"] = ""
> + for base, dirs, files in os.walk("/sys/bus/pci/devices/%s/" %
> dev_id):
> + if "net" in dirs:
> + device["Interface"] =
> ",".join(os.listdir(os.path.join(base,"net")))
> + break
> # check if a port is used for ssh connection
> device["Ssh_if"] = False
> device["Active"] = ""
> -------------------------------------------
Hi Gary,
That looks like a cleaner solution. Could you submit that as a patch.
Souvik, could you test this patch and confirm it fixes your issue.
Gary, if you submit a patch could you make a few minor changes:
> + device["Interface"] = ""
> + for base, dirs, files in os.walk("/sys/bus/pci/devices/%s/" % dev_id):
> +
If "files" is unused, and it looks like it is, then replace it with "_".
> + device["Interface"] = ",".join(os.listdir(os.path.join(base,"net")))
There is a space required after "," for PEP8 compliance.
John
next prev parent reply other threads:[~2016-09-01 10:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-25 2:25 souvikdey33
2016-08-25 9:51 ` Mcnamara, John
2016-08-25 10:19 ` Thomas Monjalon
2016-08-25 10:27 ` Mcnamara, John
2016-08-26 0:37 ` Stephen Hemminger
2016-08-26 3:59 ` [dpdk-dev] [PATCH v2] tools: fix issue with virtio interfaces souvikdey33
2016-08-26 5:50 ` souvikdey33
2016-08-26 11:35 ` [dpdk-dev] [PATCH v3] " souvikdey33
2016-10-04 9:59 ` Thomas Monjalon
2016-08-26 15:55 ` [dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface issue Stephen Hemminger
2016-08-27 0:20 ` Dey, Souvik
2016-08-29 15:09 ` Mussar, Gary
2016-08-29 23:16 ` Dey, Souvik
2016-08-29 23:33 ` Stephen Hemminger
2016-08-30 12:56 ` Neil Horman
2016-08-30 13:12 ` Mussar, Gary
2016-09-01 10:59 ` Mcnamara, John [this message]
2016-09-01 22:08 ` Dey, Souvik
2016-09-02 12:57 ` Mussar, Gary
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=B27915DBBA3421428155699D51E4CFE2025EBB8E@IRSMSX103.ger.corp.intel.com \
--to=john.mcnamara@intel.com \
--cc=dev@dpdk.org \
--cc=gmussar@ciena.com \
--cc=nhorman@tuxdriver.com \
--cc=sodey@sonusnet.com \
--cc=stephen@networkplumber.org \
/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).