From patchwork Wed Apr 8 18:22:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 46889 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 D7A7E20D10 for ; Wed, 8 Apr 2015 18:25:12 +0000 (UTC) Received: by wgiv13 with SMTP id v13sf21212731wgi.3 for ; Wed, 08 Apr 2015 11:25:12 -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=ORsmokXenzcmfY30J4quLqEgXPFeJsmb802UAHkQYLE=; b=VVRTvKZRaMJ1841fztzBV4OQ2bMarKS/XaCON4wjoxryH80348MZEe3drppj7NtuVm 0h0m9KsHmynWIa+J19x8GxYM+Mv0QFNevvQAIymQ+Ey859X6/owVFjSAhF+YQm+vf8qh sfvU4YpqO3gb4ksjCiKsum1HU0zFLmOZSBOFlYNkg+uCYhHkzdSHtSadlY4/FT40V3J5 Haq0j3kqUHv1xCMZdIIPfl49n9AAklUgnn8I1qoik0V+ovum/6iCC8WBJ/HYTWWAxXAj YDqSVP2YEtfpm4fuP/nmyuj9QaGKK3kPW5KN6Bsl1wmY+fA5HfQC+sZhIQerBYYabYXk unEA== X-Gm-Message-State: ALoCoQn7gj44wG9F6eJPKHvawU3pRiEB2toc4A1fv3jwMDme9cVo2m/a6BwFK+O0igef3OHV4M5i X-Received: by 10.112.162.135 with SMTP id ya7mr5233608lbb.14.1428517512146; Wed, 08 Apr 2015 11:25:12 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.66 with SMTP id i2ls232750lah.19.gmail; Wed, 08 Apr 2015 11:25:12 -0700 (PDT) X-Received: by 10.152.26.169 with SMTP id m9mr1087287lag.45.1428517511947; Wed, 08 Apr 2015 11:25:11 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id or2si9485349lac.40.2015.04.08.11.25.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Apr 2015 11:25:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by labbd9 with SMTP id bd9so61083054lab.2 for ; Wed, 08 Apr 2015 11:25:11 -0700 (PDT) X-Received: by 10.112.119.234 with SMTP id kx10mr21043943lbb.35.1428517511848; Wed, 08 Apr 2015 11:25:11 -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 l1csp18198lbt; Wed, 8 Apr 2015 11:25:11 -0700 (PDT) X-Received: by 10.55.49.129 with SMTP id x123mr51684096qkx.48.1428517510343; Wed, 08 Apr 2015 11:25:10 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id p1si11778371qcp.31.2015.04.08.11.25.09; Wed, 08 Apr 2015 11:25:10 -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 808BB64FC3; Wed, 8 Apr 2015 18:25:09 +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 25B6864FCD; Wed, 8 Apr 2015 18:23:15 +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 02C5664FCF; Wed, 8 Apr 2015 18:23:12 +0000 (UTC) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) by lists.linaro.org (Postfix) with ESMTPS id F1FA764FC4 for ; Wed, 8 Apr 2015 18:22:31 +0000 (UTC) Received: by lbcga7 with SMTP id ga7so23909268lbc.1 for ; Wed, 08 Apr 2015 11:22:31 -0700 (PDT) X-Received: by 10.112.160.227 with SMTP id xn3mr24109605lbb.112.1428517350945; Wed, 08 Apr 2015 11:22:30 -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 o8sm2664845lal.2.2015.04.08.11.22.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Apr 2015 11:22:29 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 8 Apr 2015 21:22:16 +0300 Message-Id: <1428517336-29626-6-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1428517336-29626-1-git-send-email-maxim.uvarov@linaro.org> References: <1428517336-29626-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv13 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.215.53 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 Signed-off-by: Maxim Uvarov --- test/performance/Makefile.am | 2 +- test/performance/odp_l2fwd_run | 80 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100755 test/performance/odp_l2fwd_run diff --git a/test/performance/Makefile.am b/test/performance/Makefile.am index b501584..63f73e0 100644 --- a/test/performance/Makefile.am +++ b/test/performance/Makefile.am @@ -6,7 +6,7 @@ EXECUTABLES = odp_atomic COMPILE_ONLY = odp_scheduling odp_l2fwd -TESTSCRIPTS = odp_scheduling_run +TESTSCRIPTS = odp_scheduling_run odp_l2fwd_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..6dff284 --- /dev/null +++ b/test/performance/odp_l2fwd_run @@ -0,0 +1,80 @@ +#!/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 + if [ "$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 +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