-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test script and build files to setup a test run of `odp_dmafwd` with a few different scenarios during `make check`. Signed-off-by: Tuomas Taipale <tuomas.taipale@nokia.com>
- Loading branch information
1 parent
e2c170b
commit 7c54240
Showing
7 changed files
with
144 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SUBDIRS = dmafwd |
18 changes: 18 additions & 0 deletions
18
platform/linux-generic/test/performance/dmafwd/Makefile.am
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
EXTRA_DIST = pktio_env | ||
|
||
all-local: | ||
if [ "x$(srcdir)" != "x$(builddir)" ]; then \ | ||
for f in $(EXTRA_DIST); do \ | ||
if [ -e $(srcdir)/$$f ]; then \ | ||
mkdir -p $(builddir)/$$(dirname $$f); \ | ||
cp -f $(srcdir)/$$f $(builddir)/$$f; \ | ||
fi \ | ||
done \ | ||
fi | ||
|
||
clean-local: | ||
if [ "x$(srcdir)" != "x$(builddir)" ]; then \ | ||
for f in $(EXTRA_DIST); do \ | ||
rm -f $(builddir)/$$f; \ | ||
done \ | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/sh | ||
# | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright (c) 2023 Nokia | ||
|
||
PCAP_IN=`find . ${TEST_DIR} $(dirname $0) -name udp64.pcap -print -quit` | ||
PCAP_OUT=dmafwd_out.pcap | ||
|
||
IF0=pcap:in=${PCAP_IN}:out=${PCAP_OUT} | ||
|
||
if [ "$0" = "$BASH_SOURCE" ]; then | ||
echo "ERROR: Platform specific env file has to be sourced." | ||
fi | ||
|
||
validate_result() | ||
{ | ||
local VALIN=valin | ||
local VALOUT=valout | ||
|
||
tcpdump -r ${PCAP_IN} -t -x > ${VALIN} | ||
tcpdump -r ${PCAP_OUT} -t -x > ${VALOUT} | ||
diff ${VALIN} ${VALOUT} | ||
|
||
local RET=$? | ||
|
||
rm -f ${PCAP_OUT} | ||
rm -f ${VALIN} | ||
rm -f ${VALOUT} | ||
|
||
if [ $RET -ne 0 ]; then | ||
echo "ERROR: input and output captures do not match, exiting" | ||
exit 1 | ||
fi | ||
|
||
return 0 | ||
} | ||
|
||
setup_interfaces() | ||
{ | ||
return 0 | ||
} | ||
|
||
cleanup_interfaces() | ||
{ | ||
return 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/bin/bash | ||
# | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright (c) 2023 Nokia | ||
|
||
TEST_DIR="${TEST_DIR:-$PWD}" | ||
TEST_SRC_DIR=$(dirname $0) | ||
PERF_TEST_DIR=platform/${ODP_PLATFORM}/test/performance | ||
PERF_TEST_DIR=${TEST_SRC_DIR}/../../${PERF_TEST_DIR} | ||
|
||
BIN_NAME=odp_dmafwd | ||
BATCH=10 | ||
TIME=2 | ||
TESTS_RUN=0 | ||
|
||
check_env() | ||
{ | ||
if [ -f "./pktio_env" ]; then | ||
. ./pktio_env | ||
elif [ "${ODP_PLATFORM}" = "" ]; then | ||
echo "$0: ERROR: ODP_PLATFORM must be defined" | ||
exit 1 | ||
elif [ -f ${PERF_TEST_DIR}/dmafwd/pktio_env ]; then | ||
. ${PERF_TEST_DIR}/dmafwd/pktio_env | ||
else | ||
echo "ERROR: unable to find pktio_env" | ||
echo "pktio_env has to be in current directory or in platform/\$ODP_PLATFORM/test/" | ||
echo "ODP_PLATFORM=\"${ODP_PLATFORM}\"" | ||
exit 1 | ||
fi | ||
} | ||
|
||
check_result() | ||
{ | ||
if [ $1 -eq 0 ]; then | ||
TESTS_RUN=`expr $TESTS_RUN + 1` | ||
elif [ $1 -eq 1 ]; then | ||
echo "Test FAILED, exiting" | ||
exit 1 | ||
else | ||
echo "Test SKIPPED" | ||
return 0 | ||
fi | ||
|
||
validate_result | ||
} | ||
|
||
check_exit() | ||
{ | ||
if [ $TESTS_RUN -eq 0 ]; then | ||
exit 77 | ||
fi | ||
|
||
exit 0 | ||
} | ||
|
||
check_env | ||
setup_interfaces | ||
echo "${BIN_NAME}: SW copy" | ||
echo "===================" | ||
./${BIN_NAME}${EXEEXT} -i ${IF0} -b ${BATCH} -T ${TIME} -t 0 | ||
check_result $? | ||
echo "${BIN_NAME}: DMA copy" | ||
echo "====================" | ||
./${BIN_NAME}${EXEEXT} -i ${IF0} -b ${BATCH} -T ${TIME} -t 1 | ||
check_result $? | ||
cleanup_interfaces | ||
check_exit |