Commit e3580da1 authored by Liang Yan's avatar Liang Yan Committed by Daniel Verkamp
Browse files

test: Use lspci to discover default kernel drivers



Instead of searching /sys for devices and checking which
driver happens to be loaded, use lspci. The lspci tool is
a bit smarter - it knows which driver is loaded now but
also which driver is the default driver the kernel wants
to load for that type of device. It's that default that
we need.

Change-Id: I1dc01ab6eac233e85f42316567bde2f4ed2203c6
Signed-off-by: default avatarLiang Yan <liang.z.yan@intel.com>
parent dca887b7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ function detect_mellanox_nics()
	# for nvmf target loopback test, suppose we only have one type of card.
	for nvmf_nic_bdf in $nvmf_nic_bdfs
	do
		result=`find /sys -name $nvmf_nic_bdf | grep driver | awk -F / '{ print $6 }'`
		result=`lspci -vvv -s $nvmf_nic_bdf | grep 'Kernel modules' | awk -F ' ' '{print $3}'`
		if [ "$result" == "mlx5_core" ]; then
			mlx_core_driver="mlx5_core"
			mlx_ib_driver="mlx5_ib"