forked from DPDK/dpdk
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add some basic vhost_user+virtio_user test
This script is based on Thomas test-null.sh script. Quickly check that initialisation (with multiqueue) and basic forwarding are not broken between two testpmd: one testpmd polling from a vhost-user client port and the other testpmd polling one virtio_user port. Signed-off-by: David Marchand <[email protected]>
- Loading branch information
1 parent
8ab3de4
commit 114ee60
Showing
3 changed files
with
82 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -991,6 +991,7 @@ M: Maxime Coquelin <[email protected]> | |
M: Chenbo Xia <[email protected]> | ||
T: git://dpdk.org/next/dpdk-next-virtio | ||
F: lib/vhost/ | ||
F: devtools/test-vhost.sh | ||
F: doc/guides/prog_guide/vhost_lib.rst | ||
F: examples/vhost/ | ||
F: doc/guides/sample_app_ug/vhost.rst | ||
|
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,73 @@ | ||
#! /bin/sh -e | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright 2015 6WIND S.A. | ||
# Copyright 2019 Mellanox Technologies, Ltd | ||
# Copyright (c) 2024 Red Hat, Inc. | ||
|
||
# Run a quick forwarding test without hugepage, with one testpmd using | ||
# virtio-user and another using vhost-user. | ||
|
||
build=${1:-build} # first argument can be the build directory | ||
testpmd=$1 # or first argument can be the testpmd path | ||
corelist_server=${2:-0,1,2} # default using cores 0, 1, 2 | ||
corelist_client=${3:-0,1,3} # default using cores 0, 1, 3 | ||
eal_options=$4 | ||
testpmd_options=$5 | ||
|
||
sock=$(mktemp -t dpdk.virtio-user.XXXXXX.sock) | ||
pid_client= | ||
pid_server= | ||
cleanup() { | ||
rm -f $sock | ||
[ "$pid_client $pid_server" != " " ] || return | ||
if kill -0 $pid_client $pid_server >/dev/null 2>/dev/null; then | ||
sleep 2 | ||
fi | ||
if kill -0 $pid_client >/dev/null 2>/dev/null ; then | ||
echo ============================ | ||
echo Force killing client testpmd | ||
kill -9 $pid_client | ||
fi | ||
if kill -0 $pid_server >/dev/null 2>/dev/null ; then | ||
echo ============================ | ||
echo Force killing server testpmd | ||
kill -9 $pid_server | ||
fi | ||
} | ||
|
||
trap cleanup EXIT | ||
|
||
[ -f "$testpmd" ] && build=$(dirname $(dirname $testpmd)) | ||
[ -f "$testpmd" ] || testpmd=$build/app/dpdk-testpmd | ||
[ -f "$testpmd" ] || testpmd=$build/app/testpmd | ||
if [ ! -f "$testpmd" ] ; then | ||
echo 'ERROR: testpmd cannot be found' >&2 | ||
exit 1 | ||
fi | ||
|
||
if ldd $testpmd | grep -q librte_ ; then | ||
export LD_LIBRARY_PATH=$build/lib:$LD_LIBRARY_PATH | ||
libs="-d $build/drivers" | ||
else | ||
libs= | ||
fi | ||
|
||
rm -f $sock | ||
( $testpmd -l $corelist_server --file-prefix=virtio-user --no-huge -m 1024 \ | ||
--single-file-segments --no-pci $libs \ | ||
--vdev net_virtio_user0,path=$sock,queues=2,server=1 $eal_options -- \ | ||
--no-mlockall --stats-period 1 --rxq 2 --txq 2 --nb-cores=2 --tx-first -a $testpmd_options \ | ||
>/dev/null 2>/dev/null) & | ||
pid_server=$! | ||
|
||
( $testpmd -l $corelist_client --file-prefix=vhost --no-huge -m 1024 \ | ||
--single-file-segments --no-pci $libs \ | ||
--vdev net_vhost0,iface=$sock,queues=8,client=1 $eal_options -- \ | ||
--no-mlockall --stats-period 1 --rxq 8 --txq 8 --nb-cores=2 --tx-first -a $testpmd_options \ | ||
) & | ||
pid_client=$! | ||
|
||
sleep 2 | ||
kill $pid_client | ||
sleep 1 | ||
kill $pid_server |