From 58a2e60b961c1ec745439f3f2603591904d65317 Mon Sep 17 00:00:00 2001 From: Jerry Snitselaar Date: Wed, 10 Apr 2024 21:37:59 -0700 Subject: [PATCH] accel-config/test: Don't try to iterate over non-existent devices Fix dsa_user_test_runner so it doesn't attempt to iterate over devices without first checking that there are devices to disable. Resolves: RHEL-32469 Signed-off-by: Jerry Snitselaar --- ...t-Don-t-attempt-to-disable-non-exist.patch | 43 ++ ...g-test-Make-verbose-logging-optional.patch | 484 ++++++++++++++++++ 0003-accel-config-test-Clean-up-typo.patch | 77 +++ accel-config.spec | 14 +- 4 files changed, 615 insertions(+), 3 deletions(-) create mode 100644 0001-accel-config-test-Don-t-attempt-to-disable-non-exist.patch create mode 100644 0002-accel-config-test-Make-verbose-logging-optional.patch create mode 100644 0003-accel-config-test-Clean-up-typo.patch diff --git a/0001-accel-config-test-Don-t-attempt-to-disable-non-exist.patch b/0001-accel-config-test-Don-t-attempt-to-disable-non-exist.patch new file mode 100644 index 0000000..4a64c00 --- /dev/null +++ b/0001-accel-config-test-Don-t-attempt-to-disable-non-exist.patch @@ -0,0 +1,43 @@ +From 3b1faa506dbc47c1f2aeb376ffe92a41eab961b3 Mon Sep 17 00:00:00 2001 +From: Jerry Snitselaar +Date: Wed, 3 Apr 2024 13:06:20 -0700 +Subject: [PATCH 1/3] accel-config/test: Don't attempt to disable non-existent + devices +'Content-type: text/plain' + +Check whether any devices exist before attempting to iterate +over them. + +Signed-off-by: Jerry Snitselaar +--- + test/common | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/test/common b/test/common +index a5a53ec27b08..fd9a3eebdc6b 100755 +--- a/test/common ++++ b/test/common +@@ -122,13 +122,18 @@ check_prereq() + disable_all() { + for device_type in 'dsa' 'iax'; do + # Kernel before 5.13 has dsa and iax bus. Because of ABI change, iax +- # bus is removed. All devices are in /sys/bus/das/devices. ++ # bus is removed. All devices are in /sys/bus/dsa/devices. + if [ -d /sys/bus/iax ] && [ $device_type == 'iax' ]; then + DSA_DEVICE_PATH="/sys/bus/iax/devices" + else + DSA_DEVICE_PATH="/sys/bus/dsa/devices" + fi +- # Get available devices ++ ++ if ! ls "${DSA_DEVICE_PATH}/" | grep -qE "${device_type}[0-9]*"; then ++ continue ++ fi ++ ++ # Get available devices + for device_path in ${DSA_DEVICE_PATH}/${device_type}* ; do + [[ $(echo "$device_path" | grep -c '!') -eq 0 ]] && { + # Get wqs and disable it if the status is enabled +-- +2.44.0 + diff --git a/0002-accel-config-test-Make-verbose-logging-optional.patch b/0002-accel-config-test-Make-verbose-logging-optional.patch new file mode 100644 index 0000000..f3562cd --- /dev/null +++ b/0002-accel-config-test-Make-verbose-logging-optional.patch @@ -0,0 +1,484 @@ +From 089912b1c8f1dab156a699e70e461076df28de97 Mon Sep 17 00:00:00 2001 +From: Jerry Snitselaar +Date: Sat, 13 Apr 2024 00:02:28 -0700 +Subject: [PATCH 2/3] accel-config/test: Make verbose logging optional +'Content-type: text/plain' + +Add option to test scripts to turn on verbose logging using +the option --verbose, and default to bash shopt +x, and +not passing -v to the test executable. + +Signed-off-by: Jerry Snitselaar +--- + test/dsa_config_test_runner.sh | 41 +++++----- + test/dsa_user_test_runner.sh | 53 +++++++------ + test/iaa_user_test_runner.sh | 134 +++++++++++++++++---------------- + 3 files changed, 125 insertions(+), 103 deletions(-) + +diff --git a/test/dsa_config_test_runner.sh b/test/dsa_config_test_runner.sh +index aa02864a3d74..740648a91d94 100755 +--- a/test/dsa_config_test_runner.sh ++++ b/test/dsa_config_test_runner.sh +@@ -1,9 +1,16 @@ +-#!/bin/bash -Ex ++#!/bin/bash -E + # SPDX-License-Identifier: GPL-2.0 + # Copyright(c) 2019-2020 Intel Corporation. All rights reserved. + + . "$(dirname "$0")/common" + ++if [[ $* =~ "--verbose" ]]; then ++ set -x ++ VERBOSE="-v" ++else ++ VERBOSE="" ++fi ++ + DSA=dsa0 + WQ0=wq0.0 + GRP0=group0.0 +@@ -178,8 +185,8 @@ wq_config_test() + fi + "$ACCFG" enable-device $DSA + "$ACCFG" enable-wq $DSA/$WQ0 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x3 -v && echo "shoudl fail, but pass" && exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x1 -b 0x4 -c 2 && ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x3 "${VERBOSE}" && echo "shoudl fail, but pass" && exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x1 -b 0x4 -c 2 "${VERBOSE}" && + echo "shoudl fail, but pass" && exit 1 + "$ACCFG" disable-device $DSA + +@@ -191,9 +198,9 @@ wq_config_test() + fi + "$ACCFG" enable-device $DSA + "$ACCFG" enable-wq $DSA/$WQ0 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x3 || echo "shoudl pass, but fail" || exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x5 && echo "shoudl fail, but pass" && exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x1 -b 0x3 -c 2 && ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x3 "${VERBOSE}" || echo "shoudl pass, but fail" || exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x5 "${VERBOSE}" && echo "shoudl fail, but pass" && exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x1 -b 0x3 -c 2 "${VERBOSE}" && + echo "shoudl fail, but pass" && exit 1 + "$ACCFG" disable-device $DSA + +@@ -205,18 +212,18 @@ wq_config_test() + fi + "$ACCFG" enable-device $DSA + "$ACCFG" enable-wq $DSA/$WQ0 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x0 && echo "shoudl fail, but pass" && exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x2 && echo "shoudl fail, but pass" && exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x3 && echo "shoudl fail, but pass" && exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x7 && echo "shoudl fail, but pass" && exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x8 && echo "shoudl fail, but pass" && exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x4 || echo "shoudl pass, but fail" || exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x5 || echo "shoudl pass, but fail" || exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x6 || echo "shoudl pass, but fail" || exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x9 || echo "shoudl fail, but pass" || exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x1 -b 0x5 -c 2 || ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x0 "${VERBOSE}" && echo "shoudl fail, but pass" && exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x2 "${VERBOSE}" && echo "shoudl fail, but pass" && exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x3 "${VERBOSE}" && echo "shoudl fail, but pass" && exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x7 "${VERBOSE}" && echo "shoudl fail, but pass" && exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x8 "${VERBOSE}" && echo "shoudl fail, but pass" && exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x4 "${VERBOSE}" || echo "shoudl pass, but fail" || exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x5 "${VERBOSE}" || echo "shoudl pass, but fail" || exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x6 "${VERBOSE}" || echo "shoudl pass, but fail" || exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x9 "${VERBOSE}" || echo "shoudl fail, but pass" || exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x1 -b 0x5 -c 2 "${VERBOSE}" || + echo "shoudl pass, but fail" || exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x1 -b 0x9 -c 2 || ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x1 -b 0x9 -c 2 "${VERBOSE}" || + echo "shoudl pass, but fail" || exit 1 + "$ACCFG" disable-device $DSA + fi +diff --git a/test/dsa_user_test_runner.sh b/test/dsa_user_test_runner.sh +index 1e6d3a602a49..2848feda68bb 100755 +--- a/test/dsa_user_test_runner.sh ++++ b/test/dsa_user_test_runner.sh +@@ -1,4 +1,4 @@ +-#!/bin/bash -Ex ++#!/bin/bash -E + # SPDX-License-Identifier: GPL-2.0 + # Copyright(c) 2019-2020 Intel Corporation. All rights reserved. + +@@ -6,15 +6,22 @@ + + rc="$EXIT_SKIP" + +-input1=$1 +-if [ "$input1" == "--skip-config" ]; then +-DEV=`ls /dev/dsa/ | sed -ne 's|wq\([^.]\+\)\(.*\)|dsa\1/wq\1\2|p'` +-DSA=`echo $DEV | cut -f1 -d/` +-echo "$DEV" +-echo "$DSA" ++if [[ $* =~ "--verbose" ]]; then ++ VERBOSE="-v" ++ set -x + else +-DSA=dsa0 +-echo "$DSA" ++ VERBOSE="" ++fi ++ ++if [[ $* =~ "--skip-config" ]]; then ++ SKIPCONFIG="true" ++ DEV=`ls /dev/dsa/ | sed -ne 's|wq\([^.]\+\)\(.*\)|dsa\1/wq\1\2|p'` ++ DSA=`echo $DEV | cut -f1 -d/` ++ echo "$DEV" ++ echo "$DSA" ++else ++ DSA=dsa0 ++ echo "$DSA" + fi + WQ0=wq0.0 + WQ1=wq0.1 +@@ -78,12 +85,12 @@ test_op() + echo "Performing $wq_mode_name WQ $op_name testing" + for xfer_size in $SIZE_1 $SIZE_4K $SIZE_64K $SIZE_1M $SIZE_2M; do + echo "Testing $xfer_size bytes" +- if [ "$input1" == "--skip-config" ]; then ++ if ! test -z "${SKIPCONFIG}"; then + "$DSATEST" -l "$xfer_size" -o "$opcode" \ +- -f "$flag" t200 -v -d "$DEV" ++ -f "$flag" t200 "${VERBOSE}" -d "$DEV" + else + "$DSATEST" -w "$wq_mode_code" -l "$xfer_size" -o "$opcode" \ +- -f "$flag" t200 -v ++ -f "$flag" t200 "${VERBOSE}" + fi + done + done +@@ -112,12 +119,12 @@ test_op_batch() + echo "Performing $wq_mode_name WQ batched $op_name testing" + for xfer_size in $SIZE_1 $SIZE_4K $SIZE_64K $SIZE_1M $SIZE_2M; do + echo "Testing $xfer_size bytes" +- if [ "$input1" == "--skip-config" ]; then ++ if ! test -z "${SKIPCONFIG}"; then + "$DSATEST" -l "$xfer_size" -o 0x1 -b "$opcode" \ +- -c 16 -f "$flag" t2000 -v -d "$DEV" ++ -c 16 -f "$flag" t2000 "${VERBOSE}" -d "$DEV" + else + "$DSATEST" -w "$wq_mode_code" -l "$xfer_size" -o 0x1 -b "$opcode" \ +- -c 16 -f "$flag" t2000 -v ++ -c 16 -f "$flag" t2000 "${VERBOSE}" + fi + done + done +@@ -142,12 +149,12 @@ test_dif_op() + echo "Performing $wq_mode_name WQ $op_name testing" + for xfer_size in $SIZE_512 $SIZE_1K $SIZE_4K; do + echo "Testing $xfer_size bytes" +- if [ "$input1" == "--skip-config" ]; then ++ if ! test -z "${SKIPCONFIG}"; then + "$DSATEST" -l "$xfer_size" -o "$opcode" \ +- -f "$flag" t200 -v -d "$DEV" ++ -f "$flag" t200 "${VERBOSE}" -d "$DEV" + else + "$DSATEST" -w "$wq_mode_code" -l "$xfer_size" -o "$opcode" \ +- -f "$flag" t200 -v ++ -f "$flag" t200 "${VERBOSE}" + fi + done + done +@@ -172,17 +179,17 @@ test_dif_op_batch() + echo "Performing $wq_mode_name WQ batched $op_name testing" + for xfer_size in $SIZE_512 $SIZE_1K $SIZE_4K; do + echo "Testing $xfer_size bytes" +- if [ "$input1" == "--skip-config" ]; then ++ if ! test -z "${SKIPCONFIG}"; then + "$DSATEST" -l "$xfer_size" -o 0x1 -b "$opcode" \ +- -c 16 -f "$flag" t2000 -v -d "$DEV" ++ -c 16 -f "$flag" t2000 "${VERBOSE}" -d "$DEV" + else + "$DSATEST" -w "$wq_mode_code" -l "$xfer_size" -o 0x1 -b "$opcode" \ +- -c 16 -f "$flag" t2000 -v ++ -c 16 -f "$flag" t2000 "${VERBOSE}" + fi + done + done + } +-if [ "$input1" != "--skip-config" ]; then ++if test -z "${SKIPCONFIG}"; then + _cleanup + start_dsa + enable_wqs +@@ -219,7 +226,7 @@ for opcode in "0x12" "0x13" "0x14" "0x15"; do + test_dif_op_batch $opcode $flag + done + +-if [ "$input1" != "--skip-config" ]; then ++if ! $SKIPCONFIG; then + disable_wqs + stop_dsa + _cleanup +diff --git a/test/iaa_user_test_runner.sh b/test/iaa_user_test_runner.sh +index eb9629b4341e..f978b68505e8 100755 +--- a/test/iaa_user_test_runner.sh ++++ b/test/iaa_user_test_runner.sh +@@ -1,4 +1,4 @@ +-#!/bin/bash -Ex ++#!/bin/bash -E + # SPDX-License-Identifier: GPL-2.0 + # Copyright(c) 2019-2020 Intel Corporation. All rights reserved. + +@@ -7,13 +7,21 @@ + rc="$EXIT_SKIP" + + DEV_OPT="" +-input1=$1 +-if [ "$input1" == "--skip-config" ]; then ++ ++if [[ $* =~ "--verbose" ]]; then ++ VERBOSE="-v" ++ set -x ++else ++ VERBOSE="" ++fi ++ ++if [[ $* =~ "--skip-config" ]]; then + DEV=`ls /dev/iax/ | sed -ne 's|wq\([^.]\+\)\(.*\)|iax\1/wq\1\2|p'` + DEV=`echo $DEV | cut -f1 -d' '` + IAA=`echo $DEV | cut -f1 -d/` + DEV_OPT="-d $DEV" + echo "$DEV" ++ SKIPCONFIG="true" + else + IAA=iax1 + fi +@@ -140,10 +148,10 @@ test_op() + if [ "$extra_flag" != "" ] + then + "$IAATEST" -w "$wq_mode_code" -l "$xfer_size" -o "$opcode" \ +- -f "$flag" -1 "$extra_flag" -t 5000 -v $DEV_OPT ++ -f "$flag" -1 "$extra_flag" -t 5000 "${VERBOSE}" $DEV_OPT + else + "$IAATEST" -w "$wq_mode_code" -l "$xfer_size" -o "$opcode" \ +- -f "$flag" -t 5000 -v $DEV_OPT ++ -f "$flag" -t 5000 "${VERBOSE}" $DEV_OPT + fi + done + done +@@ -160,133 +168,133 @@ test_op_filter() + + if [ $((IAA_OPCODE_MASK_SCAN & OP_CAP2)) -ne 0 ]; then + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 512 -2 0x7c \ +- -3 128 -o $IAA_OPCODE_SCAN -t 5000 -v $DEV_OPT ++ -3 128 -o $IAA_OPCODE_SCAN -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 1024 -2 0x7c \ +- -3 256 -o $IAA_OPCODE_SCAN -t 5000 -v $DEV_OPT ++ -3 256 -o $IAA_OPCODE_SCAN -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 4096 -2 0x7c \ +- -3 1024 -o $IAA_OPCODE_SCAN -t 5000 -v $DEV_OPT ++ -3 1024 -o $IAA_OPCODE_SCAN -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 65536 -2 0x7c \ +- -3 16384 -o $IAA_OPCODE_SCAN -t 5000 -v $DEV_OPT ++ -3 16384 -o $IAA_OPCODE_SCAN -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 1048576 -2 0x7c \ +- -3 262144 -o $IAA_OPCODE_SCAN -t 5000 -v $DEV_OPT ++ -3 262144 -o $IAA_OPCODE_SCAN -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 2097152 -2 0x7c \ +- -3 524288 -o $IAA_OPCODE_SCAN -t 5000 -v $DEV_OPT ++ -3 524288 -o $IAA_OPCODE_SCAN -t 5000 "${VERBOSE}" $DEV_OPT + fi + + if [ $((IAA_OPCODE_MASK_SET_MEMBERSHIP & OP_CAP2)) -ne 0 ]; then + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 512 -2 0x38 \ +- -3 256 -o $IAA_OPCODE_SET_MEMBERSHIP -t 5000 -v $DEV_OPT ++ -3 256 -o $IAA_OPCODE_SET_MEMBERSHIP -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 1024 -2 0x38 \ +- -3 512 -o $IAA_OPCODE_SET_MEMBERSHIP -t 5000 -v $DEV_OPT ++ -3 512 -o $IAA_OPCODE_SET_MEMBERSHIP -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 4096 -2 0x38 \ +- -3 2048 -o $IAA_OPCODE_SET_MEMBERSHIP -t 5000 -v $DEV_OPT ++ -3 2048 -o $IAA_OPCODE_SET_MEMBERSHIP -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 65536 -2 0x38 \ +- -3 32768 -o $IAA_OPCODE_SET_MEMBERSHIP -t 5000 -v $DEV_OPT ++ -3 32768 -o $IAA_OPCODE_SET_MEMBERSHIP -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 1048576 -2 0x38 \ +- -3 524288 -o $IAA_OPCODE_SET_MEMBERSHIP -t 5000 -v $DEV_OPT ++ -3 524288 -o $IAA_OPCODE_SET_MEMBERSHIP -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 2097152 -2 0x38 \ +- -3 1048576 -o $IAA_OPCODE_SET_MEMBERSHIP -t 5000 -v $DEV_OPT ++ -3 1048576 -o $IAA_OPCODE_SET_MEMBERSHIP -t 5000 "${VERBOSE}" $DEV_OPT + fi + + if [ $((IAA_OPCODE_MASK_EXTRACT & OP_CAP2)) -ne 0 ]; then + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 512 -2 0x7c \ +- -3 128 -o $IAA_OPCODE_EXTRACT -t 5000 -v $DEV_OPT ++ -3 128 -o $IAA_OPCODE_EXTRACT -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 1024 -2 0x7c \ +- -3 256 -o $IAA_OPCODE_EXTRACT -t 5000 -v $DEV_OPT ++ -3 256 -o $IAA_OPCODE_EXTRACT -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 4096 -2 0x7c \ +- -3 1024 -o $IAA_OPCODE_EXTRACT -t 5000 -v $DEV_OPT ++ -3 1024 -o $IAA_OPCODE_EXTRACT -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 65536 -2 0x7c \ +- -3 16384 -o $IAA_OPCODE_EXTRACT -t 5000 -v $DEV_OPT ++ -3 16384 -o $IAA_OPCODE_EXTRACT -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 1048576 -2 0x7c \ +- -3 262144 -o $IAA_OPCODE_EXTRACT -t 5000 -v $DEV_OPT ++ -3 262144 -o $IAA_OPCODE_EXTRACT -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 2097152 -2 0x7c \ +- -3 524288 -o $IAA_OPCODE_EXTRACT -t 5000 -v $DEV_OPT ++ -3 524288 -o $IAA_OPCODE_EXTRACT -t 5000 "${VERBOSE}" $DEV_OPT + fi + + if [ $((IAA_OPCODE_MASK_SELECT & OP_CAP2)) -ne 0 ]; then + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 512 -2 0x7c \ +- -3 128 -o $IAA_OPCODE_SELECT -t 5000 -v $DEV_OPT ++ -3 128 -o $IAA_OPCODE_SELECT -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 1024 -2 0x7c \ +- -3 256 -o $IAA_OPCODE_SELECT -t 5000 -v $DEV_OPT ++ -3 256 -o $IAA_OPCODE_SELECT -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 4096 -2 0x7c \ +- -3 1024 -o $IAA_OPCODE_SELECT -t 5000 -v $DEV_OPT ++ -3 1024 -o $IAA_OPCODE_SELECT -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 65536 -2 0x7c \ +- -3 16384 -o $IAA_OPCODE_SELECT -t 5000 -v $DEV_OPT ++ -3 16384 -o $IAA_OPCODE_SELECT -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 1048576 -2 0x7c \ +- -3 262144 -o $IAA_OPCODE_SELECT -t 5000 -v $DEV_OPT ++ -3 262144 -o $IAA_OPCODE_SELECT -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 2097152 -2 0x7c \ +- -3 524288 -o $IAA_OPCODE_SELECT -t 5000 -v $DEV_OPT ++ -3 524288 -o $IAA_OPCODE_SELECT -t 5000 "${VERBOSE}" $DEV_OPT + fi + + if [ $((IAA_OPCODE_MASK_RLE_BURST & OP_CAP2)) -ne 0 ]; then + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 512 -2 0x1c \ +- -3 512 -o $IAA_OPCODE_RLE_BURST -t 5000 -v $DEV_OPT ++ -3 512 -o $IAA_OPCODE_RLE_BURST -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 1024 -2 0x1c \ +- -3 1024 -o $IAA_OPCODE_RLE_BURST -t 5000 -v $DEV_OPT ++ -3 1024 -o $IAA_OPCODE_RLE_BURST -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 4096 -2 0x1c \ +- -3 4096 -o $IAA_OPCODE_RLE_BURST -t 5000 -v $DEV_OPT ++ -3 4096 -o $IAA_OPCODE_RLE_BURST -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 32768 -2 0x1c \ +- -3 32768 -o $IAA_OPCODE_RLE_BURST -t 5000 -v $DEV_OPT ++ -3 32768 -o $IAA_OPCODE_RLE_BURST -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 65536 -2 0x1c \ +- -3 65536 -o $IAA_OPCODE_RLE_BURST -t 5000 -v $DEV_OPT ++ -3 65536 -o $IAA_OPCODE_RLE_BURST -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 131072 -2 0x1c \ +- -3 131072 -o $IAA_OPCODE_RLE_BURST -t 5000 -v $DEV_OPT ++ -3 131072 -o $IAA_OPCODE_RLE_BURST -t 5000 "${VERBOSE}" $DEV_OPT + + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 32 -2 0x3c \ +- -3 16 -o $IAA_OPCODE_RLE_BURST -t 5000 -v $DEV_OPT ++ -3 16 -o $IAA_OPCODE_RLE_BURST -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 64 -2 0x3c \ +- -3 32 -o $IAA_OPCODE_RLE_BURST -t 5000 -v $DEV_OPT ++ -3 32 -o $IAA_OPCODE_RLE_BURST -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 128 -2 0x3c \ +- -3 64 -o $IAA_OPCODE_RLE_BURST -t 5000 -v $DEV_OPT ++ -3 64 -o $IAA_OPCODE_RLE_BURST -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 256 -2 0x3c \ +- -3 128 -o $IAA_OPCODE_RLE_BURST -t 5000 -v $DEV_OPT ++ -3 128 -o $IAA_OPCODE_RLE_BURST -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 512 -2 0x3c \ +- -3 256 -o $IAA_OPCODE_RLE_BURST -t 5000 -v $DEV_OPT ++ -3 256 -o $IAA_OPCODE_RLE_BURST -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 1024 -2 0x3c \ +- -3 512 -o $IAA_OPCODE_RLE_BURST -t 5000 -v $DEV_OPT ++ -3 512 -o $IAA_OPCODE_RLE_BURST -t 5000 "${VERBOSE}" $DEV_OPT + + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 64 -2 0x7c \ +- -3 16 -o $IAA_OPCODE_RLE_BURST -t 5000 -v $DEV_OPT ++ -3 16 -o $IAA_OPCODE_RLE_BURST -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 128 -2 0x7c \ +- -3 32 -o $IAA_OPCODE_RLE_BURST -t 5000 -v $DEV_OPT ++ -3 32 -o $IAA_OPCODE_RLE_BURST -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 256 -2 0x7c \ +- -3 64 -o $IAA_OPCODE_RLE_BURST -t 5000 -v $DEV_OPT ++ -3 64 -o $IAA_OPCODE_RLE_BURST -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 512 -2 0x7c \ +- -3 128 -o $IAA_OPCODE_RLE_BURST -t 5000 -v $DEV_OPT ++ -3 128 -o $IAA_OPCODE_RLE_BURST -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 1024 -2 0x7c \ +- -3 256 -o $IAA_OPCODE_RLE_BURST -t 5000 -v $DEV_OPT ++ -3 256 -o $IAA_OPCODE_RLE_BURST -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 2048 -2 0x7c \ +- -3 512 -o $IAA_OPCODE_RLE_BURST -t 5000 -v $DEV_OPT ++ -3 512 -o $IAA_OPCODE_RLE_BURST -t 5000 "${VERBOSE}" $DEV_OPT + fi + + if [ $((IAA_OPCODE_MASK_FIND_UNIQUE & OP_CAP2)) -ne 0 ]; then + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 512 -2 0x38 \ +- -3 256 -o $IAA_OPCODE_FIND_UNIQUE -t 5000 -v $DEV_OPT ++ -3 256 -o $IAA_OPCODE_FIND_UNIQUE -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 1024 -2 0x38 \ +- -3 512 -o $IAA_OPCODE_FIND_UNIQUE -t 5000 -v $DEV_OPT ++ -3 512 -o $IAA_OPCODE_FIND_UNIQUE -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 4096 -2 0x38 \ +- -3 2048 -o $IAA_OPCODE_FIND_UNIQUE -t 5000 -v $DEV_OPT ++ -3 2048 -o $IAA_OPCODE_FIND_UNIQUE -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 65536 -2 0x38 \ +- -3 32768 -o $IAA_OPCODE_FIND_UNIQUE -t 5000 -v $DEV_OPT ++ -3 32768 -o $IAA_OPCODE_FIND_UNIQUE -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 1048576 -2 0x38 \ +- -3 524288 -o $IAA_OPCODE_FIND_UNIQUE -t 5000 -v $DEV_OPT ++ -3 524288 -o $IAA_OPCODE_FIND_UNIQUE -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 2097152 -2 0x38 \ +- -3 1048576 -o $IAA_OPCODE_FIND_UNIQUE -t 5000 -v $DEV_OPT ++ -3 1048576 -o $IAA_OPCODE_FIND_UNIQUE -t 5000 "${VERBOSE}" $DEV_OPT + fi + + if [ $((IAA_OPCODE_MASK_EXPAND & OP_CAP2)) -ne 0 ]; then + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 512 -2 0x7c \ +- -3 128 -o $IAA_OPCODE_EXPAND -t 5000 -v $DEV_OPT ++ -3 128 -o $IAA_OPCODE_EXPAND -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 1024 -2 0x7c \ +- -3 256 -o $IAA_OPCODE_EXPAND -t 5000 -v $DEV_OPT ++ -3 256 -o $IAA_OPCODE_EXPAND -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 4096 -2 0x7c \ +- -3 1024 -o $IAA_OPCODE_EXPAND -t 5000 -v $DEV_OPT ++ -3 1024 -o $IAA_OPCODE_EXPAND -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 65536 -2 0x7c \ +- -3 16384 -o $IAA_OPCODE_EXPAND -t 5000 -v $DEV_OPT ++ -3 16384 -o $IAA_OPCODE_EXPAND -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 1048576 -2 0x7c \ +- -3 262144 -o $IAA_OPCODE_EXPAND -t 5000 -v $DEV_OPT ++ -3 262144 -o $IAA_OPCODE_EXPAND -t 5000 "${VERBOSE}" $DEV_OPT + "$IAATEST" -w "$wq_mode_code" -f "$flag" -l 2097152 -2 0x7c \ +- -3 524288 -o $IAA_OPCODE_EXPAND -t 5000 -v $DEV_OPT ++ -3 524288 -o $IAA_OPCODE_EXPAND -t 5000 "${VERBOSE}" $DEV_OPT + fi + done + } +@@ -308,7 +316,7 @@ test_op_crypto() + echo "Testing $xfer_size bytes" + + "$IAATEST" -w "$wq_mode_code" -l "$xfer_size" -o "$opcode" \ +- -f "$flag" -a "$aecs_flag" -t 5000 -v $DEV_OPT ++ -f "$flag" -a "$aecs_flag" -t 5000 "${VERBOSE}" $DEV_OPT + done + done + } +@@ -329,12 +337,12 @@ test_op_transl_fetch() + echo "Testing $xfer_size bytes" + + "$IAATEST" -w "$wq_mode_code" -l "$xfer_size" -o "$opcode" \ +- -f "$flag" -t 5000 -v $DEV_OPT ++ -f "$flag" -t 5000 "${VERBOSE}" $DEV_OPT + done + done + } + +-if [ "$input1" != "--skip-config" ]; then ++if test -z "${SKIPCONFIG}"; then + _cleanup + start_iaa + enable_wqs +@@ -487,7 +495,7 @@ if [ $((IAA_OPCODE_MASK_TRANSL_FETCH & OP_CAP0)) -ne 0 ]; then + test_op_transl_fetch $IAA_OPCODE_TRANSL_FETCH $flag + fi + +-if [ "$input1" != "--skip-config" ]; then ++if test -z "${SKIPCONFIG}"; then + disable_wqs + stop_iaa + _cleanup +-- +2.44.0 + diff --git a/0003-accel-config-test-Clean-up-typo.patch b/0003-accel-config-test-Clean-up-typo.patch new file mode 100644 index 0000000..cc15857 --- /dev/null +++ b/0003-accel-config-test-Clean-up-typo.patch @@ -0,0 +1,77 @@ +From 6c37d05e3387c0cd9109587fb5065f1ececec22a Mon Sep 17 00:00:00 2001 +From: Jerry Snitselaar +Date: Sat, 13 Apr 2024 01:38:38 -0700 +Subject: [PATCH 3/3] accel-config/test: Clean up typo +'Content-type: text/plain' + +Replace "shoudl" with "should" in dsa_conf_test_runner.sh + +Signed-off-by: Jerry Snitselaar +--- + test/dsa_config_test_runner.sh | 32 ++++++++++++++++---------------- + 1 file changed, 16 insertions(+), 16 deletions(-) + +diff --git a/test/dsa_config_test_runner.sh b/test/dsa_config_test_runner.sh +index 740648a91d94..103f1ee25530 100755 +--- a/test/dsa_config_test_runner.sh ++++ b/test/dsa_config_test_runner.sh +@@ -185,9 +185,9 @@ wq_config_test() + fi + "$ACCFG" enable-device $DSA + "$ACCFG" enable-wq $DSA/$WQ0 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x3 "${VERBOSE}" && echo "shoudl fail, but pass" && exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x3 "${VERBOSE}" && echo "should fail, but pass" && exit 1 + "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x1 -b 0x4 -c 2 "${VERBOSE}" && +- echo "shoudl fail, but pass" && exit 1 ++ echo "should fail, but pass" && exit 1 + "$ACCFG" disable-device $DSA + + "$ACCFG" config-wq $DSA/$WQ0 -g 0 -m dedicated -y user -n app1 -d user -p 10 -o 8 +@@ -198,10 +198,10 @@ wq_config_test() + fi + "$ACCFG" enable-device $DSA + "$ACCFG" enable-wq $DSA/$WQ0 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x3 "${VERBOSE}" || echo "shoudl pass, but fail" || exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x5 "${VERBOSE}" && echo "shoudl fail, but pass" && exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x3 "${VERBOSE}" || echo "should pass, but fail" || exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x5 "${VERBOSE}" && echo "should fail, but pass" && exit 1 + "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x1 -b 0x3 -c 2 "${VERBOSE}" && +- echo "shoudl fail, but pass" && exit 1 ++ echo "should fail, but pass" && exit 1 + "$ACCFG" disable-device $DSA + + "$ACCFG" config-wq $DSA/$WQ0 -g 0 -m dedicated -y user -n app1 -d user -p 10 -o 272 +@@ -212,19 +212,19 @@ wq_config_test() + fi + "$ACCFG" enable-device $DSA + "$ACCFG" enable-wq $DSA/$WQ0 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x0 "${VERBOSE}" && echo "shoudl fail, but pass" && exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x2 "${VERBOSE}" && echo "shoudl fail, but pass" && exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x3 "${VERBOSE}" && echo "shoudl fail, but pass" && exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x7 "${VERBOSE}" && echo "shoudl fail, but pass" && exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x8 "${VERBOSE}" && echo "shoudl fail, but pass" && exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x4 "${VERBOSE}" || echo "shoudl pass, but fail" || exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x5 "${VERBOSE}" || echo "shoudl pass, but fail" || exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x6 "${VERBOSE}" || echo "shoudl pass, but fail" || exit 1 +- "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x9 "${VERBOSE}" || echo "shoudl fail, but pass" || exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x0 "${VERBOSE}" && echo "should fail, but pass" && exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x2 "${VERBOSE}" && echo "should fail, but pass" && exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x3 "${VERBOSE}" && echo "should fail, but pass" && exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x7 "${VERBOSE}" && echo "should fail, but pass" && exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x8 "${VERBOSE}" && echo "should fail, but pass" && exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x4 "${VERBOSE}" || echo "should pass, but fail" || exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x5 "${VERBOSE}" || echo "should pass, but fail" || exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x6 "${VERBOSE}" || echo "should pass, but fail" || exit 1 ++ "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x9 "${VERBOSE}" || echo "should fail, but pass" || exit 1 + "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x1 -b 0x5 -c 2 "${VERBOSE}" || +- echo "shoudl pass, but fail" || exit 1 ++ echo "should pass, but fail" || exit 1 + "$DSATEST" -w 0 -l 4096 -f 0x1 -o 0x1 -b 0x9 -c 2 "${VERBOSE}" || +- echo "shoudl pass, but fail" || exit 1 ++ echo "should pass, but fail" || exit 1 + "$ACCFG" disable-device $DSA + fi + } +-- +2.44.0 + diff --git a/accel-config.spec b/accel-config.spec index 8323fc9..009eb9b 100644 --- a/accel-config.spec +++ b/accel-config.spec @@ -2,12 +2,16 @@ Name: accel-config Version: 4.1.6 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Configure accelerator subsystem devices License: GPL-2.0-only URL: https://github.com/intel/%{project_name} Source0: %{URL}/archive/%{name}-v%{version}.tar.gz - +# submitted upstream: https://github.com/intel/idxd-config/pull/62 +Patch0: 0001-accel-config-test-Don-t-attempt-to-disable-non-exist.patch +# submitted upstream: https://github.com/intel/idxd-config/pull/63 +Patch1: 0002-accel-config-test-Make-verbose-logging-optional.patch +Patch2: 0003-accel-config-test-Clean-up-typo.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} BuildRequires: gcc BuildRequires: autoconf @@ -59,7 +63,7 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release} Tests for accel-config command. %prep -%autosetup -n %{project_name}-%{name}-v%{version} +%autosetup -p1 -n %{project_name}-%{name}-v%{version} %build echo %{version} > version @@ -99,6 +103,10 @@ make check %{_libexecdir}/accel-config/test/* %changelog +* Wed Apr 10 2024 Jerry Snitselaar - 4.1.6-2 +- Fix issue with dsa_user_test_runner device clean up. +Resolves: RHEL-32469 + * Sun Mar 24 2024 Jerry Snitselaar - 4.1.6-1 - Rebase to 4.1.6 release Resolves: RHEL-29909