xref: /dpdk/devtools/test-null.sh (revision 924de7b8e64489231351c48767973a1042d8ffd3)
19a98f50eSThomas Monjalon#! /bin/sh -e
2f83a3d3fSOlivier Matz# SPDX-License-Identifier: BSD-3-Clause
39a98f50eSThomas Monjalon# Copyright 2015 6WIND S.A.
485fc9b25SThomas Monjalon# Copyright 2019 Mellanox Technologies, Ltd
59a98f50eSThomas Monjalon
69a98f50eSThomas Monjalon# Run a quick testpmd forwarding with null PMD without hugepage
79a98f50eSThomas Monjalon
8d879f575SThomas Monjalonbuild=${1:-build} # first argument can be the build directory
9d879f575SThomas Monjalontestpmd=$1 # or first argument can be the testpmd path
109a98f50eSThomas Monjaloncoremask=${2:-3} # default using cores 0 and 1
11d879f575SThomas Monjaloneal_options=$3
12d879f575SThomas Monjalontestpmd_options=$4
139a98f50eSThomas Monjalon
146b01864cSFerruh Yigit[ -f "$testpmd" ] && build=$(dirname $(dirname $testpmd))
15d879f575SThomas Monjalon[ -f "$testpmd" ] || testpmd=$build/app/dpdk-testpmd
1685fc9b25SThomas Monjalon[ -f "$testpmd" ] || testpmd=$build/app/testpmd
1785fc9b25SThomas Monjalonif [ ! -f "$testpmd" ] ; then
1885fc9b25SThomas Monjalon	echo 'ERROR: testpmd cannot be found' >&2
1985fc9b25SThomas Monjalon	exit 1
2085fc9b25SThomas Monjalonfi
2185fc9b25SThomas Monjalon
2285fc9b25SThomas Monjalonif ldd $testpmd | grep -q librte_ ; then
235bd47901SBruce Richardson	export LD_LIBRARY_PATH=$build/lib:$LD_LIBRARY_PATH
245bd47901SBruce Richardson	libs="-d $build/drivers"
2585fc9b25SThomas Monjalonelse
2685fc9b25SThomas Monjalon	libs=
279a98f50eSThomas Monjalonfi
289a98f50eSThomas Monjalon
299a98f50eSThomas Monjalon(sleep 1 && echo stop) |
30*924de7b8SDavid Marchand# testpmd only needs 20M, make it x2 (default number of cores) for NUMA systems
31*924de7b8SDavid Marchand$testpmd -c $coremask --no-huge -m 40 \
32db27370bSStephen Hemminger	$libs -a 0:0.0 --vdev net_null1 --vdev net_null2 $eal_options -- \
33d879f575SThomas Monjalon	--no-mlockall --total-num-mbufs=2048 $testpmd_options -ia
34