DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wiles, Keith" <keith.wiles@intel.com>
To: "Hunt, David" <david.hunt@intel.com>
Cc: "Burakov, Anatoly" <anatoly.burakov@intel.com>,
	dev <dev@dpdk.org>, "Mcnamara, John" <john.mcnamara@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	"Yigit, Ferruh" <ferruh.yigit@intel.com>
Subject: Re: [dpdk-dev] [PATCH] devbind: don't display non-existent device	categories
Date: Thu, 15 Nov 2018 14:06:18 +0000	[thread overview]
Message-ID: <7E971A8F-C647-454B-B396-A6E7CBA97D53@intel.com> (raw)
In-Reply-To: <c516730b-f9d0-426d-e2d1-fbbfd315ec82@intel.com>



> On Nov 15, 2018, at 7:27 AM, Hunt, David <david.hunt@intel.com> wrote:
> 
> Hi Anatoly,
> 
> On 13/11/2018 4:42 PM, Anatoly Burakov wrote:
>> If there aren't any devices of a particular category on user's
>> system, we still display them, which is bad for usability. Fix
>> devbind to not print out a category unless there are devices in
>> it.
>> 
>> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
>> ---
>>  usertools/dpdk-devbind.py | 27 ++++++++++++++++++++-------
>>  1 file changed, 20 insertions(+), 7 deletions(-)
>> 
>> diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
>> index 7d564634c..9f190e227 100755
>> --- a/usertools/dpdk-devbind.py
>> +++ b/usertools/dpdk-devbind.py
>> @@ -546,14 +546,27 @@ def show_device_status(devices_type, device_name):
>>              else:
>>                  kernel_drv.append(devices[d])
>>  +    n_devs = len(dpdk_drv) + len(kernel_drv) + len(no_drv)
>> +
>> +    # don't bother displaying anything if there are no devices
>> +    if n_devs == 0:
>> +        msg = "No '%s' devices detected" % device_name
>> +	print("")
>> +	print(msg)
>> +	print("".join('=' * len(msg)))
>> +        return
>> +
>>      # print each category separately, so we can clearly see what's used by DPDK
>> -    display_devices("%s devices using DPDK-compatible driver" % device_name,
>> -                    dpdk_drv, "drv=%(Driver_str)s unused=%(Module_str)s")
>> -    display_devices("%s devices using kernel driver" % device_name, kernel_drv,
>> -                    "if=%(Interface)s drv=%(Driver_str)s "
>> -                    "unused=%(Module_str)s %(Active)s")
>> -    display_devices("Other %s devices" % device_name, no_drv,
>> -                    "unused=%(Module_str)s")
>> +    if len(dpdk_drv) != 0:
>> +        display_devices("%s devices using DPDK-compatible driver" % device_name,
>> +                        dpdk_drv, "drv=%(Driver_str)s unused=%(Module_str)s")
>> +    if len(kernel_drv) != 0:
>> +        display_devices("%s devices using kernel driver" % device_name, kernel_drv,
>> +                        "if=%(Interface)s drv=%(Driver_str)s "
>> +                        "unused=%(Module_str)s %(Active)s")
>> +    if len(no_drv) != 0:
>> +        display_devices("Other %s devices" % device_name, no_drv,
>> +                        "unused=%(Module_str)s")
>>    def show_status():
>>      '''Function called when the script is passed the "--status" option.
> 
> 
> I REALLY like this patch. It makes the dpdk-devbind output MUCH more readable!
> 

I even modified my version of dpdk-devbind to do just that as it keep scrolling off the screen. I was going to get around to sending a patch. :-)

The output should be a compressed as possible, to me even the ‘=======‘ lines are not required if you indented the information lines by a couple spaces. But that does not need to be done in this patch.

> Reviewed-by: David Hunt <david.hunt@intel.com>

Regards,
Keith


  reply	other threads:[~2018-11-15 14:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-13 16:42 Anatoly Burakov
2018-11-15 13:27 ` Hunt, David
2018-11-15 14:06   ` Wiles, Keith [this message]
2018-11-18 23:13 ` Thomas Monjalon
2018-11-19 10:03   ` Burakov, Anatoly
2018-11-19 10:33 ` [dpdk-dev] [PATCH v2] " Anatoly Burakov
2018-11-22 17:12   ` Thomas Monjalon
2018-11-23  9:23     ` Burakov, Anatoly

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=7E971A8F-C647-454B-B396-A6E7CBA97D53@intel.com \
    --to=keith.wiles@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=john.mcnamara@intel.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).