From patchwork Tue Aug 30 17:32:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 75011 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp2264006qga; Tue, 30 Aug 2016 10:33:09 -0700 (PDT) X-Received: by 10.107.170.149 with SMTP id g21mr256852ioj.78.1472578389067; Tue, 30 Aug 2016 10:33:09 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id n90si225844ioe.87.2016.08.30.10.33.07; Tue, 30 Aug 2016 10:33:09 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A6FB760D37; Tue, 30 Aug 2016 17:33:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 6F4E160A14; Tue, 30 Aug 2016 17:33:01 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id AE16060A19; Tue, 30 Aug 2016 17:32:54 +0000 (UTC) Received: from mail-qt0-f171.google.com (mail-qt0-f171.google.com [209.85.216.171]) by lists.linaro.org (Postfix) with ESMTPS id E73AA60A12 for ; Tue, 30 Aug 2016 17:32:52 +0000 (UTC) Received: by mail-qt0-f171.google.com with SMTP id u25so12871167qtb.1 for ; Tue, 30 Aug 2016 10:32:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=A1lAvqrqyy3KfiWLLVSrSoSfaBooi76aEexkn3LTa8w=; b=RLxjV3RPa3liSV2VnB3aJw1foqJ7Eeb45p6zHxwBgRx7eopMX2GsXsofBNfe1xy40N 5JLi+zG2DGpsEuaH/9wY7P46DJCrGlbukPNdoMQzCyylBG+wdRLlrl3gxnw2j1KmubMa oLbW98sJmP1KrjRQrprA2nM9l5bXW9zvVyw3M92kmh47RjSFysagi04A6mx3vCFczdKJ M9M+wJaZkqhF499IRIgIbIC49RR0q34aflwMu8vA6RmSqXpBK+ePvkKgQsl/x7yYXPVt yZ01NulhtNa1f8Yo6cnTZqtBO+gTEzqTn5gmbcdn9ObcwPkiLkVqYLGgS8ULdhfX7jXb 14mQ== X-Gm-Message-State: AE9vXwMq4PIhlsnZaOLpo2X93zS7KmIe3e6ay/gxh/CHQF/b7eLdwVfQnHTANoqkmRmK3LTisU0= X-Received: by 10.237.35.76 with SMTP id i12mr5534396qtc.41.1472578372240; Tue, 30 Aug 2016 10:32:52 -0700 (PDT) Received: from localhost (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by smtp.gmail.com with ESMTPSA id w10sm22268551qtc.28.2016.08.30.10.32.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Aug 2016 10:32:51 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Tue, 30 Aug 2016 13:32:49 -0400 Message-Id: <1472578369-16228-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.7.4 X-Topics: patch Subject: [lng-odp] [PATCH v2 1/1] test:linux-generic: add process mode tests X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Add process mode run for odp_crypto_run, odp_l2fwd_run, odp_pktio_perf_run. Currently failing tests retun SKIP (77) until process mode is fixed Signed-off-by: Mike Holmes --- v2: alphabetic order test/linux-generic/performance/Makefile.am | 5 +- .../performance/odp_crypto_run_proc.sh | 22 ++++ .../performance/odp_l2fwd_run_proc.sh | 117 +++++++++++++++++++++ .../performance/odp_pktio_perf_run_proc.sh | 24 +++++ 4 files changed, 167 insertions(+), 1 deletion(-) create mode 100755 test/linux-generic/performance/odp_crypto_run_proc.sh create mode 100755 test/linux-generic/performance/odp_l2fwd_run_proc.sh create mode 100755 test/linux-generic/performance/odp_pktio_perf_run_proc.sh -- 2.7.4 diff --git a/test/linux-generic/performance/Makefile.am b/test/linux-generic/performance/Makefile.am index cb72fce..d590acd 100644 --- a/test/linux-generic/performance/Makefile.am +++ b/test/linux-generic/performance/Makefile.am @@ -2,7 +2,10 @@ include $(top_srcdir)/test/Makefile.inc TESTS_ENVIRONMENT += TEST_DIR=${builddir} -TESTSCRIPTS = odp_scheduling_run_proc.sh +TESTSCRIPTS = odp_crypto_run_proc.sh \ + odp_l2fwd_run_proc.sh \ + odp_pktio_perf_run_proc.sh \ + odp_scheduling_run_proc.sh TEST_EXTENSIONS = .sh diff --git a/test/linux-generic/performance/odp_crypto_run_proc.sh b/test/linux-generic/performance/odp_crypto_run_proc.sh new file mode 100755 index 0000000..a8fdeb0 --- /dev/null +++ b/test/linux-generic/performance/odp_crypto_run_proc.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# +# Copyright (c) 2016, Linaro Limited +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Script that passes command line arguments to odp_crypto test when +# launched by 'make check' + +TEST_DIR="${TEST_DIR:-$(dirname $0)}" +PERFORMANCE="$TEST_DIR/../../common_plat/performance" +ret=0 + +run() +{ + $PERFORMANCE/odp_crypto${EXEEXT} --odph_proc || ret=1 +} + +run + +exit $ret diff --git a/test/linux-generic/performance/odp_l2fwd_run_proc.sh b/test/linux-generic/performance/odp_l2fwd_run_proc.sh new file mode 100755 index 0000000..5e0b0a6 --- /dev/null +++ b/test/linux-generic/performance/odp_l2fwd_run_proc.sh @@ -0,0 +1,117 @@ +#!/bin/sh +# +# Copyright (c) 2016, Linaro Limited +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# + +# TEST_DIR is set by Makefile, when we add a rule to Makefile for odp_l2fwd_run +# we can use TEST_DIR the same way odp_pktio_run uses it now. +# If TEST_DIR is not set it means we are not running with make, and in this case +# there are two situations: +# 1. user build ODP in the same dir as the source (most likely) +# here the user can simply call odp_l2fwd_run +# 2. user may have built ODP in a separate build dir (like bitbake usually does) +# here the user has to do something like $ODP/test/performance/odp_l2fwd_run +# +# In both situations the script assumes that the user is in the directory where +# odp_l2fwd exists. If that's not true, then the user has to specify the path +# to it and run: +# TEST_DIR=$builddir $ODP/test/performance/odp_l2fwd_run + +# directory where test binaries have been built +TEST_DIR="${TEST_DIR:-$PWD}" +PERFORMANCE="$TEST_DIR/../../common_plat/performance" + +# directory where test sources are, including scripts +TEST_SRC_DIR=$(dirname $0) + +PATH=$TEST_DIR:$TEST_DIR/../../../example/generator:$PATH + +# exit codes expected by automake for skipped tests +TEST_SKIPPED=77 + +PLATFORM_VALIDATION=${TEST_SRC_DIR}/../../$ODP_PLATFORM/validation + +# Use installed pktio env or for make check take it from platform directory +if [ -f "./pktio_env" ]; then + . ./pktio_env +elif [ "$ODP_PLATFORM" = "" ]; then + echo "$0: error: ODP_PLATFORM must be defined" + # not skipped as this should never happen via "make check" + exit 1 +elif [ -f ${PLATFORM_VALIDATION}/api/pktio/pktio_env ]; then + . ${PLATFORM_VALIDATION}/api/pktio/pktio_env +else + echo "BUG: unable to find pktio_env!" + echo "pktio_env has to be in current directory or in \ + platform/\$ODP_PLATFORM/test." + echo "ODP_PLATFORM=\"$ODP_PLATFORM\"" + exit 1 +fi + +run_l2fwd() +{ + setup_pktio_env clean # install trap to call cleanup_pktio_env + + if [ $? -ne 0 ]; then + echo "setup_pktio_env error $?" + exit $TEST_SKIPPED + fi + + type odp_generator > /dev/null + if [ $? -ne 0 ]; then + echo "odp_generator not installed. Aborting." + cleanup_pktio_env + exit 1 + fi + + #@todo: limit odp_generator to cores + #https://bugs.linaro.org/show_bug.cgi?id=1398 + (odp_generator${EXEEXT} -I $IF0 \ + --srcip 192.168.0.1 --dstip 192.168.0.2 \ + -m u 2>&1 > /dev/null) \ + 2>&1 > /dev/null & + GEN_PID=$! + + # this just turns off output buffering so that you still get periodic + # output while piping to tee, as long as stdbuf is available. + if [ "$(which stdbuf)" != "" ]; then + STDBUF="stdbuf -o 0" + else + STDBUF= + fi + LOG=odp_l2fwd_tmp.log + + #skip this because process mode is broken + #$STDBUF ${PERFORMANCE}/odp_l2fwd${EXEEXT} --odph_proc -i $IF1,$IF2 \ + #-m 0 -t 30 -c 2 | tee $LOG + #ret=$? + ret=77 + + kill ${GEN_PID} + + if [ ! -f $LOG ]; then + echo "FAIL: $LOG not found" + ret=1 + elif [ $ret -eq 0 ]; then + PASS_PPS=5000 + MAX_PPS=$(awk '/TEST RESULT/ {print $3}' $LOG) + if [ "$MAX_PPS" -lt "$PASS_PPS" ]; then + echo "FAIL: pps below threshold $MAX_PPS < $PASS_PPS" + ret=1 + fi + fi + + rm -f $LOG + cleanup_pktio_env + + exit $ret +} + +case "$1" in + setup) setup_pktio_env ;; + cleanup) cleanup_pktio_env ;; + *) run_l2fwd ;; +esac diff --git a/test/linux-generic/performance/odp_pktio_perf_run_proc.sh b/test/linux-generic/performance/odp_pktio_perf_run_proc.sh new file mode 100755 index 0000000..fccc7eb --- /dev/null +++ b/test/linux-generic/performance/odp_pktio_perf_run_proc.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# +# Copyright (c) 2016, Linaro Limited +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Script that passes command line arguments to odp_crypto test when +# launched by 'make check' + +TEST_DIR="${TEST_DIR:-$(dirname $0)}" +PERFORMANCE="$TEST_DIR/../../common_plat/performance" +ret=0 + +run() +{ + #skip because process mode is broken + #$PERFORMANCE/odp_pktio_perf${EXEEXT} --odph_proc || ret=1 + ret=77 +} + +run + +exit $ret