From 72a482b2918ca706519209440997f689dc5a59fb Mon Sep 17 00:00:00 2001 From: Adrian Chiris Date: Thu, 20 Oct 2016 12:36:03 +0200 Subject: [PATCH] fixed issue where hca_self_test didnt recognize mellanox HCA inbox driver --- small_utils/hca_self_test.ofed | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/small_utils/hca_self_test.ofed b/small_utils/hca_self_test.ofed index 9695fa8..ee0a045 100755 --- a/small_utils/hca_self_test.ofed +++ b/small_utils/hca_self_test.ofed @@ -151,9 +151,15 @@ else exit $EXIT_CODE fi - mlx4_core_ko=`modinfo mlx4_core | grep filename | awk '{print $NF}'` mlx4_core_ko=`readlink -f $mlx4_core_ko` + +# check for inbox driver +is_inbox=0 +if [[ $mlx4_core_ko =~ "/kernel/drivers" ]]; then + is_inbox=1 +fi + if [ $OS_TYPE = "DEBIAN" ]; then RPM_CHECK_FAIL=0 RPM_CUR_BOOTED_KER=1 @@ -188,6 +194,7 @@ else fi fi fi + OFED_VERSION=$(ofed_info 2> /dev/null | head -1) RPM_KER_ARCH=`uname -m` if [ $OS_TYPE = "RED_HAT" ]; then @@ -195,9 +202,13 @@ if [ $OS_TYPE = "RED_HAT" ]; then elif [ $OS_TYPE = "SUSE" ]; then # Have to munge uname output a bit. BOOTED_KER=`uname -r | sed s@-@_@g` -fi +fi -if [ $RPM_USR_VER -eq 0 ] && [ $RPM_KER_VER -eq 0 ]; then +if [ $RPM_KER_VER -eq 0 ] && [ $is_inbox -eq 1 ]; then + RPM_KER_VER=1 +fi + +if [ $RPM_USR_VER -eq 0 ] && [ $RPM_KER_VER -eq 0 ]; then echo -e "Host Driver RPM Check .................. ${red}FAIL" tput sgr0 echo " REASON: no RPMs found" @@ -217,7 +228,9 @@ elif [ $RPM_KER_VER -eq 0 ]; then EXIT_CODE=1 fi -if [ $RPM_KER_VER -ne 0 ]; then +# if not inbox check if driver kernel RPM matches the booted kernel + +if [ $is_inbox -eq 0 ] && [ $RPM_KER_VER -ne 0 ]; then if [ $RPM_CUR_BOOTED_KER -eq 0 ]; then echo -e "Host Driver RPM Check .................. ${red}FAIL" tput sgr0 -- 2.46.0