Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,31 @@ make dto-test
make dto-test-wodto

```
## Initializing DSA devices

You can initialize a DSA device using the following:
```bash
./accelConfig.sh <device-id> <enable (yes/no)> <wq-id>
```
If you get invalid traffic class error, reload the idxd driver with tc_override=1:
```bash
modprobe -r idxd
modprobe idxd tc_override=1
```
You can set the permissions of the DSA via chmod /dev/dsa/wqX.Y to allow users to submit
to the DSA device.

## Test
```bash
1. Make changes to test.sh or dto-4-dsa.conf to change DSA configuration if desired. test.sh configures DSA(s) using the config parameters in dto-4-dsa.conf
1. Follow the steps in the Initializing DSA Devices section. Or you can make changes to test.sh or dto-4-dsa.conf to change DSA configuration if desired. test.sh configures DSA(s) using the config parameters in dto-4-dsa.conf.
2. Run the test.sh script to run the dto-test app (DTO linked using -ldto) or dto-test-wodto app (DTO linked using LD_PRELOAD).
3. Using with other applications (two ways to use it)
3a. Using "-ldto" linker option (requires recompiling the application)
i. Recompile the application with "-ldto" linker options
ii. Setup DTO environment variables (examples below)
export DTO_USESTDC_CALLS=0
export DTO_COLLECT_STATS=1
export DTO_WAIT_METHOD=yield
export DTO_WAIT_METHOD=busypoll
export DTO_MIN_BYTES=8192
export DTO_CPU_SIZE_FRACTION=0.33
export DTO_AUTO_ADJUST_KNOBS=1
Expand Down
58 changes: 58 additions & 0 deletions accelConfig.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash

echo "OPTIONAL Arg-1: DSA device id. Default: 0"
echo "OPTIONAL Arg-2: Enable/Disable DSA device. Default: yes"
echo "OPTIONAL Arg-3: SHARED WQ id. Default: 1"
echo "OPTIONAL Arg-4: ENGINE count. Default: 4"

if [ "$#" -ge 5 ]; then
echo "ERROR: Incorrect argument count. Expected arg count <= 4"
exit 1
fi

DEVID=${1:-0}
ENABLE=${2:-yes}
SWQID=${3:-1}
NENGS=${4:-4}

DEV=dsa${DEVID}
SWQ=${DEV}/wq${DEVID}.${SWQID}

echo "=> ${SWQ}:"
accel-config disable-wq ${SWQ}

echo "=> ${DEV}:"
accel-config disable-device ${DEV}

if [ "${ENABLE}" != "yes" ]; then
echo "Exit after disabling ${DEV}."
exit 1
fi

for ((i=0; i < ${NENGS}; i++))
do
echo "=> ${DEV}/engine${DEVID}.${i}"
echo "configured"
accel-config config-engine ${DEV}/engine${DEVID}.${i} --group-id=0
done

accel-config config-wq ${SWQ} --group-id=0
accel-config config-wq ${SWQ} --priority=1
accel-config config-wq ${SWQ} --wq-size=128
accel-config config-wq ${SWQ} --max-batch-size=1024
accel-config config-wq ${SWQ} --max-transfer-size=2147483648
accel-config config-wq ${SWQ} --block-on-fault=0
accel-config config-wq ${SWQ} --type=user
accel-config config-wq ${SWQ} --name="dsa-test"
accel-config config-wq ${SWQ} --mode=shared
accel-config config-wq ${SWQ} --threshold=127
accel-config config-wq ${SWQ} --driver-name="user"

echo "=> ${DEV}:"
accel-config enable-device ${DEV}

echo "=> ${SWQ}:"
accel-config enable-wq ${SWQ}

#accel-config config-group ${DEV}/group0.0 --traffic-class-a=1
#accel-config config-group ${DEV}/group0.0 --traffic-class-b=1