DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Loc Nguyen <locnguyen@niometrics.com>
Cc: thomas@monjalon.net, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] usertools: add device index for dpdk-devbind script
Date: Tue, 4 Jun 2019 08:50:38 -0700	[thread overview]
Message-ID: <20190604085038.6e5a0ab4@hermes.lan> (raw)
In-Reply-To: <20190603125736.48511-1-locnguyen@niometrics.com>

On Mon,  3 Jun 2019 20:57:36 +0800
Loc Nguyen <locnguyen@niometrics.com> wrote:

> Add a device index in front of the PCI ID for easy counting
> 
> Network devices using DPDK-compatible driver
> ============================================
>  0: 0000:07:00.0 ...
>  1: 0000:07:00.1 ...
> 
> Signed-off-by: Loc Nguyen <locnguyen@niometrics.com>
> ---
>  usertools/dpdk-devbind.py | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
> index 9e79f0d28..21da3deca 100755
> --- a/usertools/dpdk-devbind.py
> +++ b/usertools/dpdk-devbind.py
> @@ -534,7 +534,9 @@ def display_devices(title, dev_list, extra_params=None):
>                  strings.append("%s '%s'" % (dev["Slot"], dev["Device_str"]))
>      # sort before printing, so that the entries appear in PCI order
>      strings.sort()
> -    print("\n".join(strings))  # print one per line
> +    # add device index in front of each device
> +    enum_dev_list = ['%2d' % index + ": " + device for index, device in enumerate(strings)]
> +    print("\n".join(enum_dev_list))  # print one per line
>  
>  def show_device_status(devices_type, device_name):
>      global dpdk_drivers

This is a bad idea. it is making assumption about how ports are ordered which
can change if their are other busses, whitelist/blackst or the device may be owned.

Longer term, I want DPDK to get away from using and exposing portid's as the
preferred API to applications.

      parent reply	other threads:[~2019-06-04 15:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-03 12:57 Loc Nguyen
2019-06-04 10:01 ` Bruce Richardson
2019-06-04 13:35   ` Loc Nguyen
2019-06-04 15:50 ` Stephen Hemminger [this message]

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=20190604085038.6e5a0ab4@hermes.lan \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=locnguyen@niometrics.com \
    --cc=thomas@monjalon.net \
    /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).