Skip to content

Commit

Permalink
idxd: Add iax_user_test.sh
Browse files Browse the repository at this point in the history
Add the iax test script and related configs for IAX tests.

Signed-off-by: Yi Sun <[email protected]>
  • Loading branch information
ysun committed May 30, 2024
1 parent 1349b2b commit adc61c6
Show file tree
Hide file tree
Showing 4 changed files with 669 additions and 16 deletions.
80 changes: 80 additions & 0 deletions BM/dsa/configs/2g2q_user_1.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
[
{
"dev":"dsa0",
"read_buffer_limit":0,
"groups":[
{
"dev":"group0.0",
"read_buffers_reserved":0,
"use_read_buffer_limit":0,
"read_buffers_allowed":8,
"grouped_workqueues":[
{
"dev":"wq0.0",
"mode":"shared",
"size":16,
"group_id":0,
"priority":10,
"block_on_fault":1,
"type":"user",
"driver_name":"user",
"name":"app1",
"threshold":15
}
],
"grouped_engines":[
{
"dev":"engine0.0",
"group_id":0
},
{
"dev":"engine0.1",
"group_id":0
}
]
},
{
"dev":"group0.1",
"read_buffers_reserved":0,
"use_read_buffer_limit":0,
"read_buffers_allowed":8,
"grouped_workqueues":[
{
"dev":"wq0.1",
"mode":"dedicated",
"size":16,
"group_id":1,
"priority":10,
"block_on_fault":1,
"type":"user",
"driver_name":"user",
"name":"app2",
"threshold":0
}
],
"grouped_engines":[
{
"dev":"engine0.2",
"group_id":1
},
{
"dev":"engine0.3",
"group_id":1
}
]
},
{
"dev":"group0.2",
"read_buffers_reserved":0,
"use_read_buffer_limit":0,
"read_buffers_allowed":8,
},
{
"dev":"group0.3",
"read_buffers_reserved":0,
"use_read_buffer_limit":0,
"read_buffers_allowed":8,
}
]
}
]
81 changes: 81 additions & 0 deletions BM/dsa/configs/2g2q_user_2.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
[
{
"dev":"iax1",
"groups":[
{
"dev":"group1.0",
},
{
"dev":"group1.1",
"grouped_workqueues":[
{
"dev":"wq1.1",
"mode":"dedicated",
"size":16,
"group_id":1,
"priority":10,
"block_on_fault":1,
"max_transfer_size":4194304,
"type":"user",
"name":"wq1.1",
"driver_name":"user",
"threshold":0,
}
],
"grouped_engines":[
{
"dev":"engine1.1",
"group_id":1
}
]
},
{
"dev":"group1.2",
"grouped_workqueues":[
{
"dev":"wq1.4",
"mode":"shared",
"size":40,
"group_id":2,
"priority":10,
"block_on_fault":1,
"max_transfer_size":4194304,
"type":"user",
"name":"wq1.4",
"driver_name":"user",
"threshold":40,
}
],
"grouped_engines":[
{
"dev":"engine1.3",
"group_id":2
}
]
},
{
"dev":"group1.3",
}
],
"ungrouped_engines":[
{
"dev":"engine1.0"
},
{
"dev":"engine1.2"
},
{
"dev":"engine1.4"
},
{
"dev":"engine1.5"
},
{
"dev":"engine1.6"
},
{
"dev":"engine1.7"
}
]
}
]
29 changes: 13 additions & 16 deletions BM/dsa/dsa_user_test.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
#!/usr/bin/env bash

#
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2021 Intel Corporation
#
# Description: Call dsa_test to run dsa user test

source "$PWD/$DIRNAME/../common/common.sh"

set -x

DIRNAME=`dirname $0`
DSA_DIR=$PWD/$DIRNAME
CONFIG_DIR=$DSA_DIR/configs
DIRNAME=$(dirname "$0")
DSA_DIR="$PWD/$DIRNAME"
CONFIG_DIR="$DSA_DIR/configs"
ACCFG=/usr/bin/accel-config
TEST_DIR=/usr/libexec/accel-config/test
DSATEST=$TEST_DIR/dsa_test

source "$PWD/$DIRNAME/../common/common.sh"
############################# FUNCTIONS #######################################

# Global variables
Expand Down Expand Up @@ -172,24 +169,24 @@ disable_all() {
DSA_DEVICE_PATH="/sys/bus/dsa/devices"
fi
# Get available devices
for device_path in ${DSA_DEVICE_PATH}/${device_type}* ; do
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
for wqp in ${device_path}/wq* ; do
for wqp in "${device_path}"/wq* ; do
[[ $( cat "${wqp}"/state ) == "enabled" ]] && {
wq=${wqp##${DSA_DEVICE_PATH}/}
wq=${wqp##"${DSA_DEVICE_PATH}"/}
test_print_trc "info:disable wq $wq"
"$ACCFG" disable-wq "${wq}"
echo "-1" > "${wqp}"/group_id
}
done
# Disable device
[[ $( cat "${device_path}"/state ) == "enabled" ]] && {
test_print_trc "info:disable ${device_path##${DSA_DEVICE_PATH}/}"
"$ACCFG" disable-device "${device_path##${DSA_DEVICE_PATH}/}"
test_print_trc "info:disable ${device_path##"${DSA_DEVICE_PATH}"/}"
"$ACCFG" disable-device "${device_path##"${DSA_DEVICE_PATH}"/}"
}
# Remove group id of engine
for engine in ${device_path}/engine* ; do
for engine in "${device_path}"/engine* ; do
echo -1 > "$engine"/group_id
done
}
Expand Down Expand Up @@ -243,7 +240,7 @@ test_op_batch()
local wq_mode_name
local xfer_size

if [ $opcode == "0x2" ];then
if [ "$opcode" == "0x2" ];then
return 0
fi

Expand Down Expand Up @@ -374,5 +371,5 @@ while getopts :c:g:o:h arg; do
done

dsa_user_test
teardown_handler="dsa_user_teardown"
#teardown_handler="dsa_user_teardown"
exec_teardown
Loading

0 comments on commit adc61c6

Please sign in to comment.