1#! /bin/sh -e 2# SPDX-License-Identifier: BSD-3-Clause 3# Copyright 2015 6WIND S.A. 4# Copyright 2019 Mellanox Technologies, Ltd 5 6# Run a quick testpmd forwarding with null PMD without hugepage 7 8build=${1:-build} # first argument can be the build directory 9testpmd=$1 # or first argument can be the testpmd path 10coremask=${2:-3} # default using cores 0 and 1 11eal_options=$3 12testpmd_options=$4 13 14[ -f "$testpmd" ] && build=$(dirname $(dirname $testpmd)) 15[ -f "$testpmd" ] || testpmd=$build/app/dpdk-testpmd 16[ -f "$testpmd" ] || testpmd=$build/app/testpmd 17if [ ! -f "$testpmd" ] ; then 18 echo 'ERROR: testpmd cannot be found' >&2 19 exit 1 20fi 21 22if ldd $testpmd | grep -q librte_ ; then 23 export LD_LIBRARY_PATH=$build/lib:$LD_LIBRARY_PATH 24 libs="-d $build/drivers" 25else 26 libs= 27fi 28 29(sleep 1 && echo stop) | 30# testpmd only needs 20M, make it x2 (default number of cores) for NUMA systems 31$testpmd -c $coremask --no-huge -m 40 \ 32 $libs -a 0:0.0 --vdev net_null1 --vdev net_null2 $eal_options -- \ 33 --no-mlockall --total-num-mbufs=2048 $testpmd_options -ia 34