diff --git a/actions/scripts/oc_jenkins.sh b/actions/scripts/oc_jenkins.sh index 9889771a1..09da13371 100755 --- a/actions/scripts/oc_jenkins.sh +++ b/actions/scripts/oc_jenkins.sh @@ -66,10 +66,11 @@ function test_all_actions() # $1 = card, $2 = accel for action in $MY_ACTION ; do run_test=1; case $action in - *"10142000") - test_10142000 $card $accel - RC=$? - run_test=0 + *"10142000") # HDL Example + cmd="./actions/hdl_example/tests/hw_test.sh" + #test_10142000 $card $accel + #RC=$? + #run_test=0 ;; *"10142002") # HDL NVMe example cmd="./actions/hdl_single_engine/tests/hw_general_test.sh" diff --git a/software/tools/oc_find_card b/software/tools/oc_find_card index 7a5ce1c86..3c9a1bff3 100755 --- a/software/tools/oc_find_card +++ b/software/tools/oc_find_card @@ -30,8 +30,9 @@ normal=$(tput sgr0) # v2.0 : modified Jan 16th 2018 to have -v option providing extra information # v2.1 : modified Feb 26th 2020 adding AD9Hx in CAPI2 and OC modes # v2.2 : modified March 19th 2020 adding -t (accel type) option; this is to prevent reporting 2 cards (1 CAPI2, 1 OpenCAPI) as only 1 card with 2 characteristics (both have $card ID=0) +# v2.3 : modified April 17th 2020 adding -d (debug) option; Displays DEBUG additional info -version=2.2 +version=2.3 accel=UNKNOWN VERBOSE=0 @@ -39,6 +40,7 @@ VERBOSE=0 function usage() { echo "Usage: $PROGRAM" echo " [-v] Prints extra information (to be put as first param)" + echo " [-d] Debug mode to display additional system info" echo " [-A] use either ADKU3, N250S, S121B_BPIx16, S121B_SPIx4, AD8K5, RCXVUP, FX609, S241, N250SP, AD9V3, OC-AD9V3, AD9H3, OC-AD9H3, AD9H7, OC-AD9H7, U200 or ALL" echo " [-C] <0..3> Print accelerator name for this Card" echo " [-t] <1..3> Specifies the Type of CAPI: CAPI1.0, CAPI2.0 or OPENCAPI (CAPI3.0)" @@ -268,12 +270,104 @@ function detect_oc_card_name() PROGRAM=$0 CardOption=0 type=0 -while getopts ":vA:C:Vht:" opt; do +while getopts ":vA:C:Vdht:" opt; do case ${opt} in v) VERBOSE=1 echo oc_find_card version is $version ;; + d) + DEBUG=1 + DistribLike=`{ [ -f /etc/os-release ] && grep '^ID=' /etc/os-release | cut -d= -f2 ; } || { [ -f /etc/system-release ] && cat /etc/system-release ; }` + if (echo $DistribLike | egrep -qi 'centos|fedora|rhel'); then DistribLike=fedora; PackageCmd="rpm -qva | grep -i" + elif (echo $DistribLike | egrep -qi 'ubuntu|debian'); then DistribLike=debian; PackageCmd="dpkg -l | grep -i" + else DistribLike=unknown; PackageCmd="echo 'Unknown Distribution !'" + fi + + echo;echo "###########################################################################################################" + echo;echo "( ͡° ͜ʖ ͡°) DEBUG INFO (more info if run as root)" + echo + echo "===========================================================================================================" + echo "FIRMWARE INFO:" + echo "--------------" + echo + echo "Active SKIBOOT firmware release: `cat /proc/device-tree/ibm,opal/firmware/version | tr -d '\0'` (/proc/device-tree/ibm,opal/firmware/version)" # tr strips NUL bytes (ubuntu warns if not doing) + echo "(Active and LSMCode SKIBOOT may be different if a custom SKIBOOT has been applyied. The 'Active' one is the really running one)" + echo + echo "LSMCODE output:" + lsmcode + echo + echo "Testing /proc/device-tree/ibm,secureboot/secure-enabled existence:" + if [ -f /proc/device-tree/ibm,secureboot/secure-enabled ]; then + echo " file exists ==> Secure-Boot ENABLED" + else + echo " file doesn't exist ==> Secure-Boot DISABLED" + fi + + echo + echo "===========================================================================================================" + echo "OS INFO:" + echo "--------" + echo + echo "LINUX distribution: `{ [ -f /etc/os-release ] && grep PRETTY_NAME /etc/os-release | cut -d= -f2 ; } || { [ -f /etc/system-release ] && cat /etc/system-release ; }`" + echo "LINUX version: `{ [ -f /etc/os-release ] && grep '^VERSION=' /etc/os-release | cut -d= -f2 ; } || { [ -f /etc/system-release ] && cat /etc/system-release ; }`" + echo "OS KERNEL release: `uname -r`"; echo + + echo + echo "CXL / OCXL installed packages:" + eval $PackageCmd cxl + + echo + echo "===========================================================================================================" + echo "PCI ACCELERATOR CARDS:" + echo "----------------------" + echo + echo "PCI cards detected (lspci):" + lspci -nn | grep -i accelerator + echo "(0632: CAPI card, 062b: OPENCAPI card)" + echo + echo "Card installed on non-CAPI PCI slot (dmesg):" + dmesg | grep incompatible + echo + echo "CAPI /dev/cxl directory:" + ls -la /dev/cxl + echo + echo "CAPI /sys/class/cxl directory:" + ls -la /sys/class/cxl + echo + echo "OPENCAPI /dev/ocxl directory:" + ls -la /dev/ocxl + echo + echo "OPENCAPI /sys/class/ocxl directory:" + ls -la /sys/class/ocxl + echo + echo "EEH_MAX_FREEZES: default number of resets allowed per PCI device per hour (/sys/kernel/debug/powerpc/eeh_max_freezes)" + PCIMaxReset=`[ -f /sys/kernel/debug/powerpc/eeh_max_freezes ] && cat /sys/kernel/debug/powerpc/eeh_max_freezes` + printf "%d ($PCIMaxReset)\n" $PCIMaxReset + echo + + echo + echo "===========================================================================================================" + echo "OPAL MSGLOG:" + echo "------------" + echo + echo "Looking for 'degraded':" + grep -i degraded /sys/firmware/opal/msglog + echo + echo "Looking for 'OCAPI':" + grep OCAPI /sys/firmware/opal/msglog + echo + echo "OCAPI link information:" + grep OCAPI /sys/firmware/opal/msglog | grep link + + echo + echo "===========================================================================================================" + echo "More info could be found in /sys/firmware/opal/msglog rolling file (firmware journal)" + echo "or with dmesg (kernel journal) or journalctl (systemd journal) commands" + echo + echo "( ͡° ͜ʖ ͡°) END OF DEBUG INFO" + echo;echo "###########################################################################################################" + ;; A) accel=${OPTARG}; ;;