From patchwork Thu Apr 2 17:37:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 46734 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1A829216D1 for ; Thu, 2 Apr 2015 17:39:54 +0000 (UTC) Received: by lajy8 with SMTP id y8sf20013850laj.3 for ; Thu, 02 Apr 2015 10:39:53 -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=t3S+DfO+c9+mvTzp2vkBCNuA6q7oGAV0ZRLZq2LidDs=; b=QDtYmm0DRmS3mj1k81WTWiyJwM/UIMozOsgZA4E8JDBOjwN8WnZvm2zN3fb//APQwe nxegde6gJjKtb/aoTfoRWcflWrtn4oUFu+xE+KQPJKk4a7k6uRPBc7jgVeft+pqFxTUp D5SXBY0ij7zyic8U7XZeaEI/WKlLAEGWr/hm6OZ1mbhMIsRZPdXpUkWPbyFq6/iVXVWK BspTGR30Az9ldgGVe1EzjS7Fl4ILoHi/tGahKFU/Y4rs1AKw9VlQlq+JqdiUK8n7Jb3Z T6CVNinadvn6XGnOgHz3tal96XxJGX9hqIo6jQBjNe0bUgHMIgDVpIl9vZvKBfofVJJN xg3A== X-Gm-Message-State: ALoCoQncc3foGQapNiqYThUA820a13ZDtuR32tlO2Q1xoAwWpZNeo5LjXklMgRL6GZQPiIYcFngo X-Received: by 10.194.221.65 with SMTP id qc1mr12501435wjc.7.1427996393033; Thu, 02 Apr 2015 10:39:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.66 with SMTP id i2ls243211lah.21.gmail; Thu, 02 Apr 2015 10:39:52 -0700 (PDT) X-Received: by 10.152.37.202 with SMTP id a10mr42787816lak.0.1427996392868; Thu, 02 Apr 2015 10:39:52 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id ut15si2804348lbb.101.2015.04.02.10.39.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Apr 2015 10:39:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by labe2 with SMTP id e2so65322198lab.3 for ; Thu, 02 Apr 2015 10:39:52 -0700 (PDT) X-Received: by 10.152.178.197 with SMTP id da5mr42782282lac.56.1427996392759; Thu, 02 Apr 2015 10:39:52 -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.57.201 with SMTP id k9csp1489247lbq; Thu, 2 Apr 2015 10:39:52 -0700 (PDT) X-Received: by 10.55.16.87 with SMTP id a84mr54587931qkh.86.1427996391323; Thu, 02 Apr 2015 10:39:51 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h195si5671213qhc.59.2015.04.02.10.39.49; Thu, 02 Apr 2015 10:39:51 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id 50EFD650B7; Thu, 2 Apr 2015 17:39:49 +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 5566765027; Thu, 2 Apr 2015 17:37:51 +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 B28BC650A1; Thu, 2 Apr 2015 17:37:38 +0000 (UTC) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) by lists.linaro.org (Postfix) with ESMTPS id 18819650BA for ; Thu, 2 Apr 2015 17:37:16 +0000 (UTC) Received: by lahf3 with SMTP id f3so64635053lah.2 for ; Thu, 02 Apr 2015 10:37:15 -0700 (PDT) X-Received: by 10.112.145.136 with SMTP id su8mr11706273lbb.61.1427996235033; Thu, 02 Apr 2015 10:37:15 -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 k13sm1137255laa.28.2015.04.02.10.37.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Apr 2015 10:37:14 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 2 Apr 2015 20:37:02 +0300 Message-Id: <1427996222-26213-5-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427996222-26213-1-git-send-email-maxim.uvarov@linaro.org> References: <1427996222-26213-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv8 4/4] 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.50 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 --- test/performance/Makefile.am | 2 +- test/performance/odp_l2fwd_run | 63 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 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..f1a8cd1 --- /dev/null +++ b/test/performance/odp_l2fwd_run @@ -0,0 +1,63 @@ +#!/bin/sh +# +# Copyright (c) 2015, Linaro Limited +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# + +TEST_DIR=$(dirname $0) + +# 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 +else if [ "$ODP_PLATFORM" = "" ]; then + echo "$0: error: ODP_PLATFORM must be defined" + # not skipped as this should never happen via "make check" + exit 1 +else if [ -f ${TEST_DIR}/../../platform/$ODP_PLATFORM/test/pktio_env ]; then + . ${TEST_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 +fi + +run_l2fwd_example() +{ + 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 + ($TEST_DIR/../../example/generator/odp_generator -I $IF0 \ + --srcmac fe:0f:97:c9:e0:44 --dstmac 32:cb:9b:27:2f:1a \ + --srcip 192.168.0.1 --dstip 192.168.0.2 -m u 2>&1 > /dev/null) \ + 2>&1 > /dev/null & + + echo "Run $TEST_DIR/../../example/l2fwd/odp_l2fwd -i $IF1,$IF2 -m 0 -t 30 -c 2" + $TEST_DIR/../../example/l2fwd/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_example ;; +esac