From: <pbhagavatula@marvell.com>
To: <jerinj@marvell.com>
Cc: <dev@dpdk.org>, Pavan Nikhilesh <pbhagavatula@marvell.com>,
"Phanendra Vukkisala" <pvukkisala@marvell.com>
Subject: [dpdk-dev] [PATCH] usertools: enhance device bind script module detection
Date: Sat, 21 Sep 2019 23:46:26 +0530 [thread overview]
Message-ID: <20190921181626.13034-1-pbhagavatula@marvell.com> (raw)
From: Pavan Nikhilesh <pbhagavatula@marvell.com>
Some kernel modules have '-' in their name when populated in
'/sys/bus/pci/drivers/' where as the kernel always populates
'/sys/modules/' with '_'.
Replace '-' in module name with '_' to avoid script complaining
that module not loaded.
Signed-off-by: Phanendra Vukkisala <pvukkisala@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
usertools/dpdk-devbind.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index 7b5cbc12c..b1d149876 100755
--- a/usertools/dpdk-devbind.py
+++ b/usertools/dpdk-devbind.py
@@ -153,6 +153,9 @@ def check_output(args, stderr=None):
def module_is_loaded(module):
global loaded_modules
+ if module == 'vfio_pci':
+ module = 'vfio-pci'
+
if loaded_modules:
return module in loaded_modules
@@ -520,7 +523,7 @@ def bind_all(dev_list, driver, force=False):
pass
# check if we're attempting to bind to a driver that isn't loaded
- if not module_is_loaded(driver):
+ if not module_is_loaded(driver.replace('-','_')):
sys.exit("Error: Driver '%s' is not loaded." % driver)
try:
--
2.17.1
next reply other threads:[~2019-09-21 18:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-21 18:16 pbhagavatula [this message]
2019-10-27 20:20 ` Thomas Monjalon
2019-11-02 14:23 ` [dpdk-dev] [PATCH v2] " pbhagavatula
2019-11-26 22:55 ` Thomas Monjalon
2019-10-28 14:50 [dpdk-dev] [PATCH] " Pavan Nikhilesh Bhagavatula
2019-10-28 17:09 ` Thomas Monjalon
2019-10-28 17:10 ` Thomas Monjalon
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=20190921181626.13034-1-pbhagavatula@marvell.com \
--to=pbhagavatula@marvell.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=pvukkisala@marvell.com \
/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).