diff options
author | 2025-03-03 16:19:01 -0500 | |
---|---|---|
committer | 2025-03-04 21:39:00 +0000 | |
commit | bf0146b21192cc8e97c7f3b5a427b8013b77c721 (patch) | |
tree | 1ca619ab6c0002c6e2d4d1e54554084898a41ef9 /extras/scripts/host-stack/perf-tests | |
parent | 75b66b374067ddfc4d9ed316d66250c4e60db985 (diff) |
misc: add and consolidate host stack scripts
Move all existing host stack scripts under extras/scripts/host-stack
Also add scripts for iperf/vcl performance testing
Type: improvement
Change-Id: Ia79b6bd061db49f61a0e4c6577cf45afe0323eb1
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'extras/scripts/host-stack/perf-tests')
-rw-r--r-- | extras/scripts/host-stack/perf-tests/conf/dpdk_mt.cli | 6 | ||||
-rw-r--r-- | extras/scripts/host-stack/perf-tests/conf/dpdk_st.cli | 5 | ||||
-rwxr-xr-x | extras/scripts/host-stack/perf-tests/dpdk_mt | 59 | ||||
-rwxr-xr-x | extras/scripts/host-stack/perf-tests/dpdk_st | 63 | ||||
-rw-r--r-- | extras/scripts/host-stack/perf-tests/gdb_ldp_init | 8 | ||||
-rwxr-xr-x | extras/scripts/host-stack/perf-tests/start_vpp.sh | 153 | ||||
-rwxr-xr-x | extras/scripts/host-stack/perf-tests/vcl_client | 13 | ||||
-rwxr-xr-x | extras/scripts/host-stack/perf-tests/vcl_iperf_client | 22 | ||||
-rwxr-xr-x | extras/scripts/host-stack/perf-tests/vcl_iperf_server | 22 | ||||
-rw-r--r-- | extras/scripts/host-stack/perf-tests/vcl_perf.conf | 16 | ||||
-rwxr-xr-x | extras/scripts/host-stack/perf-tests/vcl_server | 13 |
11 files changed, 380 insertions, 0 deletions
diff --git a/extras/scripts/host-stack/perf-tests/conf/dpdk_mt.cli b/extras/scripts/host-stack/perf-tests/conf/dpdk_mt.cli new file mode 100644 index 00000000000..8df8ee1e38c --- /dev/null +++ b/extras/scripts/host-stack/perf-tests/conf/dpdk_mt.cli @@ -0,0 +1,6 @@ +comment {SPDX-License-Identifier: Apache-2.0} +comment {Copyright (c) 2025 Cisco Systems, Inc.} +set int ip address HundredGigabitEthernet16/0/0 6.0.1.1/24 +set int state HundredGigabitEthernet16/0/0 up + +session enable diff --git a/extras/scripts/host-stack/perf-tests/conf/dpdk_st.cli b/extras/scripts/host-stack/perf-tests/conf/dpdk_st.cli new file mode 100644 index 00000000000..97aeb3916f8 --- /dev/null +++ b/extras/scripts/host-stack/perf-tests/conf/dpdk_st.cli @@ -0,0 +1,5 @@ +comment {SPDX-License-Identifier: Apache-2.0} +comment {Copyright (c) 2025 Cisco Systems, Inc.} +set int ip address HundredGigabitEthernet16/0/0 6.0.1.1/24 +set int state HundredGigabitEthernet16/0/0 up +session enable diff --git a/extras/scripts/host-stack/perf-tests/dpdk_mt b/extras/scripts/host-stack/perf-tests/dpdk_mt new file mode 100755 index 00000000000..6e095da4228 --- /dev/null +++ b/extras/scripts/host-stack/perf-tests/dpdk_mt @@ -0,0 +1,59 @@ +#!/usr/bin/env bash + +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2025 Cisco Systems, Inc. + +VPP_WS=${VPP_WS:-/scratch/fcoras/vpp} +CFG_WS="${VPP_WS}"/extras/scripts/host-stack/perf-tests +CFG_DIR="${CFG_WS}"/conf +CFG_FILE=dpdk_mt.cli +BASE_DIR="${VPP_WS}"/build-root +BIN_FLAVOR=release + +DPDK_DEV=0000:16:00.0 +NUM_MBUFS=16536 +IF_RX_DESC=256 +IF_TX_DESC=256 +DPDK_CSUM=enable-tcp-udp-checksum + +SKIP_CORE=0 +MAIN_CORE=1 +WORKERS=4 +CFG_CORELIST_WKS="corelist-workers 2-5" + +HEAP_SIZE=4g +API_SIZE=1G +API_GLOBAL_SIZE=2000M +EVT_LOG_SIZE=400000 + +SOCK=/run/vpp-api.sock +SESSION_CFG="session { event-queue-length 100000 use-app-socket-api }" + +#QUIC_ENABLE=1 +#LOCAL_OSSL=/scratch/fcoras/openssl + +function usage() { + echo "Usage: cmd [-f release|debug] [-d dpdk_device_pci_address] [-w vpp_workspace]" +} + +while getopts "f:d:w:h" opt; do + case ${opt} in + h) usage + exit 0 + ;; + w) VPP_WS=$OPTARG + ;; + f) BIN_FLAVOR=$OPTARG + ;; + d) DPDK_DEV=$OPTARG + ;; + \?) echo "Usage: cmd [-f release|debug] [-d dpdk_device_pci_address]" + exit 1 + ;; + esac +done +shift $((OPTIND -1)) + +source "${CFG_WS}"/start_vpp.sh + +start_vpp diff --git a/extras/scripts/host-stack/perf-tests/dpdk_st b/extras/scripts/host-stack/perf-tests/dpdk_st new file mode 100755 index 00000000000..a35889f0238 --- /dev/null +++ b/extras/scripts/host-stack/perf-tests/dpdk_st @@ -0,0 +1,63 @@ +#!/usr/bin/env bash + +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2025 Cisco Systems, Inc. + +VPP_WS=${VPP_WS:-/scratch/fcoras/vpp} +CFG_WS="${VPP_WS}"/extras/scripts/host-stack/perf-tests +CFG_DIR="${CFG_WS}"/conf +CFG_FILE=dpdk_st.cli +BASE_DIR="${VPP_WS}"/build-root +BIN_FLAVOR=release + +#DPDK_DISABLE=1 +DPDK_DEV=0000:16:00.0 +IF_RX_DESC=512 +IF_TX_DESC=256 +DPDK_CSUM=enable-tcp-udp-checksum + +NUM_MBUFS=16536 + +HEAP_SIZE=4g +API_SIZE=1G +API_GLOBAL_SIZE=2000M +EVT_LOG_SIZE=400000 + +MAIN_CORE=1 +WORKERS=1 +CFG_CORELIST_WKS="corelist-workers 2" + +SOCK=/run/vpp-api.sock +CLI_SOCK=/run/vpp/cli.sock +SESSION_CFG="session { event-queue-length 100000 use-app-socket-api }" + +TCP_CFG="tcp { max-rx-fifo 128m }" +TLS_CFG="tls { fifo-size 1m }" +#QUIC_ENABLE=1 +#LOCAL_OSSL=/scratch/fcoras/openssl + +function usage() { + echo "Usage: cmd [-f release|debug] [-d dpdk_device_pci_address] [-w vpp_workspace]" +} + +while getopts "f:d:w:h" opt; do + case ${opt} in + h) usage + exit 0 + ;; + w) VPP_WS=$OPTARG + ;; + f) BIN_FLAVOR=$OPTARG + ;; + d) DPDK_DEV=$OPTARG + ;; + \?) usage + exit 1 + ;; + esac +done +shift $((OPTIND -1)) + +source "${CFG_WS}"/start_vpp.sh + +start_vpp diff --git a/extras/scripts/host-stack/perf-tests/gdb_ldp_init b/extras/scripts/host-stack/perf-tests/gdb_ldp_init new file mode 100644 index 00000000000..7c2f28e2083 --- /dev/null +++ b/extras/scripts/host-stack/perf-tests/gdb_ldp_init @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2025 Cisco Systems, Inc. + +handle SIGUSR1 nostop noprint pass +set print pretty on +set exec-wrapper env 'LD_PRELOAD=/scratch/fcoras/vpp/build-root/build-vpp-native/vpp/lib/libvcl_ldpreload.so' +set environment LDP_DEBUG=1 +set environment VCL_CONFIG=/scratch/fcoras/vpp/extras/scripts/host-stack/perf-tests/vcl_perf.conf diff --git a/extras/scripts/host-stack/perf-tests/start_vpp.sh b/extras/scripts/host-stack/perf-tests/start_vpp.sh new file mode 100755 index 00000000000..27614713b76 --- /dev/null +++ b/extras/scripts/host-stack/perf-tests/start_vpp.sh @@ -0,0 +1,153 @@ +#!/usr/bin/env bash + +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2025 Cisco Systems, Inc. + +if [ $BIN_FLAVOR = "debug" ] +then + BIN_DIR=install-vpp_debug-native + BIN_EXEC_PREFIX="gdb --args" +else + BIN_DIR=install-vpp-native + BIN_EXEC_PREFIX="gdb --args" +fi + +BIN_PATH=$BASE_DIR/$BIN_DIR + +if [ "$#" -eq 1 ] +then + echo $1 + CFG_FILE=$1 +fi + +CFG_MBUFS="" +if [ -n "$NUM_MBUFS" ]; then + CFG_MBUFS="buffers-per-numa $NUM_MBUFS" +fi + +if [ -z $HEAP_SIZE ]; then + HEAP_SIZE=4g +fi + +if [ -z $SKIP_CORE ]; then + SKIP_CORE=0 +fi + +if [ -z $SKIP_CORE ]; then + MAIN_CORE=1 +fi + +if [ -z $EVT_LOG_SIZE ]; then + EVT_LOG_SIZE=0 +fi + +if [ -z $API_GLOBAL_SIZE ]; then + API_GLOBAL_SIZE=64M +fi + +if [ -z $API_SIZE ]; then + API_SIZE=16M +fi + +if [ -z ${WORKERS+x} ]; then + WORKERS=0 + CFG_RX_QS=1 +else + CFG_WORKERS="workers $WORKERS" + CFG_RX_QS=$(( $WORKERS )) +fi + +SOCK_CFG="" +if [ -n "$SOCK" ]; then + SOCK_CFG="socksvr { socket-name ${SOCK} }" +fi + +if [ -z $IF_RX_DESC ]; then + IF_RX_DESC=4096 +fi + +if [ -z $IF_TX_DESC ]; then + IF_TX_DESC=4096 +fi + +API_PREFIX_CFG="" +if [ -n "$API_PREFIX" ]; then + API_PREFIX_CFG="prefix $API_PREFIX" +fi + +CLI_LISTEN_CFG="cli-listen localhost:5002" +if [ -n "$CLI_SOCK" ]; then + CLI_LISTEN_CFG="cli-listen $CLI_SOCK" +fi + +if [[ -z "$DPDK_DISABLE" ]]; then + DPDK_CFG="dpdk { \ + dev $DPDK_DEV { \ + num-tx-desc $IF_TX_DESC \ + num-rx-desc $IF_RX_DESC \ + num-rx-queues $CFG_RX_QS \ + } \ + $SOCK_MEM_CFG \ + $DPDK_CSUM \ + }" +else + DPDK_PLUGIN_DISABLE="plugin dpdk_plugin.so {disable}" +fi + +if [[ -n "$QUIC_ENABLE" ]]; then + QUIC_PLUGIN="plugin quic_plugin.so {enable}" +fi + +if [[ -n "$SRTP_ENABLE" ]]; then + SRTP_PLUGIN="plugin srtp_plugin.so {enable}" +fi + +# custom openssl locally built +LD_LIBP="" +if [[ -n "${LOCAL_OSSL}" ]]; then + LD_LIBP="LD_LIBRARY_PATH=${LOCAL_OSSL}" +fi + +function start_vpp +{ + sudo $LD_LIBP $BIN_EXEC_PREFIX $BIN_PATH/vpp/bin/vpp \ + unix { \ + interactive log /tmp/vpp.log \ + full-coredump \ + exec $CFG_DIR/$CFG_FILE \ + $CLI_LISTEN_CFG \ + poll-sleep-usec 0 \ + } \ + heapsize $HEAP_SIZE \ + api-trace { on } \ + api-segment { \ + global-size $API_GLOBAL_SIZE \ + api-size $API_SIZE \ + gid vpp \ + $API_PREFIX_CFG \ + } \ + vlib { \ + elog-events $EVT_LOG_SIZE \ + elog-post-mortem-dump \ + } \ + cpu { \ + skip-cores $SKIP_CORE \ + main-core $MAIN_CORE \ + $CFG_CORELIST_WKS \ + } \ + buffers { $CFG_MBUFS } \ + $DPDK_CFG \ + $SESSION_CFG \ + $TCP_CFG \ + $UDP_CFG \ + $SOCK_CFG \ + $TLS_CFG \ + plugins { \ + plugin unittest_plugin.so {enable} \ + plugin http_unittest_plugin.so {enable} \ + $QUIC_PLUGIN \ + $SRTP_PLUGIN \ + $DPDK_PLUGIN_DISABLE \ + } +} + diff --git a/extras/scripts/host-stack/perf-tests/vcl_client b/extras/scripts/host-stack/perf-tests/vcl_client new file mode 100755 index 00000000000..653aeef6c9f --- /dev/null +++ b/extras/scripts/host-stack/perf-tests/vcl_client @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2025 Cisco Systems, Inc. + +VPP_WS=${VPP_WS:-/scratch/fcoras/vpp} +CFG_WS=$VPP_WS/extras/scripts/host-stack/perf-tests +BIN=$VPP_WS/build-root/build-vpp-native/vpp/bin/vcl_test_client +GDB_ENV=$CFG_WS/gdb_vcl_env +VCL_CFG=$CFG_WS/vcl_perf.conf +PARAMS=$@ + +sudo taskset --cpu-list 10 sh -c "VCL_CONFIG=$VCL_CFG $BIN -c $PARAMS" diff --git a/extras/scripts/host-stack/perf-tests/vcl_iperf_client b/extras/scripts/host-stack/perf-tests/vcl_iperf_client new file mode 100755 index 00000000000..94a8b6c4912 --- /dev/null +++ b/extras/scripts/host-stack/perf-tests/vcl_iperf_client @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2025 Cisco Systems, Inc. + +VPP_WS=${VPP_WS:-/scratch/fcoras/vpp} +CFG_WS=$VPP_WS/extras/scripts/host-stack/perf-tests +BIN_PATH=iperf3 +LDP_VAR=$VPP_WS/build-root/install-vpp-native/vpp/lib/x86_64-linux-gnu/libvcl_ldpreload.so +VCL_CFG=$CFG_WS/vcl_perf.conf +PARAMS=$@ + +sudo taskset --cpu-list 6-11 sh -c "LD_PRELOAD=$LDP_VAR VCL_CONFIG=$VCL_CFG $BIN_PATH -4 -c $PARAMS" + +# for tls +# CERT=$CFG_WS/selfsigned.crt +# KEY=$CFG_WS/selfsigned.key +# sudo taskset --cpu-list 6-10 sh -c "LDP_TRANSPARENT_TLS=2 LDP_TLS_CERT_FILE=$CERT LDP_TLS_KEY_FILE=$KEY VCL_CONFIG=$VCL_CFG LD_PRELOAD=$LDP_VAR $BIN_PATH -4 -c $PARAMS" + +# for debugging +# LDP_SCRIPT=$CFG_WS/gdb_ldp_init +# sudo gdb --command=$LDP_SCRIPT --args $BIN_PATH -4 -s $PARAMS diff --git a/extras/scripts/host-stack/perf-tests/vcl_iperf_server b/extras/scripts/host-stack/perf-tests/vcl_iperf_server new file mode 100755 index 00000000000..92dd1fcea5f --- /dev/null +++ b/extras/scripts/host-stack/perf-tests/vcl_iperf_server @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2025 Cisco Systems, Inc. + +VPP_WS=${VPP_WS:-/scratch/fcoras/vpp} +CFG_WS=$VPP_WS/extras/scripts/host-stack/perf-tests +BIN_PATH=iperf3 +LDP_VAR=$VPP_WS/build-root/install-vpp-native/vpp/lib/x86_64-linux-gnu/libvcl_ldpreload.so +VCL_CFG=$CFG_WS/vcl_perf.conf +PARAMS=$@ + +sudo taskset --cpu-list 6-11 sh -c "LD_PRELOAD=$LDP_VAR VCL_CONFIG=$VCL_CFG $BIN_PATH -4 -s $PARAMS" + +# for tls testing +# CERT=$CFG_WS/selfsigned.crt +# KEY=$CFG_WS/selfsigned.key +# sudo taskset --cpu-list 6-11 sh -c "LDP_TRANSPARENT_TLS=1 LDP_TLS_CERT_FILE=$CERT LDP_TLS_KEY_FILE=$KEY LD_PRELOAD=$LDP_VAR VCL_CONFIG=$VCL_CFG $BIN_PATH -4 -s $PARAMS" + +# debugging +# LDP_SCRIPT=/home/fcoras/vpp/gdb_ldp_init +# sudo gdb --command=$LDP_SCRIPT --args $BIN_PATH -4 -s $PARAMS diff --git a/extras/scripts/host-stack/perf-tests/vcl_perf.conf b/extras/scripts/host-stack/perf-tests/vcl_perf.conf new file mode 100644 index 00000000000..791d5fd3eaa --- /dev/null +++ b/extras/scripts/host-stack/perf-tests/vcl_perf.conf @@ -0,0 +1,16 @@ +vcl { + # SPDX-License-Identifier: Apache-2.0 + # Copyright (c) 2025 Cisco Systems, Inc. + rx-fifo-size 4000000 + tx-fifo-size 4000000 + + app-scope-local + app-scope-global + + segment-size 10000000000 + add-segment-size 10000000000 + + app-socket-api /var/run/vpp/app_ns_sockets/default + use-mq-eventfd + event-queue-size 500000 +} diff --git a/extras/scripts/host-stack/perf-tests/vcl_server b/extras/scripts/host-stack/perf-tests/vcl_server new file mode 100755 index 00000000000..4ecc2f1f3a9 --- /dev/null +++ b/extras/scripts/host-stack/perf-tests/vcl_server @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2025 Cisco Systems, Inc. + +VPP_WS=${VPP_WS:-/scratch/fcoras/vpp} +CFG_WS=$VPP_WS/extras/scripts/host-stack/perf-tests +BIN=$VPP_WS/build-root/build-vpp-native/vpp/bin/vcl_test_server +GDB_ENV=$CFG_WS/gdb_init_tls +VCL_CFG=$CFG_WS/vcl_perf.conf +PARAMS=$@ + +sudo taskset --cpu-list 6-11 sh -c "VCL_CONFIG=$VCL_CFG $BIN $PARAMS"
\ No newline at end of file |