mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 00:21:17 +00:00
selftests/bpf: Expose and rename debug argument
Launching xdpxceiver with -D enables what was formerly know as 'debug' mode. Rename this mode to 'dump-pkts' as it better describes the behavior enabled by the option. New usage: ./xdpxceiver .. -D or ./xdpxceiver .. --dump-pkts Also make it possible to pass this flag to the app via the test_xsk.sh shell script like so: ./test_xsk.sh -D Signed-off-by: Ciara Loftus <ciara.loftus@intel.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20210223162304.7450-3-ciara.loftus@intel.com
This commit is contained in:
parent
ecde60614d
commit
d2b0dfd5d1
3 changed files with 14 additions and 5 deletions
|
@ -74,14 +74,18 @@
|
||||||
#
|
#
|
||||||
# Run with verbose output:
|
# Run with verbose output:
|
||||||
# sudo ./test_xsk.sh -v
|
# sudo ./test_xsk.sh -v
|
||||||
|
#
|
||||||
|
# Run and dump packet contents:
|
||||||
|
# sudo ./test_xsk.sh -D
|
||||||
|
|
||||||
. xsk_prereqs.sh
|
. xsk_prereqs.sh
|
||||||
|
|
||||||
while getopts "cv" flag
|
while getopts "cvD" flag
|
||||||
do
|
do
|
||||||
case "${flag}" in
|
case "${flag}" in
|
||||||
c) colorconsole=1;;
|
c) colorconsole=1;;
|
||||||
v) verbose=1;;
|
v) verbose=1;;
|
||||||
|
D) dump_pkts=1;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -138,6 +142,10 @@ if [[ $verbose -eq 1 ]]; then
|
||||||
VERBOSE_ARG="-v"
|
VERBOSE_ARG="-v"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $dump_pkts -eq 1 ]]; then
|
||||||
|
DUMP_PKTS_ARG="-D"
|
||||||
|
fi
|
||||||
|
|
||||||
test_status $retval "${TEST_NAME}"
|
test_status $retval "${TEST_NAME}"
|
||||||
|
|
||||||
## START TESTS
|
## START TESTS
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
* - Rx thread verifies if all 10k packets were received and delivered in-order,
|
* - Rx thread verifies if all 10k packets were received and delivered in-order,
|
||||||
* and have the right content
|
* and have the right content
|
||||||
*
|
*
|
||||||
* Enable/disable debug mode:
|
* Enable/disable packet dump mode:
|
||||||
* --------------------------
|
* --------------------------
|
||||||
* To enable L2 - L4 headers and payload dump of each packet on STDOUT, add
|
* To enable L2 - L4 headers and payload dump of each packet on STDOUT, add
|
||||||
* parameter -D to params array in test_xsk.sh, i.e. params=("-S" "-D")
|
* parameter -D to params array in test_xsk.sh, i.e. params=("-S" "-D")
|
||||||
|
@ -340,7 +340,7 @@ static struct option long_options[] = {
|
||||||
{"copy", no_argument, 0, 'c'},
|
{"copy", no_argument, 0, 'c'},
|
||||||
{"tear-down", no_argument, 0, 'T'},
|
{"tear-down", no_argument, 0, 'T'},
|
||||||
{"bidi", optional_argument, 0, 'B'},
|
{"bidi", optional_argument, 0, 'B'},
|
||||||
{"debug", optional_argument, 0, 'D'},
|
{"dump-pkts", optional_argument, 0, 'D'},
|
||||||
{"verbose", no_argument, 0, 'v'},
|
{"verbose", no_argument, 0, 'v'},
|
||||||
{"tx-pkt-count", optional_argument, 0, 'C'},
|
{"tx-pkt-count", optional_argument, 0, 'C'},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
|
@ -359,7 +359,7 @@ static void usage(const char *prog)
|
||||||
" -c, --copy Force copy mode\n"
|
" -c, --copy Force copy mode\n"
|
||||||
" -T, --tear-down Tear down sockets by repeatedly recreating them\n"
|
" -T, --tear-down Tear down sockets by repeatedly recreating them\n"
|
||||||
" -B, --bidi Bi-directional sockets test\n"
|
" -B, --bidi Bi-directional sockets test\n"
|
||||||
" -D, --debug Debug mode - dump packets L2 - L5\n"
|
" -D, --dump-pkts Dump packets L2 - L5\n"
|
||||||
" -v, --verbose Verbose output\n"
|
" -v, --verbose Verbose output\n"
|
||||||
" -C, --tx-pkt-count=n Number of packets to send\n";
|
" -C, --tx-pkt-count=n Number of packets to send\n";
|
||||||
ksft_print_msg(str, prog);
|
ksft_print_msg(str, prog);
|
||||||
|
|
|
@ -128,5 +128,6 @@ execxdpxceiver()
|
||||||
copy[$index]=${!current}
|
copy[$index]=${!current}
|
||||||
done
|
done
|
||||||
|
|
||||||
./${XSKOBJ} -i ${VETH0} -i ${VETH1},${NS1} ${copy[*]} -C ${NUMPKTS} ${VERBOSE_ARG}
|
./${XSKOBJ} -i ${VETH0} -i ${VETH1},${NS1} ${copy[*]} -C ${NUMPKTS} ${VERBOSE_ARG} \
|
||||||
|
${DUMP_PKTS_ARG}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue