DPDK patches and discussions
 help / color / mirror / Atom feed
From: qcqx-obaq.6cba8489@hashmail.org
To: dev@dpdk.org
Subject: dpdk-devbind.py ./. bonding interfaces
Date: Sat, 25 Jun 2022 01:13:01 +0200	[thread overview]
Message-ID: <YrZE/aZN09zSDMCr@priv-mua> (raw)


To whom it may concern.

usertools/dpdk-devbind.py currently does not recognize interfaces 
that are part of a bond as active.
that can be a nuisance if you are using something like libmoon which
proactively rebinds drivers for all "not active" interfaces.

yes, i am aware of the dpdk contribution guideline. 

no, i am not going to jump through linux-kernel level hoops for
a trivial 9-sloc-python driveby-contrib.

yes, that glorious code is all written by me, i promise i didnt
steal it, and whoever takes pity and merges it is free to claim
full credits for it.
(if you feel bad about claiming credits for something you didnt
 write, perhaps find more useful names for "f" and "l" and/or
 add some comment above it...)

yes, i promise i will read and respect the contrib guide if i ever
want to contrib code that took longer to write than it takes to
read the contrib guide.

regards,
   x23


diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index 4d9c1be666..d02552de33 100755
--- a/usertools/dpdk-devbind.py
+++ b/usertools/dpdk-devbind.py
@@ -244,6 +244,16 @@ def get_device_details(devices_type):
             if rt_info[i] == "dev":
                 ssh_if.append(rt_info[i + 1])
 
+        bdir = "/proc/net/bonding"
+        if os.path.exists(bdir):
+            for bn in os.listdir(bdir):
+                f = open(os.path.join(bdir, bn))
+                bs = f.read()
+                f.close()
+                for l in bs.splitlines():
+                    if l[:17] == "Slave Interface: ":
+                        ssh_if.append(l[17:])
+
     # based on the basic info, get extended text details
     for d in devices.keys():
         if not device_type_match(devices[d], devices_type):





             reply	other threads:[~2022-06-24 23:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-24 23:13 qcqx-obaq.6cba8489 [this message]
2022-06-29  2:09 ` Stephen Hemminger

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=YrZE/aZN09zSDMCr@priv-mua \
    --to=qcqx-obaq.6cba8489@hashmail.org \
    --cc=dev@dpdk.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).