dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: <dev@dpdk.org>, Robin Jarry <rjarry@redhat.com>
Subject: Re: [PATCH v2 1/2] usertools/devbind: update coding style
Date: Wed, 4 Dec 2024 10:02:03 +0100	[thread overview]
Message-ID: <b02ffb39-2005-4c50-8f9d-94c1963427ce@intel.com> (raw)
In-Reply-To: <20241203141632.34eb2d28@hermes.local>

On 12/3/2024 11:16 PM, Stephen Hemminger wrote:
> On Tue,  3 Dec 2024 11:25:00 +0000
> Anatoly Burakov <anatoly.burakov@intel.com> wrote:
> 
>> Devbind is one of the oldest tools in DPDK, and is written in a way that
>> uses a lot of string matching, no type safety, lots of global variables,
>> and has a few inconsistencies in the way it handles data (such as
>> differences between lspci calls and parsing in different circumstances).
>>
>> This patch is a nigh complete rewrite of devbind, with full 100% feature
>> and command-line compatibility with the old version (except for dropping
>> older kernel support), albeit with a few differences in formatting and
>> error messages. All file handling code has also been replaced with
>> context managers.
>>
>> What's different from old code:
>> - Full PEP-484 compliance
>> - Formatted with Ruff
>> - Much better structured code
>> - Clean and consistent control flow
>> - More comments
>> - Better error handling
>> - Fewer lspci calls
>> - Unified lspci parsing
>> - Using /sys/bus/pci/drivers as a source of truth about kernel modules
>> - Check for iproute2 package
>> - Use JSON parsing for iproute2 output
>> - Deprecate --status-dev in favor of optional --status argument
>> - Deprecate kernel <3.15 support and only use driver_override
>>
>> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
>> ---
> 
> Looks great, like it.
> 
> Only suggestion (which you can ignore) would be to make DevbindCtx
> an object with methods bind_devices and print_status, that might simplify.

The intention was that DevbindCtx is for processing command-line 
configuration and for keeping reference to Devbind which does actual 
work. I feel like the only thing it will simplify is instead of passing 
ctx around we'll be passing self. I will look into it though, maybe 
there are some opportunities that I'm missing.

> 
> Reviewed-by: Stephen HEmminger <stephen@networkplumber.org>

Thanks!

-- 
Thanks,
Anatoly

  reply	other threads:[~2024-12-04  9:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-02 15:09 [PATCH v1 0/1] Rewrite devbind Anatoly Burakov
2024-12-02 15:09 ` [PATCH v1 1/1] usertools/devbind: update coding style Anatoly Burakov
2024-12-02 17:01   ` Stephen Hemminger
2024-12-03  8:55     ` Burakov, Anatoly
2024-12-02 16:14 ` [PATCH v1 0/1] Rewrite devbind Bruce Richardson
2024-12-03  8:51   ` Burakov, Anatoly
2024-12-02 16:54 ` Stephen Hemminger
2024-12-03 11:24 ` [PATCH v2 0/2] " Anatoly Burakov
2024-12-03 11:25   ` [PATCH v2 1/2] usertools/devbind: update coding style Anatoly Burakov
2024-12-03 17:07     ` Stephen Hemminger
2024-12-04  8:59       ` Burakov, Anatoly
2024-12-03 22:16     ` Stephen Hemminger
2024-12-04  9:02       ` Burakov, Anatoly [this message]
2024-12-03 11:25   ` [PATCH v2 2/2] usertools/devbind: replace devbind Anatoly Burakov
2024-12-04  9:45 ` [PATCH v3 0/1] Rewrite devbind Anatoly Burakov
2024-12-04  9:45   ` [PATCH v3 1/1] usertools/devbind: replace devbind Anatoly Burakov
2024-12-04  9:48   ` [PATCH v3 0/1] Rewrite devbind Burakov, Anatoly
2024-12-04  9:47 ` [PATCH v3 0/2] " Anatoly Burakov
2024-12-04  9:47   ` [PATCH v3 1/2] usertools/devbind: update coding style Anatoly Burakov
2024-12-04  9:47   ` [PATCH v3 2/2] usertools/devbind: replace devbind Anatoly Burakov
2025-02-18  9:29   ` [PATCH v3 0/2] Rewrite devbind 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=b02ffb39-2005-4c50-8f9d-94c1963427ce@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=rjarry@redhat.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).