[v5,6/8] devtools/test-null: load all drivers from directory

Message ID 20201015150554.950838-7-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series Rework build macros |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Bruce Richardson Oct. 15, 2020, 3:05 p.m. UTC
  Rather than specifying specific drivers in the driver directory to load, we
can just pass in the whole driver directory to the "-d" EAL flag, causing
all drivers to load. This makes the load of driver independent of any
specific driver names.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 devtools/test-null.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon Oct. 19, 2020, 4:58 p.m. UTC | #1
15/10/2020 17:05, Bruce Richardson:
> Rather than specifying specific drivers in the driver directory to load, we
> can just pass in the whole driver directory to the "-d" EAL flag, causing
> all drivers to load. This makes the load of driver independent of any
> specific driver names.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> --- a/devtools/test-null.sh
> +++ b/devtools/test-null.sh
>  if ldd $testpmd | grep -q librte_ ; then
>  	export LD_LIBRARY_PATH=$build/drivers:$build/lib:$LD_LIBRARY_PATH
> -	libs='-d librte_mempool_ring.so -d librte_pmd_null.so'
> +	libs="-d $build/drivers"

In this case, can we remove $build/drivers from LD_LIBRARY_PATH?
  
Bruce Richardson Oct. 20, 2020, 8:37 a.m. UTC | #2
On Mon, Oct 19, 2020 at 06:58:32PM +0200, Thomas Monjalon wrote:
> 15/10/2020 17:05, Bruce Richardson:
> > Rather than specifying specific drivers in the driver directory to load, we
> > can just pass in the whole driver directory to the "-d" EAL flag, causing
> > all drivers to load. This makes the load of driver independent of any
> > specific driver names.
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> > --- a/devtools/test-null.sh
> > +++ b/devtools/test-null.sh
> >  if ldd $testpmd | grep -q librte_ ; then
> >  	export LD_LIBRARY_PATH=$build/drivers:$build/lib:$LD_LIBRARY_PATH
> > -	libs='-d librte_mempool_ring.so -d librte_pmd_null.so'
> > +	libs="-d $build/drivers"
> 
> In this case, can we remove $build/drivers from LD_LIBRARY_PATH?
>
I think it's safer to keep it, as some drivers depend upon others, e.g.
many NIC/crypto/etc drivers depend upon pci or vdev bus drivers. Therefore
depending on the order in which the drivers load, they will have unmet
dependencies which will be found by looking in LD_LIBRARY_PATH

/Bruce
  
Thomas Monjalon Oct. 20, 2020, 10:01 a.m. UTC | #3
20/10/2020 10:37, Bruce Richardson:
> On Mon, Oct 19, 2020 at 06:58:32PM +0200, Thomas Monjalon wrote:
> > 15/10/2020 17:05, Bruce Richardson:
> > > Rather than specifying specific drivers in the driver directory to load, we
> > > can just pass in the whole driver directory to the "-d" EAL flag, causing
> > > all drivers to load. This makes the load of driver independent of any
> > > specific driver names.
> > > 
> > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > > ---
> > > --- a/devtools/test-null.sh
> > > +++ b/devtools/test-null.sh
> > >  if ldd $testpmd | grep -q librte_ ; then
> > >  	export LD_LIBRARY_PATH=$build/drivers:$build/lib:$LD_LIBRARY_PATH
> > > -	libs='-d librte_mempool_ring.so -d librte_pmd_null.so'
> > > +	libs="-d $build/drivers"
> > 
> > In this case, can we remove $build/drivers from LD_LIBRARY_PATH?
> >
> I think it's safer to keep it, as some drivers depend upon others, e.g.
> many NIC/crypto/etc drivers depend upon pci or vdev bus drivers. Therefore
> depending on the order in which the drivers load, they will have unmet
> dependencies which will be found by looking in LD_LIBRARY_PATH

Yes but this test is only for null PMD so I did the change.
  

Patch

diff --git a/devtools/test-null.sh b/devtools/test-null.sh
index 548de8113..1a6950f39 100755
--- a/devtools/test-null.sh
+++ b/devtools/test-null.sh
@@ -21,7 +21,7 @@  fi
 
 if ldd $testpmd | grep -q librte_ ; then
 	export LD_LIBRARY_PATH=$build/drivers:$build/lib:$LD_LIBRARY_PATH
-	libs='-d librte_mempool_ring.so -d librte_pmd_null.so'
+	libs="-d $build/drivers"
 else
 	libs=
 fi