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 v1 1/1] usertools/devbind: update coding style
Date: Tue, 3 Dec 2024 09:55:30 +0100 [thread overview]
Message-ID: <6ca32de7-dcf8-4135-8e14-454947a025f8@intel.com> (raw)
In-Reply-To: <20241202090137.4a02a9f6@hermes.local>
On 12/2/2024 6:01 PM, Stephen Hemminger wrote:
> On Mon, 2 Dec 2024 15:09:34 +0000
> Anatoly Burakov <anatoly.burakov@intel.com> wrote:
>
>> + # For kernels < 3.15 when binding devices to a generic driver (i.e. one that doesn't have a PCI
>> + # ID table) using new_id, some devices that are not bound to any other driver could be bound
>> + # even if no one has asked them to. hence, we check the list of drivers again, and see if some
>> + # of the previously-unbound devices were erroneously bound.
>> + if not devbind.use_driver_override:
>
> Why is tool still supporting out of date and no longer supported kernel?
The aim was 100% compatibility with the old script, but I agree these
parts can be taken out as this kernel is no longer supported. This will
definitely make the binding code simpler.
>
>
>
>> + choices=[
>> + "baseband",
>> + "compress",
>> + "crypto",
>> + "dma",
>> + "event",
>> + "mempool",
>> + "misc",
>> + "net",
>> + "regex",
>> + "ml",
>> + "all",
>> + ],
>
> Would prefer that all the types are in table/list and the help just
> references that list. The next time a type is added, only one place
> needs to change.
It's a bit difficult to have *everything* as one list, as there are
multiple places where we use this:
1) initial declarations at the top of the file (which I treat as "ground
truth" for what sort of devices devbind aims to recognize)
2) categorization rules (which are inside Devbind class)
3) command line arguments
4) printouts
I suppose I can merge 3 and 4, but I don't see a neat way to specify 1)
and 2) in a way that we can reuse elsewhere. I'll think on this though,
thanks for the suggestion.
>
> Also, I would not trust the output format of ip route not to change.
> If the utility has to parse output of ip command, use json (-j) instead.
>
> This whole section of code is quite fragile:
>
>> if devices_type == network_devices:
>> # check what is the interface if any for an ssh connection if
>> # any to this host, so we can mark it later.
>> ssh_if = []
>> route = subprocess.check_output(["ip", "-o", "route"])
>> # filter out all lines for 169.254 routes
>> route = "\n".join(filter(lambda ln: not ln.startswith("169.254"),
>> route.decode().splitlines()))
>> rt_info = route.split()
>> for i in range(len(rt_info) - 1):
>> if rt_info[i] == "dev":
>> ssh_if.append(rt_info[i + 1])
The quoted code is from old devbind code, but I agree that relying on -o
output is not ideal, and using -j will be better. I'll fix it in v2.
Thanks for your feedback!
--
Thanks,
Anatoly
next prev parent reply other threads:[~2024-12-03 8:55 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 [this message]
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
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=6ca32de7-dcf8-4135-8e14-454947a025f8@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).