DPDK patches and discussions
 help / color / mirror / Atom feed
* Re: [dpdk-dev] [PATCH] usertools: enhance device bind script module detection
@ 2019-10-28 14:50 Pavan Nikhilesh Bhagavatula
  2019-10-28 17:09 ` Thomas Monjalon
  0 siblings, 1 reply; 5+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-10-28 14:50 UTC (permalink / raw)
  To: Thomas Monjalon, Phanendra Vukkisala; +Cc: dev, Jerin Jacob Kollanukkaran

>21/09/2019 20:16, pbhagavatula@marvell.com:
>> 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.
>
>Sorry it does not look obvious to me.
>Please, could you describe what is wrong and what is the real cause?
>

dpdk-devbind.py can also be used to bind devices to kernel modules.
Some kernel modules are registered with '-' in their name and are populated 
with '-' in '/sys/bus/pci/drivers/' but kernel populates the name in /sys/modules/ as '_'

This confuses the current script making it unable to bind to such modules. The patch 
addresses it by always replacing '-' with '_' when looking in /sys/modules/

Hope this clears things up.

Pavan.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] usertools: enhance device bind script module detection
  2019-10-28 14:50 [dpdk-dev] [PATCH] usertools: enhance device bind script module detection Pavan Nikhilesh Bhagavatula
@ 2019-10-28 17:09 ` Thomas Monjalon
  2019-10-28 17:10   ` Thomas Monjalon
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Monjalon @ 2019-10-28 17:09 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula
  Cc: Phanendra Vukkisala, dev, Jerin Jacob Kollanukkaran

28/10/2019 15:50, Pavan Nikhilesh Bhagavatula:
> >21/09/2019 20:16, pbhagavatula@marvell.com:
> >> 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.
> >
> >Sorry it does not look obvious to me.
> >Please, could you describe what is wrong and what is the real cause?
> >
> 
> dpdk-devbind.py can also be used to bind devices to kernel modules.
> Some kernel modules are registered with '-' in their name and are populated 
> with '-' in '/sys/bus/pci/drivers/' but kernel populates the name in /sys/modules/ as '_'

Sorry, still not clear.
What do you mean by "registered"?

> This confuses the current script making it unable to bind to such modules. The patch 
> addresses it by always replacing '-' with '_' when looking in /sys/modules/

Yes this sentence is clear (except it is /sys/module/).
Please send a v2 with a clear explanation.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] usertools: enhance device bind script module detection
  2019-10-28 17:09 ` Thomas Monjalon
@ 2019-10-28 17:10   ` Thomas Monjalon
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2019-10-28 17:10 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula
  Cc: Phanendra Vukkisala, dev, Jerin Jacob Kollanukkaran

28/10/2019 18:09, Thomas Monjalon:
> 28/10/2019 15:50, Pavan Nikhilesh Bhagavatula:
> > >21/09/2019 20:16, pbhagavatula@marvell.com:
> > >> 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.
> > >
> > >Sorry it does not look obvious to me.
> > >Please, could you describe what is wrong and what is the real cause?
> > >
> > 
> > dpdk-devbind.py can also be used to bind devices to kernel modules.
> > Some kernel modules are registered with '-' in their name and are populated 
> > with '-' in '/sys/bus/pci/drivers/' but kernel populates the name in /sys/modules/ as '_'
> 
> Sorry, still not clear.
> What do you mean by "registered"?
> 
> > This confuses the current script making it unable to bind to such modules. The patch 
> > addresses it by always replacing '-' with '_' when looking in /sys/modules/
> 
> Yes this sentence is clear (except it is /sys/module/).
> Please send a v2 with a clear explanation.


Sorry, forgot to insist:
You must start the description with what is wrong.
You can describe the bug you are experiencing.

Thanks



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] usertools: enhance device bind script module detection
  2019-09-21 18:16 pbhagavatula
@ 2019-10-27 20:20 ` Thomas Monjalon
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2019-10-27 20:20 UTC (permalink / raw)
  To: pbhagavatula, Phanendra Vukkisala; +Cc: dev, jerinj

21/09/2019 20:16, pbhagavatula@marvell.com:
> 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.

Sorry it does not look obvious to me.
Please, could you describe what is wrong and what is the real cause?



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH] usertools: enhance device bind script module detection
@ 2019-09-21 18:16 pbhagavatula
  2019-10-27 20:20 ` Thomas Monjalon
  0 siblings, 1 reply; 5+ messages in thread
From: pbhagavatula @ 2019-09-21 18:16 UTC (permalink / raw)
  To: jerinj; +Cc: dev, Pavan Nikhilesh, Phanendra Vukkisala

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-28 17:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-28 14:50 [dpdk-dev] [PATCH] usertools: enhance device bind script module detection Pavan Nikhilesh Bhagavatula
2019-10-28 17:09 ` Thomas Monjalon
2019-10-28 17:10   ` Thomas Monjalon
  -- strict thread matches above, loose matches on Subject: below --
2019-09-21 18:16 pbhagavatula
2019-10-27 20:20 ` Thomas Monjalon

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).