From patchwork Tue Aug 16 21:10:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 74042 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp2195934qga; Tue, 16 Aug 2016 14:10:27 -0700 (PDT) X-Received: by 10.55.181.195 with SMTP id e186mr39400998qkf.153.1471381827429; Tue, 16 Aug 2016 14:10:27 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f205si9320534qkb.17.2016.08.16.14.10.26; Tue, 16 Aug 2016 14:10:27 -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 B336C60A25; Tue, 16 Aug 2016 21:10:26 +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 78FC6609D3; Tue, 16 Aug 2016 21:10:16 +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 EE6F860977; Tue, 16 Aug 2016 21:10:10 +0000 (UTC) Received: from mail-qt0-f169.google.com (mail-qt0-f169.google.com [209.85.216.169]) by lists.linaro.org (Postfix) with ESMTPS id D8AF060977 for ; Tue, 16 Aug 2016 21:10:09 +0000 (UTC) Received: by mail-qt0-f169.google.com with SMTP id u25so41473343qtb.1 for ; Tue, 16 Aug 2016 14:10:09 -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=koloUFfo0D7NV2Tjy0LL1BjI5dh8o6ro0il+cCw7vck=; b=Gbd7qBlGyVvvnB2T2Jir7P08fLUHsnTyvfZrAt1m5/CtXEs0jUZFIze7C3RXpudpav YSE8w/YuzyeOWw0yQuK9HU0hXlb04NsqRpElD38rLppqHZWDsrnPt9w/4Ijhyl/G53Sr hBuuzl9Bjr3YWpAn8znIVSFS5+4S/b/MGnUen4w2Z5f8GHxRuPNtMH3fX27/qG/ROz/u Gxp21fUQCe+91Dfv3XW5n+ICZYj87EzpUZfIiKwHTL/RWoL5LHirqsRTtF8MXz77GWqw O6pWosVz8N1lfopEAAJmKINtTXwMWM3odPaoaUD8SuNKDbAfSRRX6bJ6Ev/XP7NxtSmq T+WQ== X-Gm-Message-State: AEkoouti/uTjzpmud1Cr5B0XxJImWmt5MzHGueeKxvLfwJElnhFlJFYhjZZkOCIQ5p5SIYsLpm4= X-Received: by 10.200.48.146 with SMTP id v18mr41568596qta.107.1471381809337; Tue, 16 Aug 2016 14:10:09 -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 l187sm4775162qkc.8.2016.08.16.14.10.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Aug 2016 14:10:08 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Tue, 16 Aug 2016 17:10:04 -0400 Message-Id: <1471381804-15326-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.7.4 X-Topics: patch Subject: [lng-odp] [PATCH] 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 --- 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 Reviewed-by: Bill Fischofer diff --git a/test/linux-generic/performance/Makefile.am b/test/linux-generic/performance/Makefile.am index cb72fce..41aead5 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_scheduling_run_proc.sh \ + odp_crypto_run_proc.sh \ + odp_pktio_perf_run_proc.sh \ + odp_l2fwd_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