From patchwork Mon Apr 13 08:52:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 47101 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7861F20553 for ; Mon, 13 Apr 2015 08:55:26 +0000 (UTC) Received: by wghm4 with SMTP id m4sf16101034wgh.2 for ; Mon, 13 Apr 2015 01:55:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=6/XYR59q270yTuwH7rPUTskR4rUFwiKDZlEV3L24nis=; b=BYeeA/hcfXH97DticIa6YBpFyI3M3+QkVrQiAorRpLhx90Qr24wqwJQ4l6/CUR4CUL VvZWyVUZ2quJ54sCe/AQfkhOFGgrmX3khtN09r/riUFytv2/+pf6TdHtLIqcZtS+b0Jr xFiK0b6z98p2Ip9ldfidwip1c5DysTYpdzGcXWgwFkXp50oPq2Jq5jMMjWRGhfGTd+D8 M8qEyiKWAAIf9xm+d0wsvC+iM/eaus70AlQGtUVF8MkSs5kQDvK7s7EyK9Kw7tkzORVJ H69dwKMuS7g2JZt9Xv++oQVtWbzftb9fJnlMFOa/OyhXlX5NLjaspP6lwdRZYkB7r8Ns njFw== X-Gm-Message-State: ALoCoQnV6GT62d7jMh256bfcvy2ENJKNuKVJ93GwTdC1v9wQ3bQpNXj3F+hdLoHu6vitLoOyeBXB X-Received: by 10.112.201.232 with SMTP id kd8mr2226272lbc.16.1428915325686; Mon, 13 Apr 2015 01:55:25 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.178.225 with SMTP id db1ls610524lac.78.gmail; Mon, 13 Apr 2015 01:55:25 -0700 (PDT) X-Received: by 10.112.63.165 with SMTP id h5mr12131405lbs.16.1428915325332; Mon, 13 Apr 2015 01:55:25 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id te1si7889275lbb.72.2015.04.13.01.55.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Apr 2015 01:55:25 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbbzk7 with SMTP id zk7so53449376lbb.0 for ; Mon, 13 Apr 2015 01:55:25 -0700 (PDT) X-Received: by 10.112.140.231 with SMTP id rj7mr12078225lbb.76.1428915325197; Mon, 13 Apr 2015 01:55:25 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp1077870lbt; Mon, 13 Apr 2015 01:55:24 -0700 (PDT) X-Received: by 10.140.23.133 with SMTP id 5mr16353013qgp.84.1428915323816; Mon, 13 Apr 2015 01:55:23 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d38si10246505qkh.119.2015.04.13.01.55.23; Mon, 13 Apr 2015 01:55:23 -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; Received: by lists.linaro.org (Postfix, from userid 109) id 0B18261CBE; Mon, 13 Apr 2015 08:55:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 145F861CBF; Mon, 13 Apr 2015 08:53:22 +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 48E7861CDD; Mon, 13 Apr 2015 08:53:17 +0000 (UTC) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com [209.85.215.44]) by lists.linaro.org (Postfix) with ESMTPS id A85C061CD2 for ; Mon, 13 Apr 2015 08:52:46 +0000 (UTC) Received: by layy10 with SMTP id y10so52019758lay.0 for ; Mon, 13 Apr 2015 01:52:45 -0700 (PDT) X-Received: by 10.152.36.227 with SMTP id t3mr12573484laj.12.1428915165616; Mon, 13 Apr 2015 01:52:45 -0700 (PDT) Received: from localhost.localdomain (ppp91-76-169-66.pppoe.mtu-net.ru. [91.76.169.66]) by mx.google.com with ESMTPSA id lf12sm1495061lac.38.2015.04.13.01.52.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Apr 2015 01:52:44 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Mon, 13 Apr 2015 11:52:27 +0300 Message-Id: <1428915147-14871-6-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1428915147-14871-1-git-send-email-maxim.uvarov@linaro.org> References: <1428915147-14871-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv14 5/5] validation: add new test l2fwd_run X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Maxim Uvarov Signed-off-by: Ciprian Barbu Reviewed-by: Anders Roxell Reviewed-by: Mike Holmes --- test/performance/Makefile.am | 6 ++-- test/performance/odp_l2fwd_run | 79 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 2 deletions(-) create mode 100755 test/performance/odp_l2fwd_run diff --git a/test/performance/Makefile.am b/test/performance/Makefile.am index b501584..2304bd3 100644 --- a/test/performance/Makefile.am +++ b/test/performance/Makefile.am @@ -4,9 +4,11 @@ TESTS_ENVIRONMENT = TEST_DIR=${builddir} ODP_PLATFORM=${with_platform} EXECUTABLES = odp_atomic -COMPILE_ONLY = odp_scheduling odp_l2fwd +COMPILE_ONLY = odp_l2fwd \ + odp_scheduling -TESTSCRIPTS = odp_scheduling_run +TESTSCRIPTS = odp_l2fwd_run \ + odp_scheduling_run if test_perf TESTS = $(EXECUTABLES) $(TESTSCRIPTS) diff --git a/test/performance/odp_l2fwd_run b/test/performance/odp_l2fwd_run new file mode 100755 index 0000000..bbf0c0c --- /dev/null +++ b/test/performance/odp_l2fwd_run @@ -0,0 +1,79 @@ +#!/bin/sh +# +# Copyright (c) 2015, 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}" +# 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 + +# 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 ${TEST_SRC_DIR}/../../platform/$ODP_PLATFORM/test/pktio_env ]; then + . ${TEST_SRC_DIR}/../../platform/$ODP_PLATFORM/test/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 + if [ $? -ne 0 ]; then + echo "setup_pktio_env error $?" + exit $TEST_SKIPPED + fi + + #@todo: limit odp_generator to cores + #https://bugs.linaro.org/show_bug.cgi?id=1398 + (odp_generator -I $IF0 \ + --srcip 192.168.0.1 --dstip 192.168.0.2 -m u 2>&1 > /dev/null) \ + 2>&1 > /dev/null & + + echo "Run odp_l2fwd -i $IF1,$IF2 -m 0 -t 30 -c 2" + odp_l2fwd -i $IF1,$IF2 -m 0 -t 30 -c 2 + + cleanup_pktio_env + if [ $? -ne 0 ]; then + echo "cleanup_pktio_env error $?" + exit $TEST_SKIPPED + fi + + exit 0 +} + +case "$1" in + setup) setup_pktio_env ;; + cleanup) cleanup_pktio_env ;; + *) run_l2fwd ;; +esac