From patchwork Thu Feb 22 09:00:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 129165 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp371987lja; Thu, 22 Feb 2018 01:03:08 -0800 (PST) X-Google-Smtp-Source: AH8x225fZGbtAjDxVOgK314Vn6OCmZ4tBB5eqpF+2tSvplzWgGfEA6wqbyiun6q4CLhTTdQ0Ic07 X-Received: by 10.200.62.1 with SMTP id z1mr9505435qtf.218.1519290187849; Thu, 22 Feb 2018 01:03:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519290187; cv=none; d=google.com; s=arc-20160816; b=p2VWIb1m7mRqPo5RwMks+Q2ix2R6nT9wxJmp/wgvWh1hks23HmmApgknPlg6TfCuLC kr7s4wyjjncbIWvjuPT4AUniiy85RzCAAfep3wO41BfmR3g2PhAZL/LaDTreRW5ukmuV qmbGxET8AzM/78hJtBeNjpnIIy1xdxVKMiZ35mwgPDv+EpQLExB0hJkCi7HNX3AIwNJC Q9GvyO/l9+qkBJkW2+EierpBqVBPngVlisgt/HwAZrqSO+kIZKGtcRR4W3+NHX6jcCUg W+xM8r64fY7a0T8gQryFuZH1Vgkvw87buIHoubHbae9LnnZ9cypP1PYWTr+AoJLdG1ij jOgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=OtH4kCvj1HqfcdeAmLvsta/zQZv/l2jHNCPg8MOina4=; b=bh+cGciuzbsalqQWYxyVtXqaWvo6/fV+cpNppIt5Eyj3n5j/Al6cQaagHZr52rUoRf yvakE2gLmOJwUEGgz8anz8X6FU9+9PXQZ2f+faphKzI4FaCPGUDWwgX3r5O0VNgjRVH3 iJwcstV/DYGISsNw4eDhdsWbRaDH0ynD4RCjWn6I7JVdbsgevb+GqvgBfGH9TpA6rz5o sxPWfuDgxesaOVUvkBFca5+QE8PUgAE4x40+3nIaW9SIHr22DfSi71L3lWu3UidpE8mn xG8Nc3R/zAX7A1xbpfp6ElDZdiHGYbLxBXC1bFCQ6tH+VVSsmTEh9LEpKMDis7bTk5z+ 1cOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id q16si1862745qtb.351.2018.02.22.01.03.07; Thu, 22 Feb 2018 01:03:07 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 7CB5760669; Thu, 22 Feb 2018 09:03: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,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 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 CAD62616EA; Thu, 22 Feb 2018 09:00:43 +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 15E0E61700; Thu, 22 Feb 2018 09:00:25 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id 713256172B for ; Thu, 22 Feb 2018 09:00:19 +0000 (UTC) Received: from mxback5j.mail.yandex.net (mxback5j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10e]) by forward100j.mail.yandex.net (Yandex) with ESMTP id BB4745D8569A for ; Thu, 22 Feb 2018 12:00:13 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback5j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id MA2e5PbmUW-0CTCWiRP; Thu, 22 Feb 2018 12:00:12 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Qk3Eeopztj-0BH08tmC; Thu, 22 Feb 2018 12:00:11 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 22 Feb 2018 12:00:04 +0300 Message-Id: <1519290010-13383-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519290010-13383-1-git-send-email-odpbot@yandex.ru> References: <1519290010-13383-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 496 Subject: [lng-odp] [PATCH v1 1/7] Revert "example: generator move to platform 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" From: Dmitry Eremin-Solenikov This reverts commit 5a58bbf2bb331fd7dde2ebbc0430634ace6900fb. Don't make platform tests depend on examples. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 496 (lumag:tests-fix-2) ** https://github.com/Linaro/odp/pull/496 ** Patch: https://github.com/Linaro/odp/pull/496.patch ** Base sha: 5a58bbf2bb331fd7dde2ebbc0430634ace6900fb ** Merge commit sha: 2ca48deb89c7ac000bd44a1da037c36de66720cb **/ example/generator/Makefile.am | 5 +++ example/generator/generator_run.sh | 17 ++++++++ platform/linux-generic/m4/configure.m4 | 2 - platform/linux-generic/test/Makefile.am | 4 -- platform/linux-generic/test/example/Makefile.am | 1 - .../test/example/generator/Makefile.am | 4 -- .../test/example/generator/generator_run.sh | 45 ---------------------- 7 files changed, 22 insertions(+), 56 deletions(-) create mode 100755 example/generator/generator_run.sh delete mode 100644 platform/linux-generic/test/example/Makefile.am delete mode 100644 platform/linux-generic/test/example/generator/Makefile.am delete mode 100755 platform/linux-generic/test/example/generator/generator_run.sh diff --git a/example/generator/Makefile.am b/example/generator/Makefile.am index 7deeef406..63f4ae608 100644 --- a/example/generator/Makefile.am +++ b/example/generator/Makefile.am @@ -3,3 +3,8 @@ include $(top_srcdir)/example/Makefile.inc bin_PROGRAMS = odp_generator odp_generator_SOURCES = odp_generator.c + +if test_example +TESTS = generator_run.sh +endif +EXTRA_DIST = generator_run.sh diff --git a/example/generator/generator_run.sh b/example/generator/generator_run.sh new file mode 100755 index 000000000..2d741a8d1 --- /dev/null +++ b/example/generator/generator_run.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# +# Copyright (c) 2018, Linaro Limited +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# + +./odp_generator${EXEEXT} -w 1 -n 1 -I null:0 -m u +STATUS=$? + +if [ "$STATUS" -ne 0 ]; then + echo "Error: status was: $STATUS, expected 0" + exit 1 +fi + +exit 0 diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4 index 935894b8c..7fa3652e2 100644 --- a/platform/linux-generic/m4/configure.m4 +++ b/platform/linux-generic/m4/configure.m4 @@ -19,8 +19,6 @@ AM_CONDITIONAL([PLATFORM_IS_LINUX_GENERIC], AC_CONFIG_FILES([platform/linux-generic/Makefile platform/linux-generic/libodp-linux.pc platform/linux-generic/test/Makefile - platform/linux-generic/test/example/Makefile - platform/linux-generic/test/example/generator/Makefile platform/linux-generic/test/validation/api/shmem/Makefile platform/linux-generic/test/validation/api/pktio/Makefile platform/linux-generic/test/mmap_vlan_ins/Makefile diff --git a/platform/linux-generic/test/Makefile.am b/platform/linux-generic/test/Makefile.am index e317ff736..99934099a 100644 --- a/platform/linux-generic/test/Makefile.am +++ b/platform/linux-generic/test/Makefile.am @@ -3,10 +3,6 @@ TESTS_ENVIRONMENT += TEST_DIR=${top_builddir}/test/validation SUBDIRS = performance -if test_example -SUBDIRS += example -endif - if test_vald TESTS = validation/api/pktio/pktio_run.sh \ validation/api/pktio/pktio_run_tap.sh \ diff --git a/platform/linux-generic/test/example/Makefile.am b/platform/linux-generic/test/example/Makefile.am deleted file mode 100644 index 41d287522..000000000 --- a/platform/linux-generic/test/example/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = generator diff --git a/platform/linux-generic/test/example/generator/Makefile.am b/platform/linux-generic/test/example/generator/Makefile.am deleted file mode 100644 index 3bdfdc69c..000000000 --- a/platform/linux-generic/test/example/generator/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -TESTS_ENVIRONMENT = EXAMPLE_DIR=${top_builddir}/example/generator - -TESTS = generator_run.sh -EXTRA_DIST = generator_run.sh diff --git a/platform/linux-generic/test/example/generator/generator_run.sh b/platform/linux-generic/test/example/generator/generator_run.sh deleted file mode 100755 index 3e7fabfe7..000000000 --- a/platform/linux-generic/test/example/generator/generator_run.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2018, Linaro Limited -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause -# - -# directory where platform test sources are, including scripts -TEST_SRC_DIR=$(dirname $0) - -# exit codes expected by automake for skipped tests -TEST_SKIPPED=77 - -# directories where binary can be found: -# -in the validation dir when running make check (intree or out of tree) -# -in the script directory, when running after 'make install', or -# -in the validation when running standalone intree. -# -in the current directory. -# running stand alone out of tree requires setting PATH -PATH="${EXAMPLE_DIR}/:$PATH" -PATH="`pwd`/example/generator/:$PATH" -PATH="$(dirname $0)/../../../../../example/generator:$PATH" -PATH=".:$PATH" - -bin_path=$(which odp_generator${EXEEXT}) -if [ -x "$bin_path" ] ; then - echo "running with odp_generator: $bin_path" -else - echo "cannot odp_generator: please set you PATH for it." - pwd - echo $PATH - exit 1 -fi - - -odp_generator${EXEEXT} -w 1 -n 1 -I null:0 -m u -STATUS=$? - -if [ "$STATUS" -ne 0 ]; then - echo "Error: status was: $STATUS, expected 0" - exit 1 -fi - -exit 0 From patchwork Thu Feb 22 09:00:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 129163 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp370447lja; Thu, 22 Feb 2018 01:01:25 -0800 (PST) X-Google-Smtp-Source: AG47ELuf1cHSDUWPrLF5PiRFLPggneHhuhk916i3uog/STUUJkGWKeaq4k7z/3hSuCmE9ez/niDO X-Received: by 10.55.26.69 with SMTP id a66mr10084307qka.146.1519290085061; Thu, 22 Feb 2018 01:01:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519290085; cv=none; d=google.com; s=arc-20160816; b=nGdvAWdd3kTjEqWfEXWrk6QPwjsFwBlo36vNpAs6v8jGslaLhOBcMNXIxqEt0h1P+v uM8EajfkvmRuFmyT6H62z7mKBRoXAq18ki/9ypS71tLccJuf1hAiixOo1fv7k11iminu Cxt7G5IMukyPV/rWhqi2bdGDJWGxIniiWtSpIMykMYBWRO1Ea9OOzlQ1LdPQ3fUAh34J hooeH0gMC8H1T0jXYU8ep9eEfB4GwLe5eyGcXMTID+CLen1i+gNOstOU2KILdnw6INua Rw3XzQJlexZcVCxAnxDdYLqOpMYhwLFlnG1T15VNPcsLO4lG7tWb7NgooJn6ICuVR7dh lVFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=mssezrqHwqO8QMJpInIO6FOV9XHzAS6UhkkQT93N5/s=; b=gpbtosEsKN4uOrOIQmlJDxyVQoeptUGeg58e4leFdlssxepw8Rb2yq/uk2bfPCGL3x WRMbFCVrpgcQ3RcPyL4W13+bliwV0/XkpPH1DzRW3/J0nJTj+1Uy56dRkScJpO7HC/o3 S32tMiaxY6UAOS0lmcLvbnL9sQ4x99pXhTy5GrOnboDPOKzYSNQ3n4dhnFpdKWMc/f/6 kww3Lfet4pPyTed57/lUTHITy7Q/PbEFHlaietEVtEPYsMmUy+3eOtTApxtCtdOn5WDW Dlz+NuL+x1aWXLuomvI8W0B6I5UGl6/9Rcm/9vzvE25VQA6uMJzhs93cU6w6odUI1+pK /iIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id t24si1324115qtg.472.2018.02.22.01.01.24; Thu, 22 Feb 2018 01:01:25 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id BAFAF61748; Thu, 22 Feb 2018 09:01:24 +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,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 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 C0F3760745; Thu, 22 Feb 2018 09:00:31 +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 ED58661737; Thu, 22 Feb 2018 09:00:22 +0000 (UTC) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [37.140.190.183]) by lists.linaro.org (Postfix) with ESMTPS id 82DF8616EA for ; Thu, 22 Feb 2018 09:00:16 +0000 (UTC) Received: from mxback9j.mail.yandex.net (mxback9j.mail.yandex.net [IPv6:2a02:6b8:0:1619::112]) by forward105o.mail.yandex.net (Yandex) with ESMTP id 5DAD34445FD0 for ; Thu, 22 Feb 2018 12:00:14 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback9j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id aUMK0yviAt-0EvqL2Pf; Thu, 22 Feb 2018 12:00:14 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Qk3Eeopztj-0DHmi6Lv; Thu, 22 Feb 2018 12:00:13 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 22 Feb 2018 12:00:05 +0300 Message-Id: <1519290010-13383-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519290010-13383-1-git-send-email-odpbot@yandex.ru> References: <1519290010-13383-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 496 Subject: [lng-odp] [PATCH v1 2/7] example: generator: skip execution on unsupported platforms 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" From: Dmitry Eremin-Solenikov null: pktio class is not a part of ABI, so it might be unsupported on some of platforms. Add condition guarding execution of this example only on supported platforms. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 496 (lumag:tests-fix-2) ** https://github.com/Linaro/odp/pull/496 ** Patch: https://github.com/Linaro/odp/pull/496.patch ** Base sha: 5a58bbf2bb331fd7dde2ebbc0430634ace6900fb ** Merge commit sha: 2ca48deb89c7ac000bd44a1da037c36de66720cb **/ example/generator/Makefile.am | 3 +++ example/generator/generator_run.sh | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/example/generator/Makefile.am b/example/generator/Makefile.am index 63f4ae608..cd2383187 100644 --- a/example/generator/Makefile.am +++ b/example/generator/Makefile.am @@ -4,7 +4,10 @@ bin_PROGRAMS = odp_generator odp_generator_SOURCES = odp_generator.c +TEST_EXTENSIONS = .sh + if test_example TESTS = generator_run.sh +TESTS_ENVIRONMENT += ODP_PLATFORM=$(with_platform) endif EXTRA_DIST = generator_run.sh diff --git a/example/generator/generator_run.sh b/example/generator/generator_run.sh index 2d741a8d1..3d8ac0e98 100755 --- a/example/generator/generator_run.sh +++ b/example/generator/generator_run.sh @@ -6,6 +6,12 @@ # SPDX-License-Identifier: BSD-3-Clause # +if [ -n "${ODP_PLATFORM}" -a "x${ODP_PLATFORM}" != "xlinux-generic" ] +then + echo "Skipping test on probably unsupported platform" + exit 77 +fi + ./odp_generator${EXEEXT} -w 1 -n 1 -I null:0 -m u STATUS=$? From patchwork Thu Feb 22 09:00:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 129164 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp371244lja; Thu, 22 Feb 2018 01:02:17 -0800 (PST) X-Google-Smtp-Source: AG47ELuUil13owhNmJqpEG/ZBmuOTTwe4sb2BSbU9nHK3enNO2u1QXHt/9wuGfrQUhUQRLjyMju+ X-Received: by 10.55.154.207 with SMTP id c198mr9844246qke.313.1519290137248; Thu, 22 Feb 2018 01:02:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519290137; cv=none; d=google.com; s=arc-20160816; b=ytoGARtjuL3JFQB3xZlr8rM3SsbaLYIIEmLaHtXsQpBb4bSBSkyUrhR17QvIMt3vRw tZD1paxEPLrsU8AdZl4KCC2XGjdZDJdA9iUyor0nPM+kfUF2hL14ZKgn4JIAQK4LtvXj +e1DFHgVB2ASONRAFn3C1bOj8PKEMXXIVQPENJGEXG8agaug/bec2v9Dm1bwTS5xCQmf 7y9GFt3X1O4Po8VMbkNqiH/l291vJxIUOsqbRb0bdjXRBLyyamDfOt6kYKiNS3kOi7HS eygIQ++OmD/VlKtfW/IPoqfwcsqMUH2m5unS1FANzMY5SAiQlCC1hpQNzlWkQSAKRvkJ nahg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=mRjaAP8ldDnH4MzSIwXWjG2K3LziS8X3SOE+S9Xfgh8=; b=jbmm/QR+pL8TA5in+xwTiK5d04WB7mCKqt52uql2smf/k11Cm+W8s/EIE7HlHGnGlj QSAgFB2++4zmdKS/V6WwK1AMtKsKHYZ7g2DEAkv5lJk9OHfVsfd2glb53+ahDV1J1t3r c2ltESndirJSA/u2eeAFMtnOA6sCWWW22BGJR5SQx/QV32daWUJDT2nkltS5iESeh5on kqQgCL+Q+ea6lnjGmRX2eT7ZPPccS6rJaUCt18TVx59a59U8FzRejxPTndawhScmPrZE cBO2CzuU8XxlecVFUxXyhf2pj6w0sgWSFY9yrbbGM4EbKF4cwJn4t3ru/NfBEB7Kx1Y9 vKTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id c14si7294497qkm.21.2018.02.22.01.02.16; Thu, 22 Feb 2018 01:02:17 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id DA1ED60813; Thu, 22 Feb 2018 09:02:16 +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,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 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 70FED609C7; Thu, 22 Feb 2018 09:00:36 +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 A8A9F61732; Thu, 22 Feb 2018 09:00:23 +0000 (UTC) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [37.140.190.183]) by lists.linaro.org (Postfix) with ESMTPS id 89FFC61700 for ; Thu, 22 Feb 2018 09:00:16 +0000 (UTC) Received: from mxback3j.mail.yandex.net (mxback3j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10c]) by forward105o.mail.yandex.net (Yandex) with ESMTP id 2D5F24444A88 for ; Thu, 22 Feb 2018 12:00:15 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback3j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id HnpgAxMGFp-0F5aM8i8; Thu, 22 Feb 2018 12:00:15 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Qk3Eeopztj-0EHOZw2u; Thu, 22 Feb 2018 12:00:14 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 22 Feb 2018 12:00:06 +0300 Message-Id: <1519290010-13383-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519290010-13383-1-git-send-email-odpbot@yandex.ru> References: <1519290010-13383-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 496 Subject: [lng-odp] [PATCH v1 3/7] build: change order of subdirectories 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" From: Dmitry Eremin-Solenikov Descend into examples after building/running tests. It is quite logical that first we build validation & performance tests, then we build platform tests, helper tests and only after that descend into examples. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 496 (lumag:tests-fix-2) ** https://github.com/Linaro/odp/pull/496 ** Patch: https://github.com/Linaro/odp/pull/496.patch ** Base sha: 5a58bbf2bb331fd7dde2ebbc0430634ace6900fb ** Merge commit sha: 2ca48deb89c7ac000bd44a1da037c36de66720cb **/ Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index dab8ca8c6..1e1988451 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,11 +12,11 @@ SUBDIRS = \ include \ $(PLATFORM_DIR) \ helper \ - helper/test \ doc \ - example . \ test \ - $(PLATFORM_TEST_DIR) + $(PLATFORM_TEST_DIR) \ + helper/test \ + example @DX_RULES@ From patchwork Thu Feb 22 09:00:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 129167 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp374003lja; Thu, 22 Feb 2018 01:05:17 -0800 (PST) X-Google-Smtp-Source: AH8x227jYGSegDfsa2Pahgxz4dCbDIw3DN4MF9sjyjW9sl3Tq0UihiWfDJrrnZ+kif+D4rh7Ig+G X-Received: by 10.200.39.6 with SMTP id g6mr9757515qtg.169.1519290316989; Thu, 22 Feb 2018 01:05:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519290316; cv=none; d=google.com; s=arc-20160816; b=JXi1RFHgXxIvnnRN4VoBBmFthPzs/Us1lmN2MRS6BVMa1bXqFl9vucjobF/elyoelQ PkXCacU+Jru1gNCCRNKoNumXUAlx7OD9J/9aGShvmwBKGdkmzFg4ia2GxRzBB/CjHuO8 o2Lf0DleuX4TMvMWD8lk0F37mzOT6KF+TbVAGbjqzopJP/Q29HSxeFwdHwu9de+YxcgX f/UsMWzNU8jp+Y8kxBDahV59rhEwOWRFmnye56DYWXWlP+DruofvJ3OFxcYe3iv7SUkf VMkHgXPSel2CAJH3nTh7ccavmCHBx5tR1MRfj4ao4fdkA/Y2Lkx8S+kmqXlgtvbDuSCK /EOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=kyfwyj37soZBsG8zBVhlr1m4/6JIUhjlBTnEc+vBbgI=; b=gw5GRkV2bhMuCo8u0QR0TJ5sW9sNQ9YzfAN/xX1PtppNCfDVONr9aQBnJaPKnqX7bQ Gj3LGhTr2uWOCPTmWgk+T+p2gxP5Gmu72OPHixZjgrXDVWYy39dcmj6h/I2rzTJSRBFR 7iRGGI6XdiYP/5vznCo7XHBHW9AVXqN0xdmd+DkKHfwueeXzpyFF0nk3eGag9Fwo4WJd nTJLF8zEwGKlbPXaktMKZYh9DaHYBuQUsDBKAKuJD8xzXo8uTAF4UIgNESMNP0ZlsjTd JN1941uoEFfDjSy0/33aWuTR38vs98k0vSaoxmR79gW6raKL/u0vTcYKsXP/eMshOEdy qHuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id g18si3059682qtk.160.2018.02.22.01.05.16; Thu, 22 Feb 2018 01:05:16 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 8A8066172B; Thu, 22 Feb 2018 09:05:16 +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,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 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 75A7461732; Thu, 22 Feb 2018 09:00:55 +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 3EF00616EA; Thu, 22 Feb 2018 09:00:27 +0000 (UTC) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) by lists.linaro.org (Postfix) with ESMTPS id 1A7436171C for ; Thu, 22 Feb 2018 09:00:18 +0000 (UTC) Received: from mxback7j.mail.yandex.net (mxback7j.mail.yandex.net [IPv6:2a02:6b8:0:1619::110]) by forward101o.mail.yandex.net (Yandex) with ESMTP id 1CA721345D48 for ; Thu, 22 Feb 2018 12:00:16 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback7j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 52vbNqmrLX-0GkSLJr0; Thu, 22 Feb 2018 12:00:16 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Qk3Eeopztj-0FHWT615; Thu, 22 Feb 2018 12:00:15 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 22 Feb 2018 12:00:07 +0300 Message-Id: <1519290010-13383-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519290010-13383-1-git-send-email-odpbot@yandex.ru> References: <1519290010-13383-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 496 Subject: [lng-odp] [PATCH v1 4/7] validation: init: remove "library" file 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" From: Dmitry Eremin-Solenikov Split init.c/init.h files into individual tests, simplifying setup. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 496 (lumag:tests-fix-2) ** https://github.com/Linaro/odp/pull/496 ** Patch: https://github.com/Linaro/odp/pull/496.patch ** Base sha: 5a58bbf2bb331fd7dde2ebbc0430634ace6900fb ** Merge commit sha: 2ca48deb89c7ac000bd44a1da037c36de66720cb **/ test/validation/api/init/Makefile.am | 6 +- test/validation/api/init/init.c | 190 ----------------------------- test/validation/api/init/init.h | 32 ----- test/validation/api/init/init_main_abort.c | 55 ++++++++- test/validation/api/init/init_main_log.c | 76 +++++++++++- test/validation/api/init/init_main_ok.c | 45 ++++++- 6 files changed, 173 insertions(+), 231 deletions(-) delete mode 100644 test/validation/api/init/init.c delete mode 100644 test/validation/api/init/init.h diff --git a/test/validation/api/init/Makefile.am b/test/validation/api/init/Makefile.am index 2d0661431..5af2e00bc 100644 --- a/test/validation/api/init/Makefile.am +++ b/test/validation/api/init/Makefile.am @@ -4,6 +4,6 @@ include ../Makefile.inc # following each other: therefore 3 separate binaries are # created, each containing its ODP init test. test_PROGRAMS = init_main_abort init_main_log init_main_ok -init_main_abort_SOURCES = init_main_abort.c init.c init.h -init_main_log_SOURCES = init_main_log.c init.c init.h -init_main_ok_SOURCES = init_main_ok.c init.c init.h +init_main_abort_SOURCES = init_main_abort.c +init_main_log_SOURCES = init_main_log.c +init_main_ok_SOURCES = init_main_ok.c diff --git a/test/validation/api/init/init.c b/test/validation/api/init/init.c deleted file mode 100644 index 3dc40ea5f..000000000 --- a/test/validation/api/init/init.c +++ /dev/null @@ -1,190 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include -#include -#include -#include -#include "init.h" - -/* flag set when the replacement logging function is used */ -int replacement_logging_used; - -/* replacement abort function: */ -static void odp_init_abort(void) ODP_NORETURN; - -/* replacement log function: */ -ODP_PRINTF_FORMAT(2, 3) -static int odp_init_log(odp_log_level_t level, const char *fmt, ...); - -/* test ODP global init, with alternate abort function */ -void init_test_odp_init_global_replace_abort(void) -{ - int status; - odp_init_t init_data; - odp_instance_t instance; - - odp_init_param_init(&init_data); - init_data.abort_fn = &odp_init_abort; - - status = odp_init_global(&instance, &init_data, NULL); - CU_ASSERT_FATAL(status == 0); - - status = odp_term_global(instance); - CU_ASSERT(status == 0); -} - -odp_testinfo_t init_suite_abort[] = { - ODP_TEST_INFO(init_test_odp_init_global_replace_abort), - ODP_TEST_INFO_NULL, -}; - -odp_suiteinfo_t init_suites_abort[] = { - {"Init", NULL, NULL, init_suite_abort}, - ODP_SUITE_INFO_NULL, -}; - -static void odp_init_abort(void) -{ - abort(); -} - -int init_main_abort(int argc, char *argv[]) -{ - int ret; - - /* parse common options: */ - if (odp_cunit_parse_options(argc, argv)) - return -1; - - /* prevent default ODP init: */ - odp_cunit_register_global_init(NULL); - odp_cunit_register_global_term(NULL); - - /* run the tests: */ - ret = odp_cunit_register(init_suites_abort); - - if (ret == 0) - ret = odp_cunit_run(); - - return ret; -} - -/* test ODP global init, with alternate log function */ -void init_test_odp_init_global_replace_log(void) -{ - int status; - odp_init_t init_data; - odp_instance_t instance; - - odp_init_param_init(&init_data); - init_data.log_fn = &odp_init_log; - - replacement_logging_used = 0; - - status = odp_init_global(&instance, &init_data, NULL); - CU_ASSERT_FATAL(status == 0); - - CU_ASSERT_TRUE(replacement_logging_used || ODP_DEBUG_PRINT == 0); - - status = odp_term_global(instance); - CU_ASSERT(status == 0); -} - -odp_testinfo_t init_suite_log[] = { - ODP_TEST_INFO(init_test_odp_init_global_replace_log), - ODP_TEST_INFO_NULL, -}; - -odp_suiteinfo_t init_suites_log[] = { - {"Init", NULL, NULL, init_suite_log}, - ODP_SUITE_INFO_NULL, -}; - -static int odp_init_log(odp_log_level_t level __attribute__((unused)), - const char *fmt, ...) -{ - va_list args; - int r; - - /* just set a flag to be sure the replacement fn was used */ - replacement_logging_used = 1; - - va_start(args, fmt); - r = vfprintf(stderr, fmt, args); - va_end(args); - - return r; -} - -int init_main_log(int argc, char *argv[]) -{ - int ret; - - /* parse common options: */ - if (odp_cunit_parse_options(argc, argv)) - return -1; - - /* prevent default ODP init: */ - odp_cunit_register_global_init(NULL); - odp_cunit_register_global_term(NULL); - - /* register the tests: */ - ret = odp_cunit_register(init_suites_log); - - /* run the tests: */ - if (ret == 0) - ret = odp_cunit_run(); - - return ret; -} - -/* test normal ODP global init */ -void init_test_odp_init_global(void) -{ - int status; - odp_instance_t instance; - - status = odp_init_global(&instance, NULL, NULL); - CU_ASSERT_FATAL(status == 0); - - status = odp_term_global(instance); - CU_ASSERT(status == 0); -} - -odp_testinfo_t init_suite_ok[] = { - ODP_TEST_INFO(init_test_odp_init_global), - ODP_TEST_INFO_NULL, -}; - -odp_suiteinfo_t init_suites_ok[] = { - {"Init", NULL, NULL, init_suite_ok}, - ODP_SUITE_INFO_NULL, -}; - -int init_main_ok(int argc, char *argv[]) -{ - int ret; - - /* parse common options: */ - if (odp_cunit_parse_options(argc, argv)) - return -1; - - /* prevent default ODP init: */ - odp_cunit_register_global_init(NULL); - odp_cunit_register_global_term(NULL); - - /* register the tests: */ - ret = odp_cunit_register(init_suites_ok); - - /* run the tests: */ - if (ret == 0) - ret = odp_cunit_run(); - - return ret; -} diff --git a/test/validation/api/init/init.h b/test/validation/api/init/init.h deleted file mode 100644 index cad9cf988..000000000 --- a/test/validation/api/init/init.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_INIT_H_ -#define _ODP_TEST_INIT_H_ - -#include - -/* test functions: */ -void init_test_odp_init_global_replace_abort(void); -void init_test_odp_init_global_replace_log(void); -void init_test_odp_init_global(void); - -/* test arrays: */ -extern odp_testinfo_t init_suite_abort[]; -extern odp_testinfo_t init_suite_log[]; -extern odp_testinfo_t init_suite_ok[]; - -/* test registry: */ -extern odp_suiteinfo_t init_suites_abort[]; -extern odp_suiteinfo_t init_suites_log[]; -extern odp_suiteinfo_t init_suites_ok[]; - -/* main test program: */ -int init_main_abort(int argc, char *argv[]); -int init_main_log(int argc, char *argv[]); -int init_main_ok(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/init/init_main_abort.c b/test/validation/api/init/init_main_abort.c index 1b043154f..e00d3e089 100644 --- a/test/validation/api/init/init_main_abort.c +++ b/test/validation/api/init/init_main_abort.c @@ -6,9 +6,60 @@ #include "config.h" -#include "init.h" +#include +#include +#include + +/* replacement abort function: */ +static void ODP_NORETURN odp_init_abort(void) +{ + abort(); +} + +/* test ODP global init, with alternate abort function */ +static void init_test_odp_init_global_replace_abort(void) +{ + int status; + odp_init_t init_data; + odp_instance_t instance; + + odp_init_param_init(&init_data); + init_data.abort_fn = &odp_init_abort; + + status = odp_init_global(&instance, &init_data, NULL); + CU_ASSERT_FATAL(status == 0); + + status = odp_term_global(instance); + CU_ASSERT(status == 0); +} + +odp_testinfo_t init_suite_abort[] = { + ODP_TEST_INFO(init_test_odp_init_global_replace_abort), + ODP_TEST_INFO_NULL, +}; + +odp_suiteinfo_t init_suites_abort[] = { + {"Init", NULL, NULL, init_suite_abort}, + ODP_SUITE_INFO_NULL, +}; int main(int argc, char *argv[]) { - return init_main_abort(argc, argv); + int ret; + + /* parse common options: */ + if (odp_cunit_parse_options(argc, argv)) + return -1; + + /* prevent default ODP init: */ + odp_cunit_register_global_init(NULL); + odp_cunit_register_global_term(NULL); + + /* run the tests: */ + ret = odp_cunit_register(init_suites_abort); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } diff --git a/test/validation/api/init/init_main_log.c b/test/validation/api/init/init_main_log.c index d5d1ba6d3..2c6f1f114 100644 --- a/test/validation/api/init/init_main_log.c +++ b/test/validation/api/init/init_main_log.c @@ -6,9 +6,81 @@ #include "config.h" -#include "init.h" +#include +#include +#include + +/* flag set when the replacement logging function is used */ +int replacement_logging_used; + +/* replacement log function: */ +ODP_PRINTF_FORMAT(2, 3) +static int odp_init_log(odp_log_level_t level __attribute__((unused)), + const char *fmt, ...) +{ + va_list args; + int r; + + /* just set a flag to be sure the replacement fn was used */ + replacement_logging_used = 1; + + va_start(args, fmt); + r = vfprintf(stderr, fmt, args); + va_end(args); + + return r; +} + + +/* test ODP global init, with alternate log function */ +static void init_test_odp_init_global_replace_log(void) +{ + int status; + odp_init_t init_data; + odp_instance_t instance; + + odp_init_param_init(&init_data); + init_data.log_fn = &odp_init_log; + + replacement_logging_used = 0; + + status = odp_init_global(&instance, &init_data, NULL); + CU_ASSERT_FATAL(status == 0); + + CU_ASSERT_TRUE(replacement_logging_used || ODP_DEBUG_PRINT == 0); + + status = odp_term_global(instance); + CU_ASSERT(status == 0); +} + +odp_testinfo_t init_suite_log[] = { + ODP_TEST_INFO(init_test_odp_init_global_replace_log), + ODP_TEST_INFO_NULL, +}; + +odp_suiteinfo_t init_suites_log[] = { + {"Init", NULL, NULL, init_suite_log}, + ODP_SUITE_INFO_NULL, +}; int main(int argc, char *argv[]) { - return init_main_log(argc, argv); + int ret; + + /* parse common options: */ + if (odp_cunit_parse_options(argc, argv)) + return -1; + + /* prevent default ODP init: */ + odp_cunit_register_global_init(NULL); + odp_cunit_register_global_term(NULL); + + /* register the tests: */ + ret = odp_cunit_register(init_suites_log); + + /* run the tests: */ + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } diff --git a/test/validation/api/init/init_main_ok.c b/test/validation/api/init/init_main_ok.c index bb205f6df..52df15694 100644 --- a/test/validation/api/init/init_main_ok.c +++ b/test/validation/api/init/init_main_ok.c @@ -6,9 +6,50 @@ #include "config.h" -#include "init.h" +#include +#include + +/* test normal ODP global init */ +static void init_test_odp_init_global(void) +{ + int status; + odp_instance_t instance; + + status = odp_init_global(&instance, NULL, NULL); + CU_ASSERT_FATAL(status == 0); + + status = odp_term_global(instance); + CU_ASSERT(status == 0); +} + +odp_testinfo_t init_suite_ok[] = { + ODP_TEST_INFO(init_test_odp_init_global), + ODP_TEST_INFO_NULL, +}; + +odp_suiteinfo_t init_suites_ok[] = { + {"Init", NULL, NULL, init_suite_ok}, + ODP_SUITE_INFO_NULL, +}; int main(int argc, char *argv[]) { - return init_main_ok(argc, argv); + int ret; + + /* parse common options: */ + if (odp_cunit_parse_options(argc, argv)) + return -1; + + /* prevent default ODP init: */ + odp_cunit_register_global_init(NULL); + odp_cunit_register_global_term(NULL); + + /* register the tests: */ + ret = odp_cunit_register(init_suites_ok); + + /* run the tests: */ + if (ret == 0) + ret = odp_cunit_run(); + + return ret; } From patchwork Thu Feb 22 09:00:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 129169 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp377671lja; Thu, 22 Feb 2018 01:09:26 -0800 (PST) X-Google-Smtp-Source: AH8x226woOYFEw62R/bm0eA4H3T2z09Ul+CeKkKVqA0NU/2z1i/pigHzdZL2CgHNbwSOD6YxbUIC X-Received: by 10.233.237.2 with SMTP id c2mr9266537qkg.54.1519290565772; Thu, 22 Feb 2018 01:09:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519290565; cv=none; d=google.com; s=arc-20160816; b=LdO7WWDthbUdlxqHk5KAwkhdaXrOyrRgLJYUPa9MWdNfE+8gyH/c5qaensqZG2P7n7 wukYNRO5uXk9zTebNhGrUcjStPJBKq/JUj04Bi8gYlwQde6o8np6sKrYp1tY3undYkmb xIjivbAA6bgafwe417/pBYy9VlO7oPi/96ouTY0UfvbrA3Ff8AnqSUeux9kDfa9YpHaV CHZv/GbGWGiladpgE6IhjB7aw3MckJ0yPDO+NmyG4YuzWOddmxZA+dWgodmpsILsSwIh jvZVt4XXOwMMUmjg3zJRM7u8450Sd+pWVb06ZR45VHFQxWjt8jg5fNL789RV6NSDlgkN 5jWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=ZXF5WC+8vninnD+UPJmFiZWqpAA2PuJZ0VU0SWyJtQk=; b=lYXVE1d9KAKxfwZ9uKr0tDiCWR9QyMaAPC8Jm6QaAUp745GsAJ04mzKgGPlpms6Mb3 FFg/19ch2zmGfL8oPkPmxLzyEhLxNz9F+HPN5SwSVM1/fz6euq1C+MuI/IikK4MiN0cE A0q0C65qqN8slOvEm57WEveoojf1l6HmPdlaVboGHPXVv3QZkrNwMRaEwRd6xFyA9tLB 2sewJfdZcyRm/1ypJCNCr7dPq1WiB/xNqRqK1x9nCoILAWLpm0CkcPbjzc+XTHm+Wa3U MrbHPMt0hrRqX1rM17pxQHKCueKScd+ax1TLjsaARuHAFavaMBwG1HVytlUWI6G6oQpV c9jg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id 27si1346961qkr.129.2018.02.22.01.09.25; Thu, 22 Feb 2018 01:09:25 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 57DBE60130; Thu, 22 Feb 2018 09:09:25 +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,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW 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 C740B60C56; Thu, 22 Feb 2018 09:08:17 +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 EA46661754; Thu, 22 Feb 2018 09:07:41 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id 592896170B for ; Thu, 22 Feb 2018 09:04:02 +0000 (UTC) Received: from mxback15j.mail.yandex.net (mxback15j.mail.yandex.net [IPv6:2a02:6b8:0:1619::91]) by forward104p.mail.yandex.net (Yandex) with ESMTP id 2F1D4186DE0 for ; Thu, 22 Feb 2018 12:00:18 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback15j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id KOL83isqEQ-0I34gdjH; Thu, 22 Feb 2018 12:00:18 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Qk3Eeopztj-0GHOkr8L; Thu, 22 Feb 2018 12:00:16 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 22 Feb 2018 12:00:08 +0300 Message-Id: <1519290010-13383-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519290010-13383-1-git-send-email-odpbot@yandex.ru> References: <1519290010-13383-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 496 Subject: [lng-odp] [PATCH v1 5/7] validation: move most of tests to common directory 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" From: Dmitry Eremin-Solenikov There is little benefit from keeping each test in it's own subdirectory. It just slows down build process. Move most of the tests to just api/ diretory to be built in parallel. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 496 (lumag:tests-fix-2) ** https://github.com/Linaro/odp/pull/496 ** Patch: https://github.com/Linaro/odp/pull/496.patch ** Base sha: 5a58bbf2bb331fd7dde2ebbc0430634ace6900fb ** Merge commit sha: 2ca48deb89c7ac000bd44a1da037c36de66720cb **/ test/m4/configure.m4 | 24 - test/validation/api/.gitignore | 29 + test/validation/api/Makefile.am | 173 +- test/validation/api/{atomic => }/atomic.c | 0 test/validation/api/atomic/.gitignore | 1 - test/validation/api/atomic/Makefile.am | 4 - test/validation/api/{barrier => }/barrier.c | 0 test/validation/api/barrier/.gitignore | 1 - test/validation/api/barrier/Makefile.am | 4 - test/validation/api/{buffer => }/buffer.c | 0 test/validation/api/buffer/.gitignore | 1 - test/validation/api/buffer/Makefile.am | 4 - test/validation/api/{chksum => }/chksum.c | 0 test/validation/api/chksum/.gitignore | 1 - test/validation/api/chksum/Makefile.am | 4 - .../api/{classification => }/classification.c | 2 +- .../api/{classification => }/classification.h | 0 test/validation/api/classification/.gitignore | 1 - test/validation/api/classification/Makefile.am | 11 - .../api/classification/odp_classification_basic.c | 336 ---- .../api/classification/odp_classification_common.c | 428 ----- .../classification/odp_classification_test_pmr.c | 1963 -------------------- .../api/classification/odp_classification_tests.c | 724 -------- .../classification/odp_classification_testsuites.h | 63 - test/validation/api/{cpumask => }/cpumask.c | 0 test/validation/api/cpumask/.gitignore | 1 - test/validation/api/cpumask/Makefile.am | 5 - .../api/{crypto/odp_crypto_test_inp.c => crypto.c} | 2 +- test/validation/api/crypto/.gitignore | 1 - test/validation/api/crypto/Makefile.am | 7 - test/validation/api/crypto/test_vectors_len.h | 77 - .../test_vectors.h => crypto_test_vectors.h} | 68 +- test/validation/api/{errno => }/errno.c | 0 test/validation/api/errno/.gitignore | 1 - test/validation/api/errno/Makefile.am | 4 - test/validation/api/{event => }/event.c | 0 test/validation/api/event/.gitignore | 1 - test/validation/api/event/Makefile.am | 4 - test/validation/api/{hash => }/hash.c | 0 test/validation/api/hash/.gitignore | 1 - test/validation/api/hash/Makefile.am | 4 - test/validation/api/init/.gitignore | 3 - test/validation/api/init/Makefile.am | 9 - test/validation/api/{init => }/init_main_abort.c | 0 test/validation/api/{init => }/init_main_log.c | 0 test/validation/api/{init => }/init_main_ok.c | 0 test/validation/api/{ipsec => }/ipsec.c | 2 +- test/validation/api/{ipsec => }/ipsec.h | 0 test/validation/api/{ipsec => }/ipsec_async.c | 0 test/validation/api/{ipsec => }/ipsec_inline_in.c | 0 test/validation/api/{ipsec => }/ipsec_inline_out.c | 0 test/validation/api/{ipsec => }/ipsec_sync.c | 0 test/validation/api/{ipsec => }/ipsec_test_in.c | 2 +- test/validation/api/{ipsec => }/ipsec_test_out.c | 2 +- .../{ipsec/test_vectors.h => ipsec_test_vectors.h} | 0 test/validation/api/{lock => }/lock.c | 0 test/validation/api/lock/.gitignore | 1 - test/validation/api/lock/Makefile.am | 4 - test/validation/api/{packet => }/packet.c | 0 test/validation/api/packet/.gitignore | 1 - test/validation/api/packet/Makefile.am | 4 - test/validation/api/{pool => }/pool.c | 0 test/validation/api/pool/.gitignore | 1 - test/validation/api/pool/Makefile.am | 4 - test/validation/api/{queue => }/queue.c | 0 test/validation/api/queue/.gitignore | 1 - test/validation/api/queue/Makefile.am | 4 - test/validation/api/{random => }/random.c | 0 test/validation/api/random/.gitignore | 1 - test/validation/api/random/Makefile.am | 4 - test/validation/api/{scheduler => }/scheduler.c | 0 test/validation/api/scheduler/.gitignore | 1 - test/validation/api/scheduler/Makefile.am | 4 - test/validation/api/{shmem => }/shmem.c | 0 test/validation/api/shmem/.gitignore | 1 - test/validation/api/shmem/Makefile.am | 4 - test/validation/api/{std_clib => }/std_clib.c | 0 test/validation/api/std_clib/.gitignore | 1 - test/validation/api/std_clib/Makefile.am | 4 - test/validation/api/{system => }/system.c | 0 test/validation/api/system/.gitignore | 1 - test/validation/api/system/Makefile.am | 4 - test/validation/api/{thread => }/thread.c | 1 + test/validation/api/thread/.gitignore | 1 - test/validation/api/thread/Makefile.am | 6 - test/validation/api/{time => }/time.c | 0 test/validation/api/time/.gitignore | 1 - test/validation/api/time/Makefile.am | 4 - test/validation/api/{timer => }/timer.c | 0 test/validation/api/timer/.gitignore | 1 - test/validation/api/timer/Makefile.am | 4 - 91 files changed, 219 insertions(+), 3812 deletions(-) rename test/validation/api/{atomic => }/atomic.c (100%) delete mode 100644 test/validation/api/atomic/.gitignore delete mode 100644 test/validation/api/atomic/Makefile.am rename test/validation/api/{barrier => }/barrier.c (100%) delete mode 100644 test/validation/api/barrier/.gitignore delete mode 100644 test/validation/api/barrier/Makefile.am rename test/validation/api/{buffer => }/buffer.c (100%) delete mode 100644 test/validation/api/buffer/.gitignore delete mode 100644 test/validation/api/buffer/Makefile.am rename test/validation/api/{chksum => }/chksum.c (100%) delete mode 100644 test/validation/api/chksum/.gitignore delete mode 100644 test/validation/api/chksum/Makefile.am rename test/validation/api/{classification => }/classification.c (95%) rename test/validation/api/{classification => }/classification.h (100%) delete mode 100644 test/validation/api/classification/.gitignore delete mode 100644 test/validation/api/classification/Makefile.am delete mode 100644 test/validation/api/classification/odp_classification_basic.c delete mode 100644 test/validation/api/classification/odp_classification_common.c delete mode 100644 test/validation/api/classification/odp_classification_test_pmr.c delete mode 100644 test/validation/api/classification/odp_classification_tests.c delete mode 100644 test/validation/api/classification/odp_classification_testsuites.h rename test/validation/api/{cpumask => }/cpumask.c (100%) delete mode 100644 test/validation/api/cpumask/.gitignore delete mode 100644 test/validation/api/cpumask/Makefile.am rename test/validation/api/{crypto/odp_crypto_test_inp.c => crypto.c} (99%) delete mode 100644 test/validation/api/crypto/.gitignore delete mode 100644 test/validation/api/crypto/Makefile.am delete mode 100644 test/validation/api/crypto/test_vectors_len.h rename test/validation/api/{crypto/test_vectors.h => crypto_test_vectors.h} (96%) rename test/validation/api/{errno => }/errno.c (100%) delete mode 100644 test/validation/api/errno/.gitignore delete mode 100644 test/validation/api/errno/Makefile.am rename test/validation/api/{event => }/event.c (100%) delete mode 100644 test/validation/api/event/.gitignore delete mode 100644 test/validation/api/event/Makefile.am rename test/validation/api/{hash => }/hash.c (100%) delete mode 100644 test/validation/api/hash/.gitignore delete mode 100644 test/validation/api/hash/Makefile.am delete mode 100644 test/validation/api/init/.gitignore delete mode 100644 test/validation/api/init/Makefile.am rename test/validation/api/{init => }/init_main_abort.c (100%) rename test/validation/api/{init => }/init_main_log.c (100%) rename test/validation/api/{init => }/init_main_ok.c (100%) rename test/validation/api/{ipsec => }/ipsec.c (99%) rename test/validation/api/{ipsec => }/ipsec.h (100%) rename test/validation/api/{ipsec => }/ipsec_async.c (100%) rename test/validation/api/{ipsec => }/ipsec_inline_in.c (100%) rename test/validation/api/{ipsec => }/ipsec_inline_out.c (100%) rename test/validation/api/{ipsec => }/ipsec_sync.c (100%) rename test/validation/api/{ipsec => }/ipsec_test_in.c (99%) rename test/validation/api/{ipsec => }/ipsec_test_out.c (99%) rename test/validation/api/{ipsec/test_vectors.h => ipsec_test_vectors.h} (100%) rename test/validation/api/{lock => }/lock.c (100%) delete mode 100644 test/validation/api/lock/.gitignore delete mode 100644 test/validation/api/lock/Makefile.am rename test/validation/api/{packet => }/packet.c (100%) delete mode 100644 test/validation/api/packet/.gitignore delete mode 100644 test/validation/api/packet/Makefile.am rename test/validation/api/{pool => }/pool.c (100%) delete mode 100644 test/validation/api/pool/.gitignore delete mode 100644 test/validation/api/pool/Makefile.am rename test/validation/api/{queue => }/queue.c (100%) delete mode 100644 test/validation/api/queue/.gitignore delete mode 100644 test/validation/api/queue/Makefile.am rename test/validation/api/{random => }/random.c (100%) delete mode 100644 test/validation/api/random/.gitignore delete mode 100644 test/validation/api/random/Makefile.am rename test/validation/api/{scheduler => }/scheduler.c (100%) delete mode 100644 test/validation/api/scheduler/.gitignore delete mode 100644 test/validation/api/scheduler/Makefile.am rename test/validation/api/{shmem => }/shmem.c (100%) delete mode 100644 test/validation/api/shmem/.gitignore delete mode 100644 test/validation/api/shmem/Makefile.am rename test/validation/api/{std_clib => }/std_clib.c (100%) delete mode 100644 test/validation/api/std_clib/.gitignore delete mode 100644 test/validation/api/std_clib/Makefile.am rename test/validation/api/{system => }/system.c (100%) delete mode 100644 test/validation/api/system/.gitignore delete mode 100644 test/validation/api/system/Makefile.am rename test/validation/api/{thread => }/thread.c (99%) delete mode 100644 test/validation/api/thread/.gitignore delete mode 100644 test/validation/api/thread/Makefile.am rename test/validation/api/{time => }/time.c (100%) delete mode 100644 test/validation/api/time/.gitignore delete mode 100644 test/validation/api/time/Makefile.am rename test/validation/api/{timer => }/timer.c (100%) delete mode 100644 test/validation/api/timer/.gitignore delete mode 100644 test/validation/api/timer/Makefile.am diff --git a/test/m4/configure.m4 b/test/m4/configure.m4 index dd07839ff..5a0b4d685 100644 --- a/test/m4/configure.m4 +++ b/test/m4/configure.m4 @@ -7,30 +7,6 @@ AC_CONFIG_FILES([test/Makefile test/miscellaneous/Makefile test/performance/Makefile test/validation/Makefile - test/validation/api/atomic/Makefile - test/validation/api/barrier/Makefile - test/validation/api/buffer/Makefile - test/validation/api/chksum/Makefile - test/validation/api/classification/Makefile - test/validation/api/cpumask/Makefile - test/validation/api/crypto/Makefile - test/validation/api/errno/Makefile - test/validation/api/event/Makefile - test/validation/api/hash/Makefile - test/validation/api/init/Makefile - test/validation/api/ipsec/Makefile - test/validation/api/lock/Makefile test/validation/api/Makefile - test/validation/api/packet/Makefile test/validation/api/pktio/Makefile - test/validation/api/pool/Makefile - test/validation/api/queue/Makefile - test/validation/api/random/Makefile - test/validation/api/scheduler/Makefile - test/validation/api/shmem/Makefile - test/validation/api/std_clib/Makefile - test/validation/api/system/Makefile - test/validation/api/thread/Makefile - test/validation/api/time/Makefile - test/validation/api/timer/Makefile test/validation/api/traffic_mngr/Makefile]) diff --git a/test/validation/api/.gitignore b/test/validation/api/.gitignore index 5dabf91c1..6fb6ee62e 100644 --- a/test/validation/api/.gitignore +++ b/test/validation/api/.gitignore @@ -1,3 +1,32 @@ *.log *.trs tests-validation.env +atomic_main +barrier_main +buffer_main +chksum_main +classification_main +cpumask_main +crypto_main +errno_main +event_main +hash_main +init_main_abort +init_main_log +init_main_ok +ipsec_async +ipsec_inline_in +ipsec_inline_out +ipsec_sync +lock_main +packet_main +pool_main +queue_main +random_main +scheduler_main +shmem_main +std_clib_main +system_main +thread_main +time_main +timer_main diff --git a/test/validation/api/Makefile.am b/test/validation/api/Makefile.am index c92d123c1..bc3a429d2 100644 --- a/test/validation/api/Makefile.am +++ b/test/validation/api/Makefile.am @@ -1,66 +1,127 @@ -ODP_MODULES = atomic \ - barrier \ - buffer \ - chksum \ - classification \ - cpumask \ - crypto \ - errno \ - event \ - hash \ - init \ - ipsec \ - lock \ - queue \ - packet \ +ODP_MODULES = \ pktio \ - pool \ - random \ - scheduler \ - std_clib \ - thread \ - time \ - timer \ - traffic_mngr \ - shmem \ - system + traffic_mngr SUBDIRS = $(ODP_MODULES) -include $(top_srcdir)/test/Makefile.inc +include Makefile.inc + +test_PROGRAMS = \ + atomic_main \ + barrier_main \ + buffer_main \ + chksum_main \ + classification_main \ + cpumask_main \ + crypto_main \ + errno_main \ + event_main \ + hash_main \ + init_main_abort \ + init_main_log \ + init_main_ok \ + ipsec_async \ + ipsec_inline_in \ + ipsec_inline_out \ + ipsec_sync \ + lock_main \ + packet_main \ + pool_main \ + queue_main \ + random_main \ + scheduler_main \ + shmem_main \ + std_clib_main \ + system_main \ + thread_main \ + time_main \ + timer_main + +noinst_LTLIBRARIES = libtestipsec.la +libtestipsec_la_SOURCES = \ + ipsec_test_vectors.h \ + ipsec_test_in.c \ + ipsec_test_out.c \ + ipsec.h \ + ipsec.c + +atomic_main_SOURCES = atomic.c +barrier_main_SOURCES = barrier.c +buffer_main_SOURCES = buffer.c +chksum_main_SOURCES = chksum.c +cpumask_main_SOURCES = cpumask.c +cpumask_main_LDADD = $(LDADD) $(LIBCPUMASK_COMMON) +crypto_main_SOURCES = crypto.c crypto_test_vectors.h +errno_main_SOURCES = errno.c +event_main_SOURCES = event.c +hash_main_SOURCES = hash.c +init_main_abort_SOURCES = init_main_abort.c +init_main_log_SOURCES = init_main_log.c +init_main_ok_SOURCES = init_main_ok.c +ipsec_sync_SOURCES = ipsec_sync.c +ipsec_sync_LDADD = $(LDADD) libtestipsec.la +ipsec_async_SOURCES = ipsec_async.c +ipsec_async_LDADD = $(LDADD) libtestipsec.la +ipsec_inline_in_SOURCES = ipsec_inline_in.c +ipsec_inline_in_LDADD = $(LDADD) libtestipsec.la +ipsec_inline_out_SOURCES = ipsec_inline_out.c +ipsec_inline_out_LDADD = $(LDADD) libtestipsec.la +lock_main_SOURCES = lock.c +packet_main_SOURCES = packet.c +pool_main_SOURCES = pool.c +queue_main_SOURCES = queue.c +random_main_SOURCES = random.c +scheduler_main_SOURCES = scheduler.c +shmem_main_SOURCES = shmem.c +std_clib_main_SOURCES = std_clib.c +system_main_SOURCES = system.c +thread_main_SOURCES = thread.c +thread_main_LDADD = $(LDADD) $(LIBTHRMASK_COMMON) +time_main_SOURCES = time.c +timer_main_SOURCES = timer.c + +classification_main_SOURCES = \ + classification_basic.c \ + classification_tests.c \ + classification_testsuites.h \ + classification_test_pmr.c \ + classification_common.c \ + classification.c \ + classification.h + TESTS_ENVIRONMENT += TEST_DIR=${top_builddir}/test/validation TESTS = \ - atomic/atomic_main$(EXEEXT) \ - barrier/barrier_main$(EXEEXT) \ - buffer/buffer_main$(EXEEXT) \ - chksum/chksum_main$(EXEEXT) \ - classification/classification_main$(EXEEXT) \ - cpumask/cpumask_main$(EXEEXT) \ - crypto/crypto_main$(EXEEXT) \ - errno/errno_main$(EXEEXT) \ - event/event_main$(EXEEXT) \ - hash/hash_main$(EXEEXT) \ - init/init_main_ok$(EXEEXT) \ - init/init_main_abort$(EXEEXT) \ - init/init_main_log$(EXEEXT) \ - ipsec/ipsec_sync$(EXEEXT) \ - ipsec/ipsec_async$(EXEEXT) \ - ipsec/ipsec_inline_in$(EXEEXT) \ - ipsec/ipsec_inline_out$(EXEEXT) \ - lock/lock_main$(EXEEXT) \ - packet/packet_main$(EXEEXT) \ - pool/pool_main$(EXEEXT) \ - queue/queue_main$(EXEEXT) \ - random/random_main$(EXEEXT) \ - scheduler/scheduler_main$(EXEEXT) \ - std_clib/std_clib_main$(EXEEXT) \ - thread/thread_main$(EXEEXT) \ - time/time_main$(EXEEXT) \ - timer/timer_main$(EXEEXT) \ - traffic_mngr/traffic_mngr.sh \ - shmem/shmem_main$(EXEEXT) \ - system/system_main$(EXEEXT) + atomic_main$(EXEEXT) \ + barrier_main$(EXEEXT) \ + buffer_main$(EXEEXT) \ + chksum_main$(EXEEXT) \ + classification_main$(EXEEXT) \ + cpumask_main$(EXEEXT) \ + crypto_main$(EXEEXT) \ + errno_main$(EXEEXT) \ + event_main$(EXEEXT) \ + hash_main$(EXEEXT) \ + init_main_ok$(EXEEXT) \ + init_main_abort$(EXEEXT) \ + init_main_log$(EXEEXT) \ + ipsec_sync$(EXEEXT) \ + ipsec_async$(EXEEXT) \ + ipsec_inline_in$(EXEEXT) \ + ipsec_inline_out$(EXEEXT) \ + lock_main$(EXEEXT) \ + packet_main$(EXEEXT) \ + pool_main$(EXEEXT) \ + queue_main$(EXEEXT) \ + random_main$(EXEEXT) \ + scheduler_main$(EXEEXT) \ + shmem_main$(EXEEXT) \ + std_clib_main$(EXEEXT) \ + system_main$(EXEEXT) \ + thread_main$(EXEEXT) \ + time_main$(EXEEXT) \ + timer_main$(EXEEXT) \ + traffic_mngr/traffic_mngr.sh TESTNAME = validation diff --git a/test/validation/api/atomic/atomic.c b/test/validation/api/atomic.c similarity index 100% rename from test/validation/api/atomic/atomic.c rename to test/validation/api/atomic.c diff --git a/test/validation/api/atomic/.gitignore b/test/validation/api/atomic/.gitignore deleted file mode 100644 index 610ffeab0..000000000 --- a/test/validation/api/atomic/.gitignore +++ /dev/null @@ -1 +0,0 @@ -atomic_main diff --git a/test/validation/api/atomic/Makefile.am b/test/validation/api/atomic/Makefile.am deleted file mode 100644 index 41ad2e6b6..000000000 --- a/test/validation/api/atomic/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = atomic_main -atomic_main_SOURCES = atomic.c diff --git a/test/validation/api/barrier/barrier.c b/test/validation/api/barrier.c similarity index 100% rename from test/validation/api/barrier/barrier.c rename to test/validation/api/barrier.c diff --git a/test/validation/api/barrier/.gitignore b/test/validation/api/barrier/.gitignore deleted file mode 100644 index 2e0ee7ade..000000000 --- a/test/validation/api/barrier/.gitignore +++ /dev/null @@ -1 +0,0 @@ -barrier_main diff --git a/test/validation/api/barrier/Makefile.am b/test/validation/api/barrier/Makefile.am deleted file mode 100644 index f5f751b88..000000000 --- a/test/validation/api/barrier/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = barrier_main -barrier_main_SOURCES = barrier.c diff --git a/test/validation/api/buffer/buffer.c b/test/validation/api/buffer.c similarity index 100% rename from test/validation/api/buffer/buffer.c rename to test/validation/api/buffer.c diff --git a/test/validation/api/buffer/.gitignore b/test/validation/api/buffer/.gitignore deleted file mode 100644 index 0e8ac15c1..000000000 --- a/test/validation/api/buffer/.gitignore +++ /dev/null @@ -1 +0,0 @@ -buffer_main diff --git a/test/validation/api/buffer/Makefile.am b/test/validation/api/buffer/Makefile.am deleted file mode 100644 index f459010c3..000000000 --- a/test/validation/api/buffer/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = buffer_main -buffer_main_SOURCES = buffer.c diff --git a/test/validation/api/chksum/chksum.c b/test/validation/api/chksum.c similarity index 100% rename from test/validation/api/chksum/chksum.c rename to test/validation/api/chksum.c diff --git a/test/validation/api/chksum/.gitignore b/test/validation/api/chksum/.gitignore deleted file mode 100644 index c69e8c470..000000000 --- a/test/validation/api/chksum/.gitignore +++ /dev/null @@ -1 +0,0 @@ -chksum_main diff --git a/test/validation/api/chksum/Makefile.am b/test/validation/api/chksum/Makefile.am deleted file mode 100644 index 349fdd641..000000000 --- a/test/validation/api/chksum/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = chksum_main -chksum_main_SOURCES = chksum.c diff --git a/test/validation/api/classification/classification.c b/test/validation/api/classification.c similarity index 95% rename from test/validation/api/classification/classification.c rename to test/validation/api/classification.c index e89ffbee4..ddff5dd74 100644 --- a/test/validation/api/classification/classification.c +++ b/test/validation/api/classification.c @@ -8,7 +8,7 @@ #include #include -#include "odp_classification_testsuites.h" +#include "classification_testsuites.h" #include "classification.h" odp_suiteinfo_t classification_suites[] = { diff --git a/test/validation/api/classification/classification.h b/test/validation/api/classification.h similarity index 100% rename from test/validation/api/classification/classification.h rename to test/validation/api/classification.h diff --git a/test/validation/api/classification/.gitignore b/test/validation/api/classification/.gitignore deleted file mode 100644 index e2cdfefe1..000000000 --- a/test/validation/api/classification/.gitignore +++ /dev/null @@ -1 +0,0 @@ -classification_main diff --git a/test/validation/api/classification/Makefile.am b/test/validation/api/classification/Makefile.am deleted file mode 100644 index e17f9f654..000000000 --- a/test/validation/api/classification/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = classification_main -classification_main_SOURCES = \ - odp_classification_basic.c \ - odp_classification_tests.c \ - odp_classification_testsuites.h \ - odp_classification_test_pmr.c \ - odp_classification_common.c \ - classification.c \ - classification.h diff --git a/test/validation/api/classification/odp_classification_basic.c b/test/validation/api/classification/odp_classification_basic.c deleted file mode 100644 index 8b3738b75..000000000 --- a/test/validation/api/classification/odp_classification_basic.c +++ /dev/null @@ -1,336 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include -#include "odp_classification_testsuites.h" -#include "classification.h" - -#define PMR_SET_NUM 5 - -static void classification_test_create_cos(void) -{ - odp_cos_t cos; - odp_cls_cos_param_t cls_param; - odp_pool_t pool; - odp_queue_t queue; - - pool = pool_create("cls_basic_pool"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - queue = queue_create("cls_basic_queue", true); - CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); - - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create(NULL, &cls_param); - CU_ASSERT(odp_cos_to_u64(cos) != odp_cos_to_u64(ODP_COS_INVALID)); - odp_cos_destroy(cos); - odp_pool_destroy(pool); - odp_queue_destroy(queue); -} - -static void classification_test_destroy_cos(void) -{ - odp_cos_t cos; - char name[ODP_COS_NAME_LEN]; - odp_pool_t pool; - odp_queue_t queue; - odp_cls_cos_param_t cls_param; - int retval; - - pool = pool_create("cls_basic_pool"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - queue = queue_create("cls_basic_queue", true); - CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); - - sprintf(name, "ClassOfService"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create(name, &cls_param); - CU_ASSERT_FATAL(cos != ODP_COS_INVALID); - retval = odp_cos_destroy(cos); - CU_ASSERT(retval == 0); - retval = odp_cos_destroy(ODP_COS_INVALID); - CU_ASSERT(retval < 0); - - odp_pool_destroy(pool); - odp_queue_destroy(queue); -} - -static void classification_test_create_pmr_match(void) -{ - odp_pmr_t pmr; - uint16_t val; - uint16_t mask; - int retval; - odp_pmr_param_t pmr_param; - odp_cos_t default_cos; - odp_cos_t cos; - odp_queue_t default_queue; - odp_queue_t queue; - odp_pool_t default_pool; - odp_pool_t pool; - odp_pool_t pkt_pool; - odp_cls_cos_param_t cls_param; - odp_pktio_t pktio; - - pkt_pool = pool_create("pkt_pool"); - CU_ASSERT_FATAL(pkt_pool != ODP_POOL_INVALID); - - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); - CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - - configure_default_cos(pktio, &default_cos, - &default_queue, &default_pool); - - queue = queue_create("pmr_match", true); - CU_ASSERT(queue != ODP_QUEUE_INVALID); - - pool = pool_create("pmr_match"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create("pmr_match", &cls_param); - CU_ASSERT(cos != ODP_COS_INVALID); - - val = 1024; - mask = 0xffff; - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = find_first_supported_l3_pmr(); - pmr_param.range_term = false; - pmr_param.match.value = &val; - pmr_param.match.mask = &mask; - pmr_param.val_sz = sizeof(val); - - pmr = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos); - CU_ASSERT(pmr != ODP_PMR_INVAL); - CU_ASSERT(odp_pmr_to_u64(pmr) != odp_pmr_to_u64(ODP_PMR_INVAL)); - /* destroy the created PMR */ - retval = odp_cls_pmr_destroy(pmr); - CU_ASSERT(retval == 0); - - /* destroy an INVALID PMR */ - retval = odp_cls_pmr_destroy(ODP_PMR_INVAL); - CU_ASSERT(retval < 0); - - odp_queue_destroy(queue); - odp_pool_destroy(pool); - odp_pool_destroy(pkt_pool); - odp_cos_destroy(cos); - odp_queue_destroy(default_queue); - odp_pool_destroy(default_pool); - odp_cos_destroy(default_cos); - odp_pktio_close(pktio); -} - -static void classification_test_cos_set_queue(void) -{ - int retval; - char cosname[ODP_COS_NAME_LEN]; - odp_cls_cos_param_t cls_param; - odp_pool_t pool; - odp_queue_t queue; - odp_queue_t queue_cos; - odp_cos_t cos_queue; - odp_queue_t recvqueue; - odp_queue_t queue_out = ODP_QUEUE_INVALID; - - pool = pool_create("cls_basic_pool"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - queue = queue_create("cls_basic_queue", true); - CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); - - sprintf(cosname, "CoSQueue"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - cos_queue = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos_queue != ODP_COS_INVALID); - - queue_cos = queue_create("QueueCoS", true); - CU_ASSERT_FATAL(queue_cos != ODP_QUEUE_INVALID); - - retval = odp_cos_queue_set(cos_queue, queue_cos); - CU_ASSERT(retval == 0); - recvqueue = odp_cos_queue(cos_queue); - CU_ASSERT(recvqueue == queue_cos); - CU_ASSERT(odp_cls_cos_num_queue(cos_queue) == 1); - CU_ASSERT(odp_cls_cos_queues(cos_queue, &queue_out, 1) == 1); - CU_ASSERT(queue_out == queue_cos); - - odp_cos_destroy(cos_queue); - odp_queue_destroy(queue_cos); - odp_queue_destroy(queue); - odp_pool_destroy(pool); -} - -static void classification_test_cos_set_pool(void) -{ - int retval; - char cosname[ODP_COS_NAME_LEN]; - odp_cls_cos_param_t cls_param; - odp_pool_t pool; - odp_queue_t queue; - odp_pool_t cos_pool; - odp_cos_t cos; - odp_pool_t recvpool; - - pool = pool_create("cls_basic_pool"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - queue = queue_create("cls_basic_queue", true); - CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); - - sprintf(cosname, "CoSQueue"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - cos = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos != ODP_COS_INVALID); - - cos_pool = pool_create("PoolCoS"); - CU_ASSERT_FATAL(cos_pool != ODP_POOL_INVALID); - - retval = odp_cls_cos_pool_set(cos, cos_pool); - CU_ASSERT(retval == 0); - recvpool = odp_cls_cos_pool(cos); - CU_ASSERT(recvpool == cos_pool); - - odp_cos_destroy(cos); - odp_queue_destroy(queue); - odp_pool_destroy(pool); - odp_pool_destroy(cos_pool); -} - -static void classification_test_cos_set_drop(void) -{ - int retval; - char cosname[ODP_COS_NAME_LEN]; - odp_cos_t cos_drop; - odp_queue_t queue; - odp_pool_t pool; - odp_cls_cos_param_t cls_param; - - pool = pool_create("cls_basic_pool"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - queue = queue_create("cls_basic_queue", true); - CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); - - sprintf(cosname, "CoSDrop"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - cos_drop = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos_drop != ODP_COS_INVALID); - - retval = odp_cos_drop_set(cos_drop, ODP_COS_DROP_POOL); - CU_ASSERT(retval == 0); - CU_ASSERT(ODP_COS_DROP_POOL == odp_cos_drop(cos_drop)); - - retval = odp_cos_drop_set(cos_drop, ODP_COS_DROP_NEVER); - CU_ASSERT(retval == 0); - CU_ASSERT(ODP_COS_DROP_NEVER == odp_cos_drop(cos_drop)); - odp_cos_destroy(cos_drop); - odp_pool_destroy(pool); - odp_queue_destroy(queue); -} - -static void classification_test_pmr_composite_create(void) -{ - odp_pmr_t pmr_composite; - int retval; - odp_pmr_param_t pmr_terms[PMR_SET_NUM]; - odp_cos_t default_cos; - odp_cos_t cos; - odp_queue_t default_queue; - odp_queue_t queue; - odp_pool_t default_pool; - odp_pool_t pool; - odp_pool_t pkt_pool; - odp_cls_cos_param_t cls_param; - odp_pktio_t pktio; - uint16_t val = 1024; - uint16_t mask = 0xffff; - int i; - - pkt_pool = pool_create("pkt_pool"); - CU_ASSERT_FATAL(pkt_pool != ODP_POOL_INVALID); - - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); - CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - - configure_default_cos(pktio, &default_cos, - &default_queue, &default_pool); - - queue = queue_create("pmr_match", true); - CU_ASSERT(queue != ODP_QUEUE_INVALID); - - pool = pool_create("pmr_match"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create("pmr_match", &cls_param); - CU_ASSERT(cos != ODP_COS_INVALID); - - for (i = 0; i < PMR_SET_NUM; i++) { - odp_cls_pmr_param_init(&pmr_terms[i]); - pmr_terms[i].term = ODP_PMR_TCP_DPORT; - pmr_terms[i].match.value = &val; - pmr_terms[i].range_term = false; - pmr_terms[i].match.mask = &mask; - pmr_terms[i].val_sz = sizeof(val); - } - - pmr_composite = odp_cls_pmr_create(pmr_terms, PMR_SET_NUM, - default_cos, cos); - CU_ASSERT(odp_pmr_to_u64(pmr_composite) != - odp_pmr_to_u64(ODP_PMR_INVAL)); - - retval = odp_cls_pmr_destroy(pmr_composite); - CU_ASSERT(retval == 0); - - odp_queue_destroy(queue); - odp_pool_destroy(pool); - odp_pool_destroy(pkt_pool); - odp_cos_destroy(cos); - odp_queue_destroy(default_queue); - odp_pool_destroy(default_pool); - odp_cos_destroy(default_cos); - odp_pktio_close(pktio); -} - -odp_testinfo_t classification_suite_basic[] = { - ODP_TEST_INFO(classification_test_create_cos), - ODP_TEST_INFO(classification_test_destroy_cos), - ODP_TEST_INFO(classification_test_create_pmr_match), - ODP_TEST_INFO(classification_test_cos_set_queue), - ODP_TEST_INFO(classification_test_cos_set_drop), - ODP_TEST_INFO(classification_test_cos_set_pool), - ODP_TEST_INFO(classification_test_pmr_composite_create), - ODP_TEST_INFO_NULL, -}; diff --git a/test/validation/api/classification/odp_classification_common.c b/test/validation/api/classification/odp_classification_common.c deleted file mode 100644 index 60e20ea87..000000000 --- a/test/validation/api/classification/odp_classification_common.c +++ /dev/null @@ -1,428 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "odp_classification_testsuites.h" -#include "classification.h" -#include -#include "test_debug.h" - -typedef struct cls_test_packet { - odp_u32be_t magic; - odp_u32be_t seq; -} cls_test_packet_t; - -static uint8_t IPV6_SRC_ADDR[ODPH_IPV6ADDR_LEN] = { - /* I.e. ::ffff:10.0.0.1 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 10, 0, 0, 1 -}; - -static uint8_t IPV6_DST_ADDR[ODPH_IPV6ADDR_LEN] = { - /* I.e. ::ffff:10.0.0.100 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 10, 0, 0, 100 -}; - -odp_pktio_t create_pktio(odp_queue_type_t q_type, odp_pool_t pool, - odp_bool_t cls_enable) -{ - odp_pktio_t pktio; - odp_pktio_param_t pktio_param; - odp_pktin_queue_param_t pktin_param; - int ret; - - if (pool == ODP_POOL_INVALID) - return ODP_PKTIO_INVALID; - - odp_pktio_param_init(&pktio_param); - if (q_type == ODP_QUEUE_TYPE_PLAIN) - pktio_param.in_mode = ODP_PKTIN_MODE_QUEUE; - else - pktio_param.in_mode = ODP_PKTIN_MODE_SCHED; - - pktio = odp_pktio_open("loop", pool, &pktio_param); - if (pktio == ODP_PKTIO_INVALID) { - ret = odp_pool_destroy(pool); - if (ret) - fprintf(stderr, "unable to destroy pool.\n"); - return ODP_PKTIO_INVALID; - } - - odp_pktin_queue_param_init(&pktin_param); - pktin_param.queue_param.sched.sync = ODP_SCHED_SYNC_ATOMIC; - pktin_param.classifier_enable = cls_enable; - pktin_param.hash_enable = false; - - if (odp_pktin_queue_config(pktio, &pktin_param)) { - fprintf(stderr, "pktin queue config failed.\n"); - return ODP_PKTIO_INVALID; - } - - if (odp_pktout_queue_config(pktio, NULL)) { - fprintf(stderr, "pktout queue config failed.\n"); - return ODP_PKTIO_INVALID; - } - - return pktio; -} - -int stop_pktio(odp_pktio_t pktio) -{ - odp_event_t ev; - - if (odp_pktio_stop(pktio)) { - fprintf(stderr, "pktio stop failed.\n"); - return -1; - } - - while (1) { - ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT); - - if (ev != ODP_EVENT_INVALID) - odp_event_free(ev); - else - break; - } - - return 0; -} - -int cls_pkt_set_seq(odp_packet_t pkt) -{ - static uint32_t seq; - cls_test_packet_t data; - uint32_t offset; - odph_ipv4hdr_t *ip; - odph_tcphdr_t *tcp; - int status; - - data.magic = DATA_MAGIC; - data.seq = ++seq; - - ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL); - offset = odp_packet_l4_offset(pkt); - CU_ASSERT_FATAL(offset != ODP_PACKET_OFFSET_INVALID); - - if (ip->proto == ODPH_IPPROTO_UDP) - status = odp_packet_copy_from_mem(pkt, offset + ODPH_UDPHDR_LEN, - sizeof(data), &data); - else { - tcp = (odph_tcphdr_t *)odp_packet_l4_ptr(pkt, NULL); - status = odp_packet_copy_from_mem(pkt, offset + tcp->hl * 4, - sizeof(data), &data); - } - - return status; -} - -uint32_t cls_pkt_get_seq(odp_packet_t pkt) -{ - uint32_t offset; - cls_test_packet_t data; - odph_ipv4hdr_t *ip; - odph_tcphdr_t *tcp; - - ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL); - offset = odp_packet_l4_offset(pkt); - - if (offset == ODP_PACKET_OFFSET_INVALID || ip == NULL) - return TEST_SEQ_INVALID; - - if (ip->proto == ODPH_IPPROTO_UDP) - odp_packet_copy_to_mem(pkt, offset + ODPH_UDPHDR_LEN, - sizeof(data), &data); - else { - tcp = (odph_tcphdr_t *)odp_packet_l4_ptr(pkt, NULL); - odp_packet_copy_to_mem(pkt, offset + tcp->hl * 4, - sizeof(data), &data); - } - - if (data.magic == DATA_MAGIC) - return data.seq; - - return TEST_SEQ_INVALID; -} - -int parse_ipv4_string(const char *ipaddress, uint32_t *addr, uint32_t *mask) -{ - int b[4]; - int qualifier = 32; - int converted; - - if (strchr(ipaddress, '/')) { - converted = sscanf(ipaddress, "%d.%d.%d.%d/%d", - &b[3], &b[2], &b[1], &b[0], - &qualifier); - if (5 != converted) - return -1; - } else { - converted = sscanf(ipaddress, "%d.%d.%d.%d", - &b[3], &b[2], &b[1], &b[0]); - if (4 != converted) - return -1; - } - - if ((b[0] > 255) || (b[1] > 255) || (b[2] > 255) || (b[3] > 255)) - return -1; - if (!qualifier || (qualifier > 32)) - return -1; - - *addr = b[0] | b[1] << 8 | b[2] << 16 | b[3] << 24; - if (mask) - *mask = ~(0xFFFFFFFF & ((1ULL << (32 - qualifier)) - 1)); - - return 0; -} - -void enqueue_pktio_interface(odp_packet_t pkt, odp_pktio_t pktio) -{ - odp_pktout_queue_t pktout; - - CU_ASSERT_FATAL(odp_pktout_queue(pktio, &pktout, 1) == 1); - CU_ASSERT(odp_pktout_send(pktout, &pkt, 1) == 1); -} - -odp_packet_t receive_packet(odp_queue_t *queue, uint64_t ns) -{ - odp_event_t ev; - - ev = odp_schedule(queue, ns); - return odp_packet_from_event(ev); -} - -odp_queue_t queue_create(const char *queuename, bool sched) -{ - odp_queue_t queue; - odp_queue_param_t qparam; - - if (sched) { - odp_queue_param_init(&qparam); - qparam.type = ODP_QUEUE_TYPE_SCHED; - qparam.sched.prio = ODP_SCHED_PRIO_HIGHEST; - qparam.sched.sync = ODP_SCHED_SYNC_PARALLEL; - qparam.sched.group = ODP_SCHED_GROUP_ALL; - - queue = odp_queue_create(queuename, &qparam); - } else { - queue = odp_queue_create(queuename, NULL); - } - - return queue; -} - -odp_pool_t pool_create(const char *poolname) -{ - odp_pool_param_t param; - - odp_pool_param_init(¶m); - param.pkt.seg_len = SHM_PKT_BUF_SIZE; - param.pkt.len = SHM_PKT_BUF_SIZE; - param.pkt.num = SHM_PKT_NUM_BUFS; - param.type = ODP_POOL_PACKET; - - return odp_pool_create(poolname, ¶m); -} - -odp_packet_t create_packet(cls_packet_info_t pkt_info) -{ - uint32_t seqno; - odph_ethhdr_t *ethhdr; - odph_udphdr_t *udp; - odph_tcphdr_t *tcp; - odph_ipv4hdr_t *ip; - odph_ipv6hdr_t *ipv6; - uint16_t payload_len; - uint64_t src_mac = CLS_DEFAULT_SMAC; - uint64_t dst_mac = CLS_DEFAULT_DMAC; - uint64_t dst_mac_be; - uint32_t addr = 0; - uint32_t mask; - odp_packet_t pkt; - int packet_len = 0; - uint32_t version, tc, flow, ver_tc_flow; - uint8_t *buf, next_hdr; - uint32_t l4_len, l3_len, l2_len, l3_offset, l4_offset; - uint16_t vlan_hdr_len = 0; - uint16_t l2_hdr_len = 0; - uint16_t l3_hdr_len = 0; - uint16_t l4_hdr_len = 0; - uint16_t eth_type; - odp_u16be_t *vlan_type; - odph_vlanhdr_t *vlan_hdr; - - /* 48 bit ethernet address needs to be left shifted for proper - value after changing to be*/ - dst_mac_be = odp_cpu_to_be_64(dst_mac); - if (dst_mac != dst_mac_be) - dst_mac_be = dst_mac_be >> (64 - 8 * ODPH_ETHADDR_LEN); - - payload_len = sizeof(cls_test_packet_t) + pkt_info.len; - seqno = odp_atomic_fetch_inc_u32(pkt_info.seq); - - vlan_hdr_len = pkt_info.vlan ? ODPH_VLANHDR_LEN : 0; - vlan_hdr_len = pkt_info.vlan_qinq ? 2 * vlan_hdr_len : vlan_hdr_len; - l3_hdr_len = pkt_info.ipv6 ? ODPH_IPV6HDR_LEN : ODPH_IPV4HDR_LEN; - l4_hdr_len = pkt_info.udp ? ODPH_UDPHDR_LEN : ODPH_TCPHDR_LEN; - eth_type = pkt_info.ipv6 ? ODPH_ETHTYPE_IPV6 : ODPH_ETHTYPE_IPV4; - next_hdr = pkt_info.udp ? ODPH_IPPROTO_UDP : ODPH_IPPROTO_TCP; - l2_hdr_len = ODPH_ETHHDR_LEN + vlan_hdr_len; - l4_len = l4_hdr_len + payload_len; - l3_len = l3_hdr_len + l4_len; - l2_len = l2_hdr_len + l3_len; - packet_len = l2_len; - - pkt = odp_packet_alloc(pkt_info.pool, packet_len); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - - /* Ethernet Header */ - buf = odp_packet_data(pkt); - odp_packet_l2_offset_set(pkt, 0); - ethhdr = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - memcpy(ethhdr->src.addr, &src_mac, ODPH_ETHADDR_LEN); - memcpy(ethhdr->dst.addr, &dst_mac_be, ODPH_ETHADDR_LEN); - vlan_type = (odp_u16be_t *)(void *)ðhdr->type; - vlan_hdr = (odph_vlanhdr_t *)(ethhdr + 1); - - if (pkt_info.vlan_qinq) { - odp_packet_has_vlan_qinq_set(pkt, 1); - *vlan_type = odp_cpu_to_be_16(ODPH_ETHTYPE_VLAN_OUTER); - vlan_hdr->tci = odp_cpu_to_be_16(0); - vlan_type = (uint16_t *)(void *)&vlan_hdr->type; - vlan_hdr++; - } - if (pkt_info.vlan) { - /* Default vlan header */ - odp_packet_has_vlan_set(pkt, 1); - *vlan_type = odp_cpu_to_be_16(ODPH_ETHTYPE_VLAN); - vlan_hdr->tci = odp_cpu_to_be_16(0); - vlan_hdr->type = odp_cpu_to_be_16(eth_type); - } else { - ethhdr->type = odp_cpu_to_be_16(eth_type); - } - - l3_offset = l2_hdr_len; - odp_packet_l3_offset_set(pkt, l3_offset); - - if (!pkt_info.ipv6) { - /* ipv4 */ - ip = (odph_ipv4hdr_t *)(buf + l3_offset); - - parse_ipv4_string(CLS_DEFAULT_DADDR, &addr, &mask); - ip->dst_addr = odp_cpu_to_be_32(addr); - - parse_ipv4_string(CLS_DEFAULT_SADDR, &addr, &mask); - ip->src_addr = odp_cpu_to_be_32(addr); - ip->ver_ihl = ODPH_IPV4 << 4 | ODPH_IPV4HDR_IHL_MIN; - ip->id = odp_cpu_to_be_16(seqno); - odph_ipv4_csum_update(pkt); - ip->proto = next_hdr; - ip->tot_len = odp_cpu_to_be_16(l3_len); - ip->ttl = DEFAULT_TTL; - odp_packet_has_ipv4_set(pkt, 1); - } else { - /* ipv6 */ - odp_packet_has_ipv6_set(pkt, 1); - ipv6 = (odph_ipv6hdr_t *)odp_packet_l3_ptr(pkt, NULL); - version = ODPH_IPV6 << ODPH_IPV6HDR_VERSION_SHIFT; - tc = DEFAULT_TOS << ODPH_IPV6HDR_TC_SHIFT; - flow = seqno << ODPH_IPV6HDR_FLOW_LABEL_SHIFT; - ver_tc_flow = version | tc | flow; - - ipv6->ver_tc_flow = odp_cpu_to_be_32(ver_tc_flow); - ipv6->payload_len = odp_cpu_to_be_16(l4_len); - ipv6->next_hdr = next_hdr; - ipv6->hop_limit = DEFAULT_TTL; - memcpy(ipv6->src_addr, IPV6_SRC_ADDR, ODPH_IPV6ADDR_LEN); - memcpy(ipv6->dst_addr, IPV6_DST_ADDR, ODPH_IPV6ADDR_LEN); - } - - l4_offset = l3_offset + l3_hdr_len; - odp_packet_l4_offset_set(pkt, l4_offset); - tcp = (odph_tcphdr_t *)(buf + l4_offset); - udp = (odph_udphdr_t *)(buf + l4_offset); - - /* udp */ - if (pkt_info.udp) { - udp->src_port = odp_cpu_to_be_16(CLS_DEFAULT_SPORT); - udp->dst_port = odp_cpu_to_be_16(CLS_DEFAULT_DPORT); - udp->length = odp_cpu_to_be_16(payload_len + ODPH_UDPHDR_LEN); - udp->chksum = 0; - odp_packet_has_udp_set(pkt, 1); - if (odph_udp_tcp_chksum(pkt, ODPH_CHKSUM_GENERATE, NULL) != 0) { - LOG_ERR("odph_udp_tcp_chksum failed\n"); - return ODP_PACKET_INVALID; - } - } else { - tcp->src_port = odp_cpu_to_be_16(CLS_DEFAULT_SPORT); - tcp->dst_port = odp_cpu_to_be_16(CLS_DEFAULT_DPORT); - tcp->hl = ODPH_TCPHDR_LEN / 4; - tcp->cksm = 0; - odp_packet_has_tcp_set(pkt, 1); - if (odph_udp_tcp_chksum(pkt, ODPH_CHKSUM_GENERATE, NULL) != 0) { - LOG_ERR("odph_udp_tcp_chksum failed\n"); - return ODP_PACKET_INVALID; - } - - } - - /* set pkt sequence number */ - cls_pkt_set_seq(pkt); - - return pkt; -} - -odp_cls_pmr_term_t find_first_supported_l3_pmr(void) -{ - odp_cls_pmr_term_t term = ODP_PMR_TCP_DPORT; - odp_cls_capability_t capability; - - odp_cls_capability(&capability); - - /* choose supported PMR */ - if (capability.supported_terms.bit.udp_sport) - term = ODP_PMR_UDP_SPORT; - else if (capability.supported_terms.bit.udp_dport) - term = ODP_PMR_UDP_DPORT; - else if (capability.supported_terms.bit.tcp_sport) - term = ODP_PMR_TCP_SPORT; - else if (capability.supported_terms.bit.tcp_dport) - term = ODP_PMR_TCP_DPORT; - else - CU_FAIL("Implementations doesn't support any TCP/UDP PMR"); - - return term; -} - -int set_first_supported_pmr_port(odp_packet_t pkt, uint16_t port) -{ - odph_udphdr_t *udp; - odph_tcphdr_t *tcp; - odp_cls_pmr_term_t term; - - udp = (odph_udphdr_t *)odp_packet_l4_ptr(pkt, NULL); - tcp = (odph_tcphdr_t *)odp_packet_l4_ptr(pkt, NULL); - port = odp_cpu_to_be_16(port); - term = find_first_supported_l3_pmr(); - switch (term) { - case ODP_PMR_UDP_SPORT: - udp->src_port = port; - break; - case ODP_PMR_UDP_DPORT: - udp->dst_port = port; - break; - case ODP_PMR_TCP_DPORT: - tcp->dst_port = port; - break; - case ODP_PMR_TCP_SPORT: - tcp->src_port = port; - break; - default: - CU_FAIL("Unsupported L3 term"); - return -1; - } - - return 0; -} diff --git a/test/validation/api/classification/odp_classification_test_pmr.c b/test/validation/api/classification/odp_classification_test_pmr.c deleted file mode 100644 index f21b8addd..000000000 --- a/test/validation/api/classification/odp_classification_test_pmr.c +++ /dev/null @@ -1,1963 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "odp_classification_testsuites.h" -#include "classification.h" -#include - -static odp_pool_t pkt_pool; -/** sequence number of IP packets */ -odp_atomic_u32_t seq; - -static cls_packet_info_t default_pkt_info; - -int classification_suite_pmr_init(void) -{ - pkt_pool = pool_create("classification_pmr_pool"); - if (ODP_POOL_INVALID == pkt_pool) { - fprintf(stderr, "Packet pool creation failed.\n"); - return -1; - } - - memset(&default_pkt_info, 0, sizeof(cls_packet_info_t)); - default_pkt_info.pool = pkt_pool; - default_pkt_info.seq = &seq; - - odp_atomic_init_u32(&seq, 0); - - return 0; -} - -static int start_pktio(odp_pktio_t pktio) -{ - if (odp_pktio_start(pktio)) { - fprintf(stderr, "unable to start loop\n"); - return -1; - } - - return 0; -} - -void configure_default_cos(odp_pktio_t pktio, odp_cos_t *cos, - odp_queue_t *queue, odp_pool_t *pool) -{ - odp_cls_cos_param_t cls_param; - odp_pool_t default_pool; - odp_cos_t default_cos; - odp_queue_t default_queue; - int retval; - char cosname[ODP_COS_NAME_LEN]; - - default_pool = pool_create("DefaultPool"); - CU_ASSERT(default_pool != ODP_POOL_INVALID); - - default_queue = queue_create("DefaultQueue", true); - CU_ASSERT(default_queue != ODP_QUEUE_INVALID); - - sprintf(cosname, "DefaultCos"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = default_pool; - cls_param.queue = default_queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - default_cos = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT(default_cos != ODP_COS_INVALID); - - retval = odp_pktio_default_cos_set(pktio, default_cos); - CU_ASSERT(retval == 0); - - *cos = default_cos; - *queue = default_queue; - *pool = default_pool; -} - -int classification_suite_pmr_term(void) -{ - int retcode = 0; - - if (0 != odp_pool_destroy(pkt_pool)) { - fprintf(stderr, "pkt_pool destroy failed.\n"); - retcode = -1; - } - - return retcode; -} - -static void classification_test_pktin_classifier_flag(void) -{ - odp_packet_t pkt; - odph_tcphdr_t *tcp; - uint32_t seqno; - uint16_t val; - uint16_t mask; - int retval; - odp_pktio_t pktio; - odp_queue_t queue; - odp_queue_t retqueue; - odp_queue_t default_queue; - odp_cos_t default_cos; - odp_pool_t default_pool; - odp_pmr_t pmr; - odp_cos_t cos; - char cosname[ODP_COS_NAME_LEN]; - odp_cls_cos_param_t cls_param; - odp_pool_t pool; - odp_pool_t pool_recv; - odp_pmr_param_t pmr_param; - odph_ethhdr_t *eth; - - val = CLS_DEFAULT_DPORT; - mask = 0xffff; - seqno = 0; - - /* classifier is disabled in pktin queue configuration */ - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, false); - CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = start_pktio(pktio); - CU_ASSERT(retval == 0); - - configure_default_cos(pktio, &default_cos, - &default_queue, &default_pool); - - queue = queue_create("tcp_dport1", true); - CU_ASSERT(queue != ODP_QUEUE_INVALID); - - pool = pool_create("tcp_dport1"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - sprintf(cosname, "tcp_dport"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT(cos != ODP_COS_INVALID); - - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = ODP_PMR_TCP_DPORT; - pmr_param.match.value = &val; - pmr_param.match.mask = &mask; - pmr_param.val_sz = sizeof(val); - - pmr = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos); - CU_ASSERT(pmr != ODP_PMR_INVAL); - - pkt = create_packet(default_pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - tcp = (odph_tcphdr_t *)odp_packet_l4_ptr(pkt, NULL); - tcp->dst_port = odp_cpu_to_be_16(CLS_DEFAULT_DPORT); - - enqueue_pktio_interface(pkt, pktio); - - /* since classifier flag is disabled in pktin queue configuration - packet will not be delivered in classifier queues */ - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - pool_recv = odp_packet_pool(pkt); - /* since classifier is disabled packet should not be received in - pool and queue configured with classifier */ - CU_ASSERT(pool != pool_recv); - CU_ASSERT(retqueue != queue); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - - odp_packet_free(pkt); - odp_cos_destroy(cos); - odp_cos_destroy(default_cos); - odp_cls_pmr_destroy(pmr); - stop_pktio(pktio); - odp_queue_destroy(queue); - odp_queue_destroy(default_queue); - odp_pool_destroy(pool); - odp_pool_destroy(default_pool); - odp_pktio_close(pktio); -} - -static void classification_test_pmr_term_tcp_dport(void) -{ - odp_packet_t pkt; - odph_tcphdr_t *tcp; - uint32_t seqno; - uint16_t val; - uint16_t mask; - int retval; - odp_pktio_t pktio; - odp_queue_t queue; - odp_queue_t retqueue; - odp_queue_t default_queue; - odp_cos_t default_cos; - odp_pool_t default_pool; - odp_pool_t recvpool; - odp_pmr_t pmr; - odp_cos_t cos; - char cosname[ODP_COS_NAME_LEN]; - odp_cls_cos_param_t cls_param; - odp_pool_t pool; - odp_pool_t pool_recv; - odp_pmr_param_t pmr_param; - odph_ethhdr_t *eth; - val = CLS_DEFAULT_DPORT; - mask = 0xffff; - seqno = 0; - - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); - CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = start_pktio(pktio); - CU_ASSERT(retval == 0); - - configure_default_cos(pktio, &default_cos, - &default_queue, &default_pool); - - queue = queue_create("tcp_dport1", true); - CU_ASSERT(queue != ODP_QUEUE_INVALID); - - pool = pool_create("tcp_dport1"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - sprintf(cosname, "tcp_dport"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT(cos != ODP_COS_INVALID); - - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = ODP_PMR_TCP_DPORT; - pmr_param.match.value = &val; - pmr_param.match.mask = &mask; - pmr_param.val_sz = sizeof(val); - - pmr = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos); - CU_ASSERT(pmr != ODP_PMR_INVAL); - - pkt = create_packet(default_pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - tcp = (odph_tcphdr_t *)odp_packet_l4_ptr(pkt, NULL); - tcp->dst_port = odp_cpu_to_be_16(CLS_DEFAULT_DPORT); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - pool_recv = odp_packet_pool(pkt); - CU_ASSERT(pool == pool_recv); - CU_ASSERT(retqueue == queue); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - - odp_packet_free(pkt); - - /* Other packets are delivered to default queue */ - pkt = create_packet(default_pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - tcp = (odph_tcphdr_t *)odp_packet_l4_ptr(pkt, NULL); - tcp->dst_port = odp_cpu_to_be_16(CLS_DEFAULT_DPORT + 1); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - CU_ASSERT(retqueue == default_queue); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == default_pool); - - odp_packet_free(pkt); - odp_cos_destroy(cos); - odp_cos_destroy(default_cos); - odp_cls_pmr_destroy(pmr); - stop_pktio(pktio); - odp_queue_destroy(queue); - odp_queue_destroy(default_queue); - odp_pool_destroy(pool); - odp_pool_destroy(default_pool); - odp_pktio_close(pktio); -} - -static void classification_test_pmr_term_tcp_sport(void) -{ - odp_packet_t pkt; - odph_tcphdr_t *tcp; - uint32_t seqno; - uint16_t val; - uint16_t mask; - int retval; - odp_pktio_t pktio; - odp_queue_t queue; - odp_queue_t retqueue; - odp_queue_t default_queue; - odp_cos_t default_cos; - odp_pool_t default_pool; - odp_pool_t pool; - odp_pool_t recvpool; - odp_pmr_t pmr; - odp_cos_t cos; - char cosname[ODP_COS_NAME_LEN]; - odp_cls_cos_param_t cls_param; - odp_pmr_param_t pmr_param; - odph_ethhdr_t *eth; - - val = CLS_DEFAULT_SPORT; - mask = 0xffff; - seqno = 0; - - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); - CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = start_pktio(pktio); - CU_ASSERT(retval == 0); - - configure_default_cos(pktio, &default_cos, - &default_queue, &default_pool); - - queue = queue_create("tcp_sport", true); - CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); - - pool = pool_create("tcp_sport"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - sprintf(cosname, "tcp_sport"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos != ODP_COS_INVALID); - - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = ODP_PMR_TCP_SPORT; - pmr_param.match.value = &val; - pmr_param.match.mask = &mask; - pmr_param.val_sz = sizeof(val); - - pmr = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos); - CU_ASSERT(pmr != ODP_PMR_INVAL); - - pkt = create_packet(default_pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - tcp = (odph_tcphdr_t *)odp_packet_l4_ptr(pkt, NULL); - tcp->src_port = odp_cpu_to_be_16(CLS_DEFAULT_SPORT); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - CU_ASSERT(retqueue == queue); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == pool); - odp_packet_free(pkt); - - pkt = create_packet(default_pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - tcp = (odph_tcphdr_t *)odp_packet_l4_ptr(pkt, NULL); - tcp->src_port = odp_cpu_to_be_16(CLS_DEFAULT_SPORT + 1); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - CU_ASSERT(retqueue == default_queue); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == default_pool); - - odp_packet_free(pkt); - odp_cos_destroy(cos); - odp_cos_destroy(default_cos); - odp_cls_pmr_destroy(pmr); - stop_pktio(pktio); - odp_pool_destroy(default_pool); - odp_pool_destroy(pool); - odp_queue_destroy(queue); - odp_queue_destroy(default_queue); - odp_pktio_close(pktio); -} - -static void classification_test_pmr_term_udp_dport(void) -{ - odp_packet_t pkt; - odph_udphdr_t *udp; - uint32_t seqno; - uint16_t val; - uint16_t mask; - int retval; - odp_pktio_t pktio; - odp_pool_t pool; - odp_pool_t recvpool; - odp_queue_t queue; - odp_queue_t retqueue; - odp_queue_t default_queue; - odp_cos_t default_cos; - odp_pool_t default_pool; - odp_pmr_t pmr; - odp_cos_t cos; - char cosname[ODP_COS_NAME_LEN]; - odp_pmr_param_t pmr_param; - odp_cls_cos_param_t cls_param; - odph_ethhdr_t *eth; - cls_packet_info_t pkt_info; - - val = CLS_DEFAULT_DPORT; - mask = 0xffff; - seqno = 0; - - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); - CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = start_pktio(pktio); - CU_ASSERT(retval == 0); - - configure_default_cos(pktio, &default_cos, - &default_queue, &default_pool); - - queue = queue_create("udp_dport", true); - CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); - - pool = pool_create("udp_dport"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - sprintf(cosname, "udp_dport"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos != ODP_COS_INVALID); - - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = ODP_PMR_UDP_DPORT; - pmr_param.match.value = &val; - pmr_param.match.mask = &mask; - pmr_param.val_sz = sizeof(val); - - pmr = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos); - CU_ASSERT(pmr != ODP_PMR_INVAL); - - pkt_info = default_pkt_info; - pkt_info.udp = true; - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - udp = (odph_udphdr_t *)odp_packet_l4_ptr(pkt, NULL); - udp->dst_port = odp_cpu_to_be_16(CLS_DEFAULT_DPORT); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - CU_ASSERT(retqueue == queue); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == pool); - odp_packet_free(pkt); - - /* Other packets received in default queue */ - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - udp = (odph_udphdr_t *)odp_packet_l4_ptr(pkt, NULL); - udp->dst_port = odp_cpu_to_be_16(CLS_DEFAULT_DPORT + 1); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - CU_ASSERT(retqueue == default_queue); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == default_pool); - - odp_packet_free(pkt); - odp_cos_destroy(cos); - odp_cos_destroy(default_cos); - odp_cls_pmr_destroy(pmr); - stop_pktio(pktio); - odp_queue_destroy(queue); - odp_queue_destroy(default_queue); - odp_pool_destroy(default_pool); - odp_pool_destroy(pool); - odp_pktio_close(pktio); -} - -static void classification_test_pmr_term_udp_sport(void) -{ - odp_packet_t pkt; - odph_udphdr_t *udp; - uint32_t seqno; - uint16_t val; - uint16_t mask; - int retval; - odp_pktio_t pktio; - odp_queue_t queue; - odp_queue_t retqueue; - odp_queue_t default_queue; - odp_cos_t default_cos; - odp_pool_t default_pool; - odp_pool_t pool; - odp_pool_t recvpool; - odp_pmr_t pmr; - odp_cos_t cos; - char cosname[ODP_COS_NAME_LEN]; - odp_pmr_param_t pmr_param; - odp_cls_cos_param_t cls_param; - odph_ethhdr_t *eth; - cls_packet_info_t pkt_info; - - val = CLS_DEFAULT_SPORT; - mask = 0xffff; - seqno = 0; - - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); - CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = start_pktio(pktio); - CU_ASSERT(retval == 0); - - configure_default_cos(pktio, &default_cos, - &default_queue, &default_pool); - - queue = queue_create("udp_sport", true); - CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); - - pool = pool_create("udp_sport"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - sprintf(cosname, "udp_sport"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos != ODP_COS_INVALID); - - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = ODP_PMR_UDP_SPORT; - pmr_param.match.value = &val; - pmr_param.match.mask = &mask; - pmr_param.val_sz = sizeof(val); - - pmr = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos); - CU_ASSERT(pmr != ODP_PMR_INVAL); - - pkt_info = default_pkt_info; - pkt_info.udp = true; - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - udp = (odph_udphdr_t *)odp_packet_l4_ptr(pkt, NULL); - udp->src_port = odp_cpu_to_be_16(CLS_DEFAULT_SPORT); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - CU_ASSERT(retqueue == queue); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == pool); - odp_packet_free(pkt); - - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - udp = (odph_udphdr_t *)odp_packet_l4_ptr(pkt, NULL); - udp->src_port = odp_cpu_to_be_16(CLS_DEFAULT_SPORT + 1); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - CU_ASSERT(retqueue == default_queue); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == default_pool); - odp_packet_free(pkt); - - odp_cos_destroy(cos); - odp_cos_destroy(default_cos); - odp_cls_pmr_destroy(pmr); - stop_pktio(pktio); - odp_pool_destroy(default_pool); - odp_pool_destroy(pool); - odp_queue_destroy(queue); - odp_queue_destroy(default_queue); - odp_pktio_close(pktio); -} - -static void classification_test_pmr_term_ipproto(void) -{ - odp_packet_t pkt; - uint32_t seqno; - uint8_t val; - uint8_t mask; - int retval; - odp_pktio_t pktio; - odp_queue_t queue; - odp_queue_t retqueue; - odp_queue_t default_queue; - odp_cos_t default_cos; - odp_pool_t default_pool; - odp_pool_t pool; - odp_pool_t recvpool; - odp_pmr_t pmr; - odp_cos_t cos; - char cosname[ODP_COS_NAME_LEN]; - odp_cls_cos_param_t cls_param; - odp_pmr_param_t pmr_param; - odph_ethhdr_t *eth; - cls_packet_info_t pkt_info; - - val = ODPH_IPPROTO_UDP; - mask = 0xff; - seqno = 0; - - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); - CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = start_pktio(pktio); - CU_ASSERT(retval == 0); - - configure_default_cos(pktio, &default_cos, - &default_queue, &default_pool); - - queue = queue_create("ipproto", true); - CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); - - pool = pool_create("ipproto"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - sprintf(cosname, "ipproto"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos != ODP_COS_INVALID); - - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = ODP_PMR_IPPROTO; - pmr_param.match.value = &val; - pmr_param.match.mask = &mask; - pmr_param.val_sz = sizeof(val); - - pmr = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos); - CU_ASSERT(pmr != ODP_PMR_INVAL); - - pkt_info = default_pkt_info; - pkt_info.udp = true; - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == pool); - CU_ASSERT(retqueue == queue); - odp_packet_free(pkt); - - /* Other packets delivered to default queue */ - pkt = create_packet(default_pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == default_pool); - CU_ASSERT(retqueue == default_queue); - - odp_cos_destroy(cos); - odp_cos_destroy(default_cos); - odp_cls_pmr_destroy(pmr); - odp_packet_free(pkt); - stop_pktio(pktio); - odp_pool_destroy(default_pool); - odp_pool_destroy(pool); - odp_queue_destroy(queue); - odp_queue_destroy(default_queue); - odp_pktio_close(pktio); -} - -static void classification_test_pmr_term_dmac(void) -{ - odp_packet_t pkt; - uint32_t seqno; - uint64_t val; - uint64_t mask; - int retval; - odp_pktio_t pktio; - odp_queue_t queue; - odp_queue_t retqueue; - odp_queue_t default_queue; - odp_cos_t default_cos; - odp_pool_t default_pool; - odp_pool_t pool; - odp_pool_t recvpool; - odp_pmr_t pmr; - odp_cos_t cos; - char cosname[ODP_COS_NAME_LEN]; - odp_cls_cos_param_t cls_param; - odp_pmr_param_t pmr_param; - odph_ethhdr_t *eth; - cls_packet_info_t pkt_info; - - val = CLS_DEFAULT_DMAC; /* 48 bit Ethernet Mac address */ - mask = 0xffffffffffff; - seqno = 0; - - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); - CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = start_pktio(pktio); - CU_ASSERT(retval == 0); - - configure_default_cos(pktio, &default_cos, - &default_queue, &default_pool); - - queue = queue_create("dmac", true); - CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); - - pool = pool_create("dmac"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - sprintf(cosname, "dmac"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos != ODP_COS_INVALID); - - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = ODP_PMR_DMAC; - pmr_param.match.value = &val; - pmr_param.match.mask = &mask; - pmr_param.val_sz = ODPH_ETHADDR_LEN; - - pmr = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos); - CU_ASSERT(pmr != ODP_PMR_INVAL); - - pkt_info = default_pkt_info; - pkt_info.udp = true; - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == pool); - CU_ASSERT(retqueue == queue); - odp_packet_free(pkt); - - /* Other packets delivered to default queue */ - pkt = create_packet(default_pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - memset(eth->dst.addr, 0, ODPH_ETHADDR_LEN); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == default_pool); - CU_ASSERT(retqueue == default_queue); - - odp_cos_destroy(cos); - odp_cos_destroy(default_cos); - odp_cls_pmr_destroy(pmr); - odp_packet_free(pkt); - stop_pktio(pktio); - odp_pool_destroy(default_pool); - odp_pool_destroy(pool); - odp_queue_destroy(queue); - odp_queue_destroy(default_queue); - odp_pktio_close(pktio); -} - -static void classification_test_pmr_term_packet_len(void) -{ - odp_packet_t pkt; - uint32_t seqno; - uint16_t val; - uint16_t mask; - int retval; - odp_pktio_t pktio; - odp_queue_t queue; - odp_queue_t retqueue; - odp_queue_t default_queue; - odp_cos_t default_cos; - odp_pool_t default_pool; - odp_pool_t pool; - odp_pool_t recvpool; - odp_pmr_t pmr; - odp_cos_t cos; - char cosname[ODP_COS_NAME_LEN]; - odp_cls_cos_param_t cls_param; - odp_pmr_param_t pmr_param; - odph_ethhdr_t *eth; - cls_packet_info_t pkt_info; - - val = 1024; - /*Mask value will match any packet of length 1000 - 1099*/ - mask = 0xff00; - seqno = 0; - - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); - CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = start_pktio(pktio); - CU_ASSERT(retval == 0); - - configure_default_cos(pktio, &default_cos, - &default_queue, &default_pool); - - queue = queue_create("packet_len", true); - CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); - - pool = pool_create("packet_len"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - sprintf(cosname, "packet_len"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos != ODP_COS_INVALID); - - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = ODP_PMR_LEN; - pmr_param.match.value = &val; - pmr_param.match.mask = &mask; - pmr_param.val_sz = sizeof(val); - - pmr = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos); - CU_ASSERT(pmr != ODP_PMR_INVAL); - - /* create packet of payload length 1024 */ - pkt_info = default_pkt_info; - pkt_info.udp = true; - pkt_info.len = 1024; - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == pool); - CU_ASSERT(retqueue == queue); - odp_packet_free(pkt); - - /* Other packets delivered to default queue */ - pkt = create_packet(default_pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == default_pool); - CU_ASSERT(retqueue == default_queue); - - odp_cos_destroy(cos); - odp_cos_destroy(default_cos); - odp_cls_pmr_destroy(pmr); - odp_packet_free(pkt); - stop_pktio(pktio); - odp_pool_destroy(default_pool); - odp_pool_destroy(pool); - odp_queue_destroy(queue); - odp_queue_destroy(default_queue); - odp_pktio_close(pktio); -} - -static void classification_test_pmr_term_vlan_id_0(void) -{ - odp_packet_t pkt; - uint32_t seqno; - uint16_t val; - uint16_t mask; - int retval; - odp_pktio_t pktio; - odp_queue_t queue; - odp_queue_t retqueue; - odp_queue_t default_queue; - odp_cos_t default_cos; - odp_pool_t default_pool; - odp_pool_t pool; - odp_pool_t recvpool; - odp_pmr_t pmr; - odp_cos_t cos; - char cosname[ODP_COS_NAME_LEN]; - odp_cls_cos_param_t cls_param; - odp_pmr_param_t pmr_param; - odph_ethhdr_t *eth; - odph_vlanhdr_t *vlan_0; - cls_packet_info_t pkt_info; - - val = 1024; - mask = 0xff00; - seqno = 0; - - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); - CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = start_pktio(pktio); - CU_ASSERT(retval == 0); - - configure_default_cos(pktio, &default_cos, - &default_queue, &default_pool); - - queue = queue_create("vlan_id_0", true); - CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); - - pool = pool_create("vlan_id_0"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - sprintf(cosname, "vlan_id_0"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos != ODP_COS_INVALID); - - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = ODP_PMR_VLAN_ID_0; - pmr_param.match.value = &val; - pmr_param.match.mask = &mask; - pmr_param.val_sz = sizeof(val); - - pmr = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos); - CU_ASSERT(pmr != ODP_PMR_INVAL); - - /* create packet of payload length 1024 */ - pkt_info = default_pkt_info; - pkt_info.vlan = true; - pkt_info.vlan_qinq = true; - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - vlan_0 = (odph_vlanhdr_t *)(eth + 1); - vlan_0->tci = odp_cpu_to_be_16(1024); - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == pool); - CU_ASSERT(retqueue == queue); - odp_packet_free(pkt); - - /* Other packets delivered to default queue */ - pkt = create_packet(default_pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == default_pool); - CU_ASSERT(retqueue == default_queue); - - odp_cos_destroy(cos); - odp_cos_destroy(default_cos); - odp_cls_pmr_destroy(pmr); - odp_packet_free(pkt); - stop_pktio(pktio); - odp_pool_destroy(default_pool); - odp_pool_destroy(pool); - odp_queue_destroy(queue); - odp_queue_destroy(default_queue); - odp_pktio_close(pktio); -} - -static void classification_test_pmr_term_vlan_id_x(void) -{ - odp_packet_t pkt; - uint32_t seqno; - uint16_t val; - uint16_t mask; - int retval; - odp_pktio_t pktio; - odp_queue_t queue; - odp_queue_t retqueue; - odp_queue_t default_queue; - odp_cos_t default_cos; - odp_pool_t default_pool; - odp_pool_t pool; - odp_pool_t recvpool; - odp_pmr_t pmr; - odp_cos_t cos; - char cosname[ODP_COS_NAME_LEN]; - odp_cls_cos_param_t cls_param; - odp_pmr_param_t pmr_param; - odph_ethhdr_t *eth; - odph_vlanhdr_t *vlan_x; - cls_packet_info_t pkt_info; - - val = 1024; - mask = 0xff00; - seqno = 0; - - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); - CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = start_pktio(pktio); - CU_ASSERT(retval == 0); - - configure_default_cos(pktio, &default_cos, - &default_queue, &default_pool); - - queue = queue_create("vlan_id_x", true); - CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); - - pool = pool_create("vlan_id_x"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - sprintf(cosname, "vlan_id_x"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos != ODP_COS_INVALID); - - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = ODP_PMR_VLAN_ID_X; - pmr_param.match.value = &val; - pmr_param.match.mask = &mask; - pmr_param.val_sz = sizeof(val); - - pmr = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos); - CU_ASSERT(pmr != ODP_PMR_INVAL); - - /* create packet of payload length 1024 */ - pkt_info = default_pkt_info; - pkt_info.vlan = true; - pkt_info.vlan_qinq = true; - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - vlan_x = (odph_vlanhdr_t *)(eth + 1); - vlan_x++; - vlan_x->tci = odp_cpu_to_be_16(1024); - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == pool); - CU_ASSERT(retqueue == queue); - odp_packet_free(pkt); - - /* Other packets delivered to default queue */ - pkt = create_packet(default_pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == default_pool); - CU_ASSERT(retqueue == default_queue); - - odp_cos_destroy(cos); - odp_cos_destroy(default_cos); - odp_cls_pmr_destroy(pmr); - odp_packet_free(pkt); - stop_pktio(pktio); - odp_pool_destroy(default_pool); - odp_pool_destroy(pool); - odp_queue_destroy(queue); - odp_queue_destroy(default_queue); - odp_pktio_close(pktio); -} - -static void classification_test_pmr_term_eth_type_0(void) -{ - odp_packet_t pkt; - uint32_t seqno; - uint16_t val; - uint16_t mask; - int retval; - odp_pktio_t pktio; - odp_queue_t queue; - odp_queue_t retqueue; - odp_queue_t default_queue; - odp_cos_t default_cos; - odp_pool_t default_pool; - odp_pool_t pool; - odp_pool_t recvpool; - odp_pmr_t pmr; - odp_cos_t cos; - char cosname[ODP_COS_NAME_LEN]; - odp_cls_cos_param_t cls_param; - odp_pmr_param_t pmr_param; - odph_ethhdr_t *eth; - cls_packet_info_t pkt_info; - - val = 0x88A8; - mask = 0xffff; - seqno = 0; - - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); - CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = start_pktio(pktio); - CU_ASSERT(retval == 0); - - configure_default_cos(pktio, &default_cos, - &default_queue, &default_pool); - - queue = queue_create("eth_type_0", true); - CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); - - pool = pool_create("eth_type_0"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - sprintf(cosname, "eth_type_0"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos != ODP_COS_INVALID); - - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = ODP_PMR_ETHTYPE_0; - pmr_param.match.value = &val; - pmr_param.match.mask = &mask; - pmr_param.val_sz = sizeof(val); - - pmr = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos); - CU_ASSERT(pmr != ODP_PMR_INVAL); - - pkt_info = default_pkt_info; - pkt_info.vlan = true; - pkt_info.vlan_qinq = true; - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == pool); - CU_ASSERT(retqueue == queue); - odp_packet_free(pkt); - - /* Other packets delivered to default queue */ - pkt = create_packet(default_pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == default_pool); - CU_ASSERT(retqueue == default_queue); - - odp_cos_destroy(cos); - odp_cos_destroy(default_cos); - odp_cls_pmr_destroy(pmr); - odp_packet_free(pkt); - stop_pktio(pktio); - odp_pool_destroy(default_pool); - odp_pool_destroy(pool); - odp_queue_destroy(queue); - odp_queue_destroy(default_queue); - odp_pktio_close(pktio); -} - -static void classification_test_pmr_term_eth_type_x(void) -{ - odp_packet_t pkt; - uint32_t seqno; - uint16_t val; - uint16_t mask; - int retval; - odp_pktio_t pktio; - odp_queue_t queue; - odp_queue_t retqueue; - odp_queue_t default_queue; - odp_cos_t default_cos; - odp_pool_t default_pool; - odp_pool_t pool; - odp_pool_t recvpool; - odp_pmr_t pmr; - odp_cos_t cos; - char cosname[ODP_COS_NAME_LEN]; - odp_cls_cos_param_t cls_param; - odp_pmr_param_t pmr_param; - odph_ethhdr_t *eth; - odph_vlanhdr_t *vlan_x; - cls_packet_info_t pkt_info; - - val = 0x8100; - mask = 0xff00; - seqno = 0; - - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); - CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = start_pktio(pktio); - CU_ASSERT(retval == 0); - - configure_default_cos(pktio, &default_cos, - &default_queue, &default_pool); - - queue = queue_create("eth_type_x", true); - CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); - - pool = pool_create("eth_type_x"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - sprintf(cosname, "eth_type_x"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos != ODP_COS_INVALID); - - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = ODP_PMR_ETHTYPE_X; - pmr_param.match.value = &val; - pmr_param.match.mask = &mask; - pmr_param.val_sz = sizeof(val); - - pmr = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos); - CU_ASSERT(pmr != ODP_PMR_INVAL); - - /* create packet of payload length 1024 */ - pkt_info = default_pkt_info; - pkt_info.vlan = true; - pkt_info.vlan_qinq = true; - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - vlan_x = (odph_vlanhdr_t *)(eth + 1); - vlan_x->tci = odp_cpu_to_be_16(1024); - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == pool); - CU_ASSERT(retqueue == queue); - odp_packet_free(pkt); - - /* Other packets delivered to default queue */ - pkt = create_packet(default_pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == default_pool); - CU_ASSERT(retqueue == default_queue); - - odp_cos_destroy(cos); - odp_cos_destroy(default_cos); - odp_cls_pmr_destroy(pmr); - odp_packet_free(pkt); - stop_pktio(pktio); - odp_pool_destroy(default_pool); - odp_pool_destroy(pool); - odp_queue_destroy(queue); - odp_queue_destroy(default_queue); - odp_pktio_close(pktio); -} - -static void classification_test_pmr_pool_set(void) -{ - odp_packet_t pkt; - uint32_t seqno; - uint8_t val; - uint8_t mask; - int retval; - odp_pktio_t pktio; - odp_queue_t queue; - odp_queue_t retqueue; - odp_queue_t default_queue; - odp_cos_t default_cos; - odp_pool_t default_pool; - odp_pool_t pool; - odp_pool_t pool_new; - odp_pool_t recvpool; - odp_pmr_t pmr; - odp_cos_t cos; - char cosname[ODP_COS_NAME_LEN]; - odp_cls_cos_param_t cls_param; - odp_pmr_param_t pmr_param; - odph_ethhdr_t *eth; - cls_packet_info_t pkt_info; - - val = ODPH_IPPROTO_UDP; - mask = 0xff; - seqno = 0; - - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); - CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = start_pktio(pktio); - CU_ASSERT(retval == 0); - - configure_default_cos(pktio, &default_cos, - &default_queue, &default_pool); - - queue = queue_create("ipproto1", true); - CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); - - pool = pool_create("ipproto1"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - sprintf(cosname, "ipproto1"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos != ODP_COS_INVALID); - - pool_new = pool_create("ipproto2"); - CU_ASSERT_FATAL(pool_new != ODP_POOL_INVALID); - - /* new pool is set on CoS */ - retval = odp_cls_cos_pool_set(cos, pool_new); - CU_ASSERT(retval == 0); - - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = ODP_PMR_IPPROTO; - pmr_param.match.value = &val; - pmr_param.match.mask = &mask; - pmr_param.val_sz = sizeof(val); - - pmr = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos); - CU_ASSERT(pmr != ODP_PMR_INVAL); - - pkt_info = default_pkt_info; - pkt_info.udp = true; - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == pool_new); - CU_ASSERT(retqueue == queue); - odp_packet_free(pkt); - - odp_cos_destroy(cos); - odp_cos_destroy(default_cos); - odp_cls_pmr_destroy(pmr); - stop_pktio(pktio); - odp_pool_destroy(default_pool); - odp_pool_destroy(pool); - odp_pool_destroy(pool_new); - odp_queue_destroy(queue); - odp_queue_destroy(default_queue); - odp_pktio_close(pktio); -} - -static void classification_test_pmr_queue_set(void) -{ - odp_packet_t pkt; - uint32_t seqno; - uint8_t val; - uint8_t mask; - int retval; - odp_pktio_t pktio; - odp_queue_t queue; - odp_queue_t retqueue; - odp_queue_t default_queue; - odp_cos_t default_cos; - odp_pool_t default_pool; - odp_pool_t pool; - odp_queue_t queue_new; - odp_pool_t recvpool; - odp_pmr_t pmr; - odp_cos_t cos; - char cosname[ODP_COS_NAME_LEN]; - odp_cls_cos_param_t cls_param; - odp_pmr_param_t pmr_param; - odph_ethhdr_t *eth; - cls_packet_info_t pkt_info; - - val = ODPH_IPPROTO_UDP; - mask = 0xff; - seqno = 0; - - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); - CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); - retval = start_pktio(pktio); - CU_ASSERT(retval == 0); - - configure_default_cos(pktio, &default_cos, - &default_queue, &default_pool); - - queue = queue_create("ipproto1", true); - CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); - - pool = pool_create("ipproto1"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - sprintf(cosname, "ipproto1"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos != ODP_COS_INVALID); - - queue_new = queue_create("ipproto2", true); - CU_ASSERT_FATAL(queue_new != ODP_QUEUE_INVALID); - - /* new queue is set on CoS */ - retval = odp_cos_queue_set(cos, queue_new); - CU_ASSERT(retval == 0); - - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = ODP_PMR_IPPROTO; - pmr_param.match.value = &val; - pmr_param.match.mask = &mask; - pmr_param.val_sz = sizeof(val); - - pmr = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos); - CU_ASSERT(pmr != ODP_PMR_INVAL); - pkt_info = default_pkt_info; - pkt_info.udp = true; - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - recvpool = odp_packet_pool(pkt); - CU_ASSERT(recvpool == pool); - CU_ASSERT(retqueue == queue_new); - odp_packet_free(pkt); - - odp_cos_destroy(cos); - odp_cos_destroy(default_cos); - odp_cls_pmr_destroy(pmr); - stop_pktio(pktio); - odp_pool_destroy(default_pool); - odp_pool_destroy(pool); - odp_queue_destroy(queue_new); - odp_queue_destroy(queue); - odp_queue_destroy(default_queue); - odp_pktio_close(pktio); -} - -static void classification_test_pmr_term_daddr(void) -{ - odp_packet_t pkt; - uint32_t seqno; - int retval; - odp_pktio_t pktio; - odp_queue_t queue; - odp_queue_t retqueue; - odp_queue_t default_queue; - odp_pool_t pool; - odp_pool_t default_pool; - odp_pmr_t pmr; - odp_cos_t cos; - odp_cos_t default_cos; - uint32_t addr; - uint32_t mask; - char cosname[ODP_QUEUE_NAME_LEN]; - odp_pmr_param_t pmr_param; - odp_cls_cos_param_t cls_param; - odph_ipv4hdr_t *ip; - const char *dst_addr = "10.0.0.99/32"; - odph_ethhdr_t *eth; - - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); - retval = start_pktio(pktio); - CU_ASSERT(retval == 0); - - configure_default_cos(pktio, &default_cos, - &default_queue, &default_pool); - - queue = queue_create("daddr", true); - CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); - - pool = pool_create("daddr"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - sprintf(cosname, "daddr"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos != ODP_COS_INVALID); - - parse_ipv4_string(dst_addr, &addr, &mask); - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = ODP_PMR_DIP_ADDR; - pmr_param.match.value = &addr; - pmr_param.match.mask = &mask; - pmr_param.val_sz = sizeof(addr); - - pmr = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos); - CU_ASSERT_FATAL(pmr != ODP_PMR_INVAL); - - /* packet with dst ip address matching PMR rule to be - received in the CoS queue*/ - pkt = create_packet(default_pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL); - ip->dst_addr = odp_cpu_to_be_32(addr); - odph_ipv4_csum_update(pkt); - - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - CU_ASSERT(retqueue == queue); - odp_packet_free(pkt); - - /* Other packets delivered to default queue */ - pkt = create_packet(default_pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - CU_ASSERT(retqueue == default_queue); - - odp_cos_destroy(cos); - odp_cos_destroy(default_cos); - odp_cls_pmr_destroy(pmr); - odp_packet_free(pkt); - stop_pktio(pktio); - odp_pool_destroy(default_pool); - odp_pool_destroy(pool); - odp_queue_destroy(queue); - odp_queue_destroy(default_queue); - odp_pktio_close(pktio); -} - -static void classification_test_pmr_term_ipv6daddr(void) -{ - odp_packet_t pkt; - uint32_t seqno; - int retval; - odp_pktio_t pktio; - odp_queue_t queue; - odp_queue_t retqueue; - odp_queue_t default_queue; - odp_pool_t pool; - odp_pool_t default_pool; - odp_pmr_t pmr; - odp_cos_t cos; - odp_cos_t default_cos; - char cosname[ODP_QUEUE_NAME_LEN]; - odp_pmr_param_t pmr_param; - odp_cls_cos_param_t cls_param; - odph_ipv6hdr_t *ip; - odph_ethhdr_t *eth; - cls_packet_info_t pkt_info; - - uint8_t IPV6_DST_ADDR[ODPH_IPV6ADDR_LEN] = { - /* I.e. ::ffff:10.1.1.100 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 10, 1, 1, 100 - }; - uint8_t ipv6_mask[ODPH_IPV6ADDR_LEN] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - }; - - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); - retval = start_pktio(pktio); - CU_ASSERT(retval == 0); - - configure_default_cos(pktio, &default_cos, - &default_queue, &default_pool); - - queue = queue_create("daddr", true); - CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); - - pool = pool_create("daddr"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - sprintf(cosname, "daddr"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos != ODP_COS_INVALID); - - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = ODP_PMR_DIP6_ADDR; - pmr_param.match.value = IPV6_DST_ADDR; - pmr_param.match.mask = ipv6_mask; - pmr_param.val_sz = ODPH_IPV6ADDR_LEN; - - pmr = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos); - CU_ASSERT_FATAL(pmr != ODP_PMR_INVAL); - - /* packet with dst ip address matching PMR rule to be - received in the CoS queue*/ - pkt_info = default_pkt_info; - pkt_info.ipv6 = true; - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - ip = (odph_ipv6hdr_t *)odp_packet_l3_ptr(pkt, NULL); - memcpy(ip->dst_addr, IPV6_DST_ADDR, ODPH_IPV6ADDR_LEN); - - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - CU_ASSERT(retqueue == queue); - odp_packet_free(pkt); - - /* Other packets delivered to default queue */ - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - CU_ASSERT(retqueue == default_queue); - - odp_cos_destroy(cos); - odp_cos_destroy(default_cos); - odp_cls_pmr_destroy(pmr); - odp_packet_free(pkt); - stop_pktio(pktio); - odp_pool_destroy(default_pool); - odp_pool_destroy(pool); - odp_queue_destroy(queue); - odp_queue_destroy(default_queue); - odp_pktio_close(pktio); -} - -static void classification_test_pmr_term_ipv6saddr(void) -{ - odp_packet_t pkt; - uint32_t seqno; - int retval; - odp_pktio_t pktio; - odp_queue_t queue; - odp_queue_t retqueue; - odp_queue_t default_queue; - odp_pool_t pool; - odp_pool_t default_pool; - odp_pmr_t pmr; - odp_cos_t cos; - odp_cos_t default_cos; - char cosname[ODP_QUEUE_NAME_LEN]; - odp_pmr_param_t pmr_param; - odp_cls_cos_param_t cls_param; - odph_ipv6hdr_t *ip; - odph_ethhdr_t *eth; - cls_packet_info_t pkt_info; - uint8_t IPV6_SRC_ADDR[ODPH_IPV6ADDR_LEN] = { - /* I.e. ::ffff:10.0.0.100 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 10, 1, 1, 1 - }; - uint8_t ipv6_mask[ODPH_IPV6ADDR_LEN] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - }; - - pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pkt_pool, true); - retval = start_pktio(pktio); - CU_ASSERT(retval == 0); - - configure_default_cos(pktio, &default_cos, - &default_queue, &default_pool); - - queue = queue_create("saddr", true); - CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); - - pool = pool_create("saddr"); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - - sprintf(cosname, "saddr"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos != ODP_COS_INVALID); - - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = ODP_PMR_SIP6_ADDR; - pmr_param.match.value = IPV6_SRC_ADDR; - pmr_param.match.mask = ipv6_mask; - pmr_param.val_sz = ODPH_IPV6ADDR_LEN; - - pmr = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos); - CU_ASSERT_FATAL(pmr != ODP_PMR_INVAL); - - /* packet with dst ip address matching PMR rule to be - received in the CoS queue*/ - pkt_info = default_pkt_info; - pkt_info.ipv6 = true; - - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - ip = (odph_ipv6hdr_t *)odp_packet_l3_ptr(pkt, NULL); - memcpy(ip->src_addr, IPV6_SRC_ADDR, ODPH_IPV6ADDR_LEN); - - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - CU_ASSERT(retqueue == queue); - odp_packet_free(pkt); - - /* Other packets delivered to default queue */ - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); - odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); - - enqueue_pktio_interface(pkt, pktio); - - pkt = receive_packet(&retqueue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - CU_ASSERT(retqueue == default_queue); - - odp_cos_destroy(cos); - odp_cos_destroy(default_cos); - odp_cls_pmr_destroy(pmr); - odp_packet_free(pkt); - stop_pktio(pktio); - odp_pool_destroy(default_pool); - odp_pool_destroy(pool); - odp_queue_destroy(queue); - odp_queue_destroy(default_queue); - odp_pktio_close(pktio); -} - -odp_testinfo_t classification_suite_pmr[] = { - ODP_TEST_INFO(classification_test_pmr_term_tcp_dport), - ODP_TEST_INFO(classification_test_pmr_term_tcp_sport), - ODP_TEST_INFO(classification_test_pmr_term_udp_dport), - ODP_TEST_INFO(classification_test_pmr_term_udp_sport), - ODP_TEST_INFO(classification_test_pmr_term_ipproto), - ODP_TEST_INFO(classification_test_pmr_term_dmac), - ODP_TEST_INFO(classification_test_pmr_pool_set), - ODP_TEST_INFO(classification_test_pmr_queue_set), - ODP_TEST_INFO(classification_test_pmr_term_daddr), - ODP_TEST_INFO(classification_test_pmr_term_ipv6saddr), - ODP_TEST_INFO(classification_test_pmr_term_ipv6daddr), - ODP_TEST_INFO(classification_test_pmr_term_packet_len), - ODP_TEST_INFO(classification_test_pmr_term_vlan_id_0), - ODP_TEST_INFO(classification_test_pmr_term_vlan_id_x), - ODP_TEST_INFO(classification_test_pmr_term_eth_type_0), - ODP_TEST_INFO(classification_test_pmr_term_eth_type_x), - ODP_TEST_INFO(classification_test_pktin_classifier_flag), - ODP_TEST_INFO_NULL, -}; diff --git a/test/validation/api/classification/odp_classification_tests.c b/test/validation/api/classification/odp_classification_tests.c deleted file mode 100644 index 4cd727f9a..000000000 --- a/test/validation/api/classification/odp_classification_tests.c +++ /dev/null @@ -1,724 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "odp_classification_testsuites.h" -#include "classification.h" -#include - -static odp_cos_t cos_list[CLS_ENTRIES]; -static odp_pmr_t pmr_list[CLS_ENTRIES]; -static odp_queue_t queue_list[CLS_ENTRIES]; -static odp_pool_t pool_list[CLS_ENTRIES]; - -static odp_pool_t pool_default; -static odp_pktio_t pktio_loop; - -/** sequence number of IP packets */ -odp_atomic_u32_t seq; - -/* default packet info */ -static cls_packet_info_t default_pkt_info; - -int classification_suite_init(void) -{ - int i; - int ret; - odp_pktio_param_t pktio_param; - odp_pktin_queue_param_t pktin_param; - - pool_default = pool_create("classification_pool"); - if (ODP_POOL_INVALID == pool_default) { - fprintf(stderr, "Packet pool creation failed.\n"); - return -1; - } - - odp_pktio_param_init(&pktio_param); - pktio_param.in_mode = ODP_PKTIN_MODE_SCHED; - - pktio_loop = odp_pktio_open("loop", pool_default, &pktio_param); - if (pktio_loop == ODP_PKTIO_INVALID) { - ret = odp_pool_destroy(pool_default); - if (ret) - fprintf(stderr, "unable to destroy pool.\n"); - return -1; - } - - memset(&default_pkt_info, 0, sizeof(cls_packet_info_t)); - default_pkt_info.pool = pool_default; - default_pkt_info.seq = &seq; - - odp_pktin_queue_param_init(&pktin_param); - pktin_param.queue_param.sched.sync = ODP_SCHED_SYNC_ATOMIC; - pktin_param.classifier_enable = true; - pktin_param.hash_enable = false; - - if (odp_pktin_queue_config(pktio_loop, &pktin_param)) { - fprintf(stderr, "pktin queue config failed.\n"); - return -1; - } - - if (odp_pktout_queue_config(pktio_loop, NULL)) { - fprintf(stderr, "pktout queue config failed.\n"); - return -1; - } - - for (i = 0; i < CLS_ENTRIES; i++) - cos_list[i] = ODP_COS_INVALID; - - for (i = 0; i < CLS_ENTRIES; i++) - pmr_list[i] = ODP_PMR_INVAL; - - for (i = 0; i < CLS_ENTRIES; i++) - queue_list[i] = ODP_QUEUE_INVALID; - - for (i = 0; i < CLS_ENTRIES; i++) - pool_list[i] = ODP_POOL_INVALID; - - odp_atomic_init_u32(&seq, 0); - - ret = odp_pktio_start(pktio_loop); - if (ret) { - fprintf(stderr, "unable to start loop\n"); - return -1; - } - - return 0; -} - -int classification_suite_term(void) -{ - int i; - int retcode = 0; - - if (0 > stop_pktio(pktio_loop)) { - fprintf(stderr, "stop pktio failed.\n"); - retcode = -1; - } - - if (0 > odp_pktio_close(pktio_loop)) { - fprintf(stderr, "pktio close failed.\n"); - retcode = -1; - } - - if (0 != odp_pool_destroy(pool_default)) { - fprintf(stderr, "pool_default destroy failed.\n"); - retcode = -1; - } - - for (i = 0; i < CLS_ENTRIES; i++) - odp_cos_destroy(cos_list[i]); - - for (i = 0; i < CLS_ENTRIES; i++) - odp_cls_pmr_destroy(pmr_list[i]); - - for (i = 0; i < CLS_ENTRIES; i++) - odp_queue_destroy(queue_list[i]); - - for (i = 0; i < CLS_ENTRIES; i++) - odp_pool_destroy(pool_list[i]); - - return retcode; -} - -void configure_cls_pmr_chain(void) -{ - /* PKTIO --> PMR_SRC(SRC IP ADDR) --> PMR_DST (TCP SPORT) */ - - /* Packet matching only the SRC IP ADDR should be delivered - in queue[CLS_PMR_CHAIN_SRC] and a packet matching both SRC IP ADDR and - TCP SPORT should be delivered to queue[CLS_PMR_CHAIN_DST] */ - - uint16_t val; - uint16_t maskport; - char cosname[ODP_QUEUE_NAME_LEN]; - odp_queue_param_t qparam; - odp_cls_cos_param_t cls_param; - char queuename[ODP_QUEUE_NAME_LEN]; - char poolname[ODP_POOL_NAME_LEN]; - uint32_t addr; - uint32_t mask; - odp_pmr_param_t pmr_param; - odp_queue_capability_t queue_capa; - - CU_ASSERT_FATAL(odp_queue_capability(&queue_capa) == 0); - - odp_queue_param_init(&qparam); - qparam.type = ODP_QUEUE_TYPE_SCHED; - qparam.sched.prio = ODP_SCHED_PRIO_NORMAL; - qparam.sched.sync = ODP_SCHED_SYNC_PARALLEL; - qparam.sched.group = ODP_SCHED_GROUP_ALL; - qparam.sched.lock_count = queue_capa.max_ordered_locks; - sprintf(queuename, "%s", "SrcQueue"); - - queue_list[CLS_PMR_CHAIN_SRC] = odp_queue_create(queuename, &qparam); - - CU_ASSERT_FATAL(queue_list[CLS_PMR_CHAIN_SRC] != ODP_QUEUE_INVALID); - - sprintf(poolname, "%s", "SrcPool"); - pool_list[CLS_PMR_CHAIN_SRC] = pool_create(poolname); - CU_ASSERT_FATAL(pool_list[CLS_PMR_CHAIN_SRC] != ODP_POOL_INVALID); - - sprintf(cosname, "SrcCos"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool_list[CLS_PMR_CHAIN_SRC]; - cls_param.queue = queue_list[CLS_PMR_CHAIN_SRC]; - cls_param.drop_policy = ODP_COS_DROP_POOL; - - cos_list[CLS_PMR_CHAIN_SRC] = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos_list[CLS_PMR_CHAIN_SRC] != ODP_COS_INVALID); - - odp_queue_param_init(&qparam); - qparam.type = ODP_QUEUE_TYPE_SCHED; - qparam.sched.prio = ODP_SCHED_PRIO_NORMAL; - qparam.sched.sync = ODP_SCHED_SYNC_PARALLEL; - qparam.sched.group = ODP_SCHED_GROUP_ALL; - sprintf(queuename, "%s", "DstQueue"); - - queue_list[CLS_PMR_CHAIN_DST] = odp_queue_create(queuename, &qparam); - CU_ASSERT_FATAL(queue_list[CLS_PMR_CHAIN_DST] != ODP_QUEUE_INVALID); - - sprintf(poolname, "%s", "DstPool"); - pool_list[CLS_PMR_CHAIN_DST] = pool_create(poolname); - CU_ASSERT_FATAL(pool_list[CLS_PMR_CHAIN_DST] != ODP_POOL_INVALID); - - sprintf(cosname, "DstCos"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool_list[CLS_PMR_CHAIN_DST]; - cls_param.queue = queue_list[CLS_PMR_CHAIN_DST]; - cls_param.drop_policy = ODP_COS_DROP_POOL; - cos_list[CLS_PMR_CHAIN_DST] = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos_list[CLS_PMR_CHAIN_DST] != ODP_COS_INVALID); - - parse_ipv4_string(CLS_PMR_CHAIN_SADDR, &addr, &mask); - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = ODP_PMR_SIP_ADDR; - pmr_param.match.value = &addr; - pmr_param.match.mask = &mask; - pmr_param.val_sz = sizeof(addr); - pmr_list[CLS_PMR_CHAIN_SRC] = - odp_cls_pmr_create(&pmr_param, 1, cos_list[CLS_DEFAULT], - cos_list[CLS_PMR_CHAIN_SRC]); - CU_ASSERT_FATAL(pmr_list[CLS_PMR_CHAIN_SRC] != ODP_PMR_INVAL); - - val = CLS_PMR_CHAIN_PORT; - maskport = 0xffff; - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = find_first_supported_l3_pmr(); - pmr_param.match.value = &val; - pmr_param.match.mask = &maskport; - pmr_param.val_sz = sizeof(val); - pmr_list[CLS_PMR_CHAIN_DST] = - odp_cls_pmr_create(&pmr_param, 1, cos_list[CLS_PMR_CHAIN_SRC], - cos_list[CLS_PMR_CHAIN_DST]); - CU_ASSERT_FATAL(pmr_list[CLS_PMR_CHAIN_DST] != ODP_PMR_INVAL); -} - -void test_cls_pmr_chain(void) -{ - odp_packet_t pkt; - odph_ipv4hdr_t *ip; - odp_queue_t queue; - odp_pool_t pool; - uint32_t addr = 0; - uint32_t mask; - uint32_t seqno = 0; - cls_packet_info_t pkt_info; - - pkt_info = default_pkt_info; - pkt_info.udp = true; - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - - ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL); - parse_ipv4_string(CLS_PMR_CHAIN_SADDR, &addr, &mask); - ip->src_addr = odp_cpu_to_be_32(addr); - odph_ipv4_csum_update(pkt); - - set_first_supported_pmr_port(pkt, CLS_PMR_CHAIN_PORT); - - enqueue_pktio_interface(pkt, pktio_loop); - - pkt = receive_packet(&queue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(queue == queue_list[CLS_PMR_CHAIN_DST]); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - pool = odp_packet_pool(pkt); - CU_ASSERT(pool == pool_list[CLS_PMR_CHAIN_DST]); - odp_packet_free(pkt); - - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - - ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL); - parse_ipv4_string(CLS_PMR_CHAIN_SADDR, &addr, &mask); - ip->src_addr = odp_cpu_to_be_32(addr); - odph_ipv4_csum_update(pkt); - - enqueue_pktio_interface(pkt, pktio_loop); - pkt = receive_packet(&queue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(queue == queue_list[CLS_PMR_CHAIN_SRC]); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - pool = odp_packet_pool(pkt); - CU_ASSERT(pool == pool_list[CLS_PMR_CHAIN_SRC]); - odp_packet_free(pkt); -} - -void configure_pktio_default_cos(void) -{ - int retval; - odp_queue_param_t qparam; - odp_cls_cos_param_t cls_param; - char cosname[ODP_COS_NAME_LEN]; - char queuename[ODP_QUEUE_NAME_LEN]; - char poolname[ODP_POOL_NAME_LEN]; - - odp_queue_param_init(&qparam); - qparam.type = ODP_QUEUE_TYPE_SCHED; - qparam.sched.prio = ODP_SCHED_PRIO_DEFAULT; - qparam.sched.sync = ODP_SCHED_SYNC_PARALLEL; - qparam.sched.group = ODP_SCHED_GROUP_ALL; - sprintf(queuename, "%s", "DefaultQueue"); - queue_list[CLS_DEFAULT] = odp_queue_create(queuename, &qparam); - CU_ASSERT_FATAL(queue_list[CLS_DEFAULT] != ODP_QUEUE_INVALID); - - sprintf(poolname, "DefaultPool"); - pool_list[CLS_DEFAULT] = pool_create(poolname); - CU_ASSERT_FATAL(pool_list[CLS_DEFAULT] != ODP_POOL_INVALID); - - sprintf(cosname, "DefaultCoS"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool_list[CLS_DEFAULT]; - cls_param.queue = queue_list[CLS_DEFAULT]; - cls_param.drop_policy = ODP_COS_DROP_POOL; - cos_list[CLS_DEFAULT] = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos_list[CLS_DEFAULT] != ODP_COS_INVALID); - - retval = odp_pktio_default_cos_set(pktio_loop, cos_list[CLS_DEFAULT]); - CU_ASSERT(retval == 0); -} - -void test_pktio_default_cos(void) -{ - odp_packet_t pkt; - odp_queue_t queue; - uint32_t seqno = 0; - odp_pool_t pool; - cls_packet_info_t pkt_info; - - /* create a default packet */ - pkt_info = default_pkt_info; - pkt_info.udp = true; - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - - enqueue_pktio_interface(pkt, pktio_loop); - - pkt = receive_packet(&queue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - /* Default packet should be received in default queue */ - CU_ASSERT(queue == queue_list[CLS_DEFAULT]); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - pool = odp_packet_pool(pkt); - CU_ASSERT(pool == pool_list[CLS_DEFAULT]); - - odp_packet_free(pkt); -} - -void configure_pktio_error_cos(void) -{ - int retval; - odp_queue_param_t qparam; - odp_cls_cos_param_t cls_param; - char queuename[ODP_QUEUE_NAME_LEN]; - char cosname[ODP_COS_NAME_LEN]; - char poolname[ODP_POOL_NAME_LEN]; - - odp_queue_param_init(&qparam); - qparam.type = ODP_QUEUE_TYPE_SCHED; - qparam.sched.prio = ODP_SCHED_PRIO_LOWEST; - qparam.sched.sync = ODP_SCHED_SYNC_PARALLEL; - qparam.sched.group = ODP_SCHED_GROUP_ALL; - sprintf(queuename, "%s", "ErrorCos"); - - queue_list[CLS_ERROR] = odp_queue_create(queuename, &qparam); - CU_ASSERT_FATAL(queue_list[CLS_ERROR] != ODP_QUEUE_INVALID); - - sprintf(poolname, "ErrorPool"); - pool_list[CLS_ERROR] = pool_create(poolname); - CU_ASSERT_FATAL(pool_list[CLS_ERROR] != ODP_POOL_INVALID); - - sprintf(cosname, "%s", "ErrorCos"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool_list[CLS_ERROR]; - cls_param.queue = queue_list[CLS_ERROR]; - cls_param.drop_policy = ODP_COS_DROP_POOL; - cos_list[CLS_ERROR] = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos_list[CLS_ERROR] != ODP_COS_INVALID); - - retval = odp_pktio_error_cos_set(pktio_loop, cos_list[CLS_ERROR]); - CU_ASSERT(retval == 0); -} - -void test_pktio_error_cos(void) -{ - odp_queue_t queue; - odp_packet_t pkt; - odp_pool_t pool; - cls_packet_info_t pkt_info; - - /*Create an error packet */ - pkt_info = default_pkt_info; - pkt_info.udp = true; - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - odph_ipv4hdr_t *ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL); - - /* Incorrect IpV4 version */ - ip->ver_ihl = 8 << 4 | ODPH_IPV4HDR_IHL_MIN; - ip->chksum = 0; - enqueue_pktio_interface(pkt, pktio_loop); - - pkt = receive_packet(&queue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - /* Error packet should be received in error queue */ - CU_ASSERT(queue == queue_list[CLS_ERROR]); - pool = odp_packet_pool(pkt); - CU_ASSERT(pool == pool_list[CLS_ERROR]); - odp_packet_free(pkt); -} - -static void classification_test_pktio_set_skip(void) -{ - int retval; - size_t offset = 5; - - retval = odp_pktio_skip_set(pktio_loop, offset); - CU_ASSERT(retval == 0); - - retval = odp_pktio_skip_set(ODP_PKTIO_INVALID, offset); - CU_ASSERT(retval < 0); - - /* reset skip value to zero as validation suite expects - offset to be zero*/ - - retval = odp_pktio_skip_set(pktio_loop, 0); - CU_ASSERT(retval == 0); -} - -static void classification_test_pktio_set_headroom(void) -{ - size_t headroom; - int retval; - - headroom = 5; - retval = odp_pktio_headroom_set(pktio_loop, headroom); - CU_ASSERT(retval == 0); - - retval = odp_pktio_headroom_set(ODP_PKTIO_INVALID, headroom); - CU_ASSERT(retval < 0); -} - -void configure_cos_with_l2_priority(void) -{ - uint8_t num_qos = CLS_L2_QOS_MAX; - odp_cos_t cos_tbl[CLS_L2_QOS_MAX]; - odp_queue_t queue_tbl[CLS_L2_QOS_MAX]; - odp_pool_t pool; - uint8_t qos_tbl[CLS_L2_QOS_MAX]; - char cosname[ODP_COS_NAME_LEN]; - char queuename[ODP_QUEUE_NAME_LEN]; - char poolname[ODP_POOL_NAME_LEN]; - int retval; - int i; - odp_queue_param_t qparam; - odp_cls_cos_param_t cls_param; - - /** Initialize scalar variable qos_tbl **/ - for (i = 0; i < CLS_L2_QOS_MAX; i++) - qos_tbl[i] = 0; - - odp_queue_param_init(&qparam); - qparam.type = ODP_QUEUE_TYPE_SCHED; - qparam.sched.sync = ODP_SCHED_SYNC_PARALLEL; - qparam.sched.group = ODP_SCHED_GROUP_ALL; - for (i = 0; i < num_qos; i++) { - qparam.sched.prio = ODP_SCHED_PRIO_LOWEST - i; - sprintf(queuename, "%s_%d", "L2_Queue", i); - queue_tbl[i] = odp_queue_create(queuename, &qparam); - CU_ASSERT_FATAL(queue_tbl[i] != ODP_QUEUE_INVALID); - queue_list[CLS_L2_QOS_0 + i] = queue_tbl[i]; - - sprintf(poolname, "%s_%d", "L2_Pool", i); - pool = pool_create(poolname); - CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); - pool_list[CLS_L2_QOS_0 + i] = pool; - - sprintf(cosname, "%s_%d", "L2_Cos", i); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool; - cls_param.queue = queue_tbl[i]; - cls_param.drop_policy = ODP_COS_DROP_POOL; - cos_tbl[i] = odp_cls_cos_create(cosname, &cls_param); - if (cos_tbl[i] == ODP_COS_INVALID) - break; - - cos_list[CLS_L2_QOS_0 + i] = cos_tbl[i]; - qos_tbl[i] = i; - } - /* count 'i' is passed instead of num_qos to handle the rare scenario - if the odp_cls_cos_create() failed in the middle*/ - retval = odp_cos_with_l2_priority(pktio_loop, i, qos_tbl, cos_tbl); - CU_ASSERT(retval == 0); -} - -void test_cos_with_l2_priority(void) -{ - odp_packet_t pkt; - odph_ethhdr_t *ethhdr; - odph_vlanhdr_t *vlan; - odp_queue_t queue; - odp_pool_t pool; - uint32_t seqno = 0; - cls_packet_info_t pkt_info; - uint8_t i; - - pkt_info = default_pkt_info; - pkt_info.udp = true; - pkt_info.vlan = true; - - for (i = 0; i < CLS_L2_QOS_MAX; i++) { - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - ethhdr = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); - vlan = (odph_vlanhdr_t *)(ethhdr + 1); - vlan->tci = odp_cpu_to_be_16(i << 13); - enqueue_pktio_interface(pkt, pktio_loop); - pkt = receive_packet(&queue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(queue == queue_list[CLS_L2_QOS_0 + i]); - pool = odp_packet_pool(pkt); - CU_ASSERT(pool == pool_list[CLS_L2_QOS_0 + i]); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - odp_packet_free(pkt); - } -} - -void configure_pmr_cos(void) -{ - uint16_t val; - uint16_t mask; - odp_pmr_param_t pmr_param; - odp_queue_param_t qparam; - odp_cls_cos_param_t cls_param; - char cosname[ODP_COS_NAME_LEN]; - char queuename[ODP_QUEUE_NAME_LEN]; - char poolname[ODP_POOL_NAME_LEN]; - - odp_queue_param_init(&qparam); - qparam.type = ODP_QUEUE_TYPE_SCHED; - qparam.sched.prio = ODP_SCHED_PRIO_HIGHEST; - qparam.sched.sync = ODP_SCHED_SYNC_PARALLEL; - qparam.sched.group = ODP_SCHED_GROUP_ALL; - sprintf(queuename, "%s", "PMR_CoS"); - - queue_list[CLS_PMR] = odp_queue_create(queuename, &qparam); - CU_ASSERT_FATAL(queue_list[CLS_PMR] != ODP_QUEUE_INVALID); - - sprintf(poolname, "PMR_Pool"); - pool_list[CLS_PMR] = pool_create(poolname); - CU_ASSERT_FATAL(pool_list[CLS_PMR] != ODP_POOL_INVALID); - - sprintf(cosname, "PMR_CoS"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool_list[CLS_PMR]; - cls_param.queue = queue_list[CLS_PMR]; - cls_param.drop_policy = ODP_COS_DROP_POOL; - cos_list[CLS_PMR] = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos_list[CLS_PMR] != ODP_COS_INVALID); - - val = CLS_PMR_PORT; - mask = 0xffff; - odp_cls_pmr_param_init(&pmr_param); - pmr_param.term = find_first_supported_l3_pmr(); - pmr_param.match.value = &val; - pmr_param.match.mask = &mask; - pmr_param.val_sz = sizeof(val); - - pmr_list[CLS_PMR] = odp_cls_pmr_create(&pmr_param, 1, - cos_list[CLS_DEFAULT], - cos_list[CLS_PMR]); - CU_ASSERT_FATAL(pmr_list[CLS_PMR] != ODP_PMR_INVAL); -} - -void test_pmr_cos(void) -{ - odp_packet_t pkt; - odp_queue_t queue; - odp_pool_t pool; - uint32_t seqno = 0; - cls_packet_info_t pkt_info; - - pkt_info = default_pkt_info; - pkt_info.udp = true; - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - set_first_supported_pmr_port(pkt, CLS_PMR_PORT); - enqueue_pktio_interface(pkt, pktio_loop); - pkt = receive_packet(&queue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(queue == queue_list[CLS_PMR]); - pool = odp_packet_pool(pkt); - CU_ASSERT(pool == pool_list[CLS_PMR]); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - odp_packet_free(pkt); -} - -void configure_pktio_pmr_composite(void) -{ - odp_pmr_param_t pmr_params[2]; - uint16_t val; - uint16_t maskport; - int num_terms = 2; /* one pmr for each L3 and L4 */ - odp_queue_param_t qparam; - odp_cls_cos_param_t cls_param; - char cosname[ODP_COS_NAME_LEN]; - char queuename[ODP_QUEUE_NAME_LEN]; - char poolname[ODP_POOL_NAME_LEN]; - uint32_t addr = 0; - uint32_t mask; - - odp_queue_param_init(&qparam); - qparam.type = ODP_QUEUE_TYPE_SCHED; - qparam.sched.prio = ODP_SCHED_PRIO_HIGHEST; - qparam.sched.sync = ODP_SCHED_SYNC_PARALLEL; - qparam.sched.group = ODP_SCHED_GROUP_ALL; - sprintf(queuename, "%s", "cos_pmr_composite_queue"); - - queue_list[CLS_PMR_SET] = odp_queue_create(queuename, &qparam); - CU_ASSERT_FATAL(queue_list[CLS_PMR_SET] != ODP_QUEUE_INVALID); - - sprintf(poolname, "cos_pmr_composite_pool"); - pool_list[CLS_PMR_SET] = pool_create(poolname); - CU_ASSERT_FATAL(pool_list[CLS_PMR_SET] != ODP_POOL_INVALID); - - sprintf(cosname, "cos_pmr_composite"); - odp_cls_cos_param_init(&cls_param); - cls_param.pool = pool_list[CLS_PMR_SET]; - cls_param.queue = queue_list[CLS_PMR_SET]; - cls_param.drop_policy = ODP_COS_DROP_POOL; - cos_list[CLS_PMR_SET] = odp_cls_cos_create(cosname, &cls_param); - CU_ASSERT_FATAL(cos_list[CLS_PMR_SET] != ODP_COS_INVALID); - - parse_ipv4_string(CLS_PMR_SET_SADDR, &addr, &mask); - odp_cls_pmr_param_init(&pmr_params[0]); - pmr_params[0].term = ODP_PMR_SIP_ADDR; - pmr_params[0].match.value = &addr; - pmr_params[0].match.mask = &mask; - pmr_params[0].val_sz = sizeof(addr); - - val = CLS_PMR_SET_PORT; - maskport = 0xffff; - odp_cls_pmr_param_init(&pmr_params[1]); - pmr_params[1].term = find_first_supported_l3_pmr(); - pmr_params[1].match.value = &val; - pmr_params[1].match.mask = &maskport; - pmr_params[1].range_term = false; - pmr_params[1].val_sz = sizeof(val); - - pmr_list[CLS_PMR_SET] = odp_cls_pmr_create(pmr_params, num_terms, - cos_list[CLS_DEFAULT], - cos_list[CLS_PMR_SET]); - CU_ASSERT_FATAL(pmr_list[CLS_PMR_SET] != ODP_PMR_INVAL); -} - -void test_pktio_pmr_composite_cos(void) -{ - uint32_t addr = 0; - uint32_t mask; - odph_ipv4hdr_t *ip; - odp_packet_t pkt; - odp_pool_t pool; - odp_queue_t queue; - uint32_t seqno = 0; - cls_packet_info_t pkt_info; - - pkt_info = default_pkt_info; - pkt_info.udp = true; - pkt = create_packet(pkt_info); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - seqno = cls_pkt_get_seq(pkt); - CU_ASSERT(seqno != TEST_SEQ_INVALID); - - ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL); - parse_ipv4_string(CLS_PMR_SET_SADDR, &addr, &mask); - ip->src_addr = odp_cpu_to_be_32(addr); - odph_ipv4_csum_update(pkt); - - set_first_supported_pmr_port(pkt, CLS_PMR_SET_PORT); - enqueue_pktio_interface(pkt, pktio_loop); - pkt = receive_packet(&queue, ODP_TIME_SEC_IN_NS); - CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); - CU_ASSERT(queue == queue_list[CLS_PMR_SET]); - pool = odp_packet_pool(pkt); - CU_ASSERT(pool == pool_list[CLS_PMR_SET]); - CU_ASSERT(seqno == cls_pkt_get_seq(pkt)); - odp_packet_free(pkt); -} - -static void classification_test_pktio_configure(void) -{ - /* Configure the Different CoS for the pktio interface */ - if (TEST_DEFAULT) - configure_pktio_default_cos(); - if (TEST_ERROR) - configure_pktio_error_cos(); - if (TEST_PMR_CHAIN) - configure_cls_pmr_chain(); - if (TEST_L2_QOS) - configure_cos_with_l2_priority(); - if (TEST_PMR) - configure_pmr_cos(); - if (TEST_PMR_SET) - configure_pktio_pmr_composite(); -} - -static void classification_test_pktio_test(void) -{ - /* Test Different CoS on the pktio interface */ - if (TEST_DEFAULT) - test_pktio_default_cos(); - if (TEST_ERROR) - test_pktio_error_cos(); - if (TEST_PMR_CHAIN) - test_cls_pmr_chain(); - if (TEST_L2_QOS) - test_cos_with_l2_priority(); - if (TEST_PMR) - test_pmr_cos(); - if (TEST_PMR_SET) - test_pktio_pmr_composite_cos(); -} - -odp_testinfo_t classification_suite[] = { - ODP_TEST_INFO(classification_test_pktio_set_skip), - ODP_TEST_INFO(classification_test_pktio_set_headroom), - ODP_TEST_INFO(classification_test_pktio_configure), - ODP_TEST_INFO(classification_test_pktio_test), - ODP_TEST_INFO_NULL, -}; diff --git a/test/validation/api/classification/odp_classification_testsuites.h b/test/validation/api/classification/odp_classification_testsuites.h deleted file mode 100644 index e1624162f..000000000 --- a/test/validation/api/classification/odp_classification_testsuites.h +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef ODP_CLASSIFICATION_TESTSUITES_H_ -#define ODP_CLASSIFICATION_TESTSUITES_H_ - -#include -#include -#include -#include - -typedef struct cls_packet_info { - odp_pool_t pool; - bool vlan; - bool vlan_qinq; - odp_atomic_u32_t *seq; - bool udp; - bool ipv6; - uint32_t len; -} cls_packet_info_t; - -extern odp_testinfo_t classification_suite[]; -extern odp_testinfo_t classification_suite_basic[]; -extern odp_testinfo_t classification_suite_pmr[]; - -int classification_suite_init(void); -int classification_suite_term(void); - -int classification_suite_pmr_term(void); -int classification_suite_pmr_init(void); - -odp_packet_t create_packet(cls_packet_info_t pkt_info); -int cls_pkt_set_seq(odp_packet_t pkt); -uint32_t cls_pkt_get_seq(odp_packet_t pkt); -odp_pktio_t create_pktio(odp_queue_type_t q_type, odp_pool_t pool, - odp_bool_t cls_enable); -void configure_default_cos(odp_pktio_t pktio, odp_cos_t *cos, - odp_queue_t *queue, odp_pool_t *pool); -int parse_ipv4_string(const char *ipaddress, uint32_t *addr, uint32_t *mask); -void enqueue_pktio_interface(odp_packet_t pkt, odp_pktio_t pktio); -odp_packet_t receive_packet(odp_queue_t *queue, uint64_t ns); -odp_pool_t pool_create(const char *poolname); -odp_queue_t queue_create(const char *queuename, bool sched); -void configure_pktio_default_cos(void); -void test_pktio_default_cos(void); -void configure_pktio_error_cos(void); -void test_pktio_error_cos(void); -void configure_cls_pmr_chain(void); -void test_cls_pmr_chain(void); -void configure_cos_with_l2_priority(void); -void test_cos_with_l2_priority(void); -void configure_pmr_cos(void); -void test_pmr_cos(void); -void configure_pktio_pmr_composite(void); -void test_pktio_pmr_composite_cos(void); -int stop_pktio(odp_pktio_t pktio); -odp_cls_pmr_term_t find_first_supported_l3_pmr(void); -int set_first_supported_pmr_port(odp_packet_t pkt, uint16_t port); - -#endif /* ODP_BUFFER_TESTSUITES_H_ */ diff --git a/test/validation/api/cpumask/cpumask.c b/test/validation/api/cpumask.c similarity index 100% rename from test/validation/api/cpumask/cpumask.c rename to test/validation/api/cpumask.c diff --git a/test/validation/api/cpumask/.gitignore b/test/validation/api/cpumask/.gitignore deleted file mode 100644 index 655a1640f..000000000 --- a/test/validation/api/cpumask/.gitignore +++ /dev/null @@ -1 +0,0 @@ -cpumask_main diff --git a/test/validation/api/cpumask/Makefile.am b/test/validation/api/cpumask/Makefile.am deleted file mode 100644 index 3872c1bd4..000000000 --- a/test/validation/api/cpumask/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = cpumask_main -cpumask_main_SOURCES = cpumask.c -LDADD += $(LIBCPUMASK_COMMON) diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto.c similarity index 99% rename from test/validation/api/crypto/odp_crypto_test_inp.c rename to test/validation/api/crypto.c index ec477535f..de449d480 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto.c @@ -9,7 +9,7 @@ #include #include #include -#include "test_vectors.h" +#include "crypto_test_vectors.h" #define MAX_ALG_CAPA 32 diff --git a/test/validation/api/crypto/.gitignore b/test/validation/api/crypto/.gitignore deleted file mode 100644 index 0ac55e35e..000000000 --- a/test/validation/api/crypto/.gitignore +++ /dev/null @@ -1 +0,0 @@ -crypto_main diff --git a/test/validation/api/crypto/Makefile.am b/test/validation/api/crypto/Makefile.am deleted file mode 100644 index cc4d49d60..000000000 --- a/test/validation/api/crypto/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = crypto_main -crypto_main_SOURCES = \ - odp_crypto_test_inp.c \ - test_vectors.h \ - test_vectors_len.h diff --git a/test/validation/api/crypto/test_vectors_len.h b/test/validation/api/crypto/test_vectors_len.h deleted file mode 100644 index 140bef2a2..000000000 --- a/test/validation/api/crypto/test_vectors_len.h +++ /dev/null @@ -1,77 +0,0 @@ -/* Copyright (c) 2014, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef TEST_VECTORS_LEN_ -#define TEST_VECTORS_LEN_ - -/* Maximum */ -#define MAX_KEY_LEN 64 -#define MAX_IV_LEN 16 -#define MAX_DATA_LEN 128 -#define MAX_AAD_LEN 12 -#define MAX_DIGEST_LEN 64 - -/* TDES-CBC */ -#define TDES_CBC_KEY_LEN 24 -#define TDES_CBC_IV_LEN 8 - -/* AES-CBC common */ -#define AES_CBC_IV_LEN 16 - -/* AES128-CBC */ -#define AES128_CBC_KEY_LEN 16 - -/* AES192-CBC */ -#define AES192_CBC_KEY_LEN 24 - -/* AES256-CBC */ -#define AES256_CBC_KEY_LEN 32 - -/* AES-CBC common */ -#define AES_CTR_IV_LEN 16 - -/* AES128-CTR */ -#define AES128_CTR_KEY_LEN 16 - -/* AES192-CTR */ -#define AES192_CTR_KEY_LEN 24 - -/* AES256-CTR */ -#define AES256_CTR_KEY_LEN 32 - -/* AES-GCM common */ -#define AES_GCM_IV_LEN 12 -#define AES_GCM_DIGEST_LEN 16 - -/* AES128-GCM */ -#define AES128_GCM_KEY_LEN 16 - -/* AES192-GCM */ -#define AES192_GCM_KEY_LEN 24 - -/* AES256-GCM */ -#define AES256_GCM_KEY_LEN 32 - -/* HMAC-MD5 */ -#define HMAC_MD5_KEY_LEN 16 -#define HMAC_MD5_96_CHECK_LEN 12 -#define HMAC_MD5_CHECK_LEN 16 - -/* HMAC-SHA256 */ -#define HMAC_SHA256_KEY_LEN 32 -#define HMAC_SHA256_128_CHECK_LEN 16 -#define HMAC_SHA256_CHECK_LEN 32 - -/* HMAC-SHA1 */ -#define HMAC_SHA1_KEY_LEN 20 -#define HMAC_SHA1_96_CHECK_LEN 12 -#define HMAC_SHA1_CHECK_LEN 20 - -/* HMAC-SHA512 */ -#define HMAC_SHA512_KEY_LEN 64 -#define HMAC_SHA512_256_CHECK_LEN 32 -#define HMAC_SHA512_CHECK_LEN 64 - -#endif diff --git a/test/validation/api/crypto/test_vectors.h b/test/validation/api/crypto_test_vectors.h similarity index 96% rename from test/validation/api/crypto/test_vectors.h rename to test/validation/api/crypto_test_vectors.h index 6592a3357..061db05bc 100644 --- a/test/validation/api/crypto/test_vectors.h +++ b/test/validation/api/crypto_test_vectors.h @@ -7,7 +7,73 @@ #ifndef _ODP_TEST_CRYPTO_VECTORS_H_ #define _ODP_TEST_CRYPTO_VECTORS_H_ -#include "test_vectors_len.h" +/* Maximum */ +#define MAX_KEY_LEN 64 +#define MAX_IV_LEN 16 +#define MAX_DATA_LEN 128 +#define MAX_AAD_LEN 12 +#define MAX_DIGEST_LEN 64 + +/* TDES-CBC */ +#define TDES_CBC_KEY_LEN 24 +#define TDES_CBC_IV_LEN 8 + +/* AES-CBC common */ +#define AES_CBC_IV_LEN 16 + +/* AES128-CBC */ +#define AES128_CBC_KEY_LEN 16 + +/* AES192-CBC */ +#define AES192_CBC_KEY_LEN 24 + +/* AES256-CBC */ +#define AES256_CBC_KEY_LEN 32 + +/* AES-CBC common */ +#define AES_CTR_IV_LEN 16 + +/* AES128-CTR */ +#define AES128_CTR_KEY_LEN 16 + +/* AES192-CTR */ +#define AES192_CTR_KEY_LEN 24 + +/* AES256-CTR */ +#define AES256_CTR_KEY_LEN 32 + +/* AES-GCM common */ +#define AES_GCM_IV_LEN 12 +#define AES_GCM_DIGEST_LEN 16 + +/* AES128-GCM */ +#define AES128_GCM_KEY_LEN 16 + +/* AES192-GCM */ +#define AES192_GCM_KEY_LEN 24 + +/* AES256-GCM */ +#define AES256_GCM_KEY_LEN 32 + +/* HMAC-MD5 */ +#define HMAC_MD5_KEY_LEN 16 +#define HMAC_MD5_96_CHECK_LEN 12 +#define HMAC_MD5_CHECK_LEN 16 + +/* HMAC-SHA256 */ +#define HMAC_SHA256_KEY_LEN 32 +#define HMAC_SHA256_128_CHECK_LEN 16 +#define HMAC_SHA256_CHECK_LEN 32 + +/* HMAC-SHA1 */ +#define HMAC_SHA1_KEY_LEN 20 +#define HMAC_SHA1_96_CHECK_LEN 12 +#define HMAC_SHA1_CHECK_LEN 20 + +/* HMAC-SHA512 */ +#define HMAC_SHA512_KEY_LEN 64 +#define HMAC_SHA512_256_CHECK_LEN 32 +#define HMAC_SHA512_CHECK_LEN 64 typedef struct crypto_test_reference_s { uint32_t cipher_key_length; diff --git a/test/validation/api/errno/errno.c b/test/validation/api/errno.c similarity index 100% rename from test/validation/api/errno/errno.c rename to test/validation/api/errno.c diff --git a/test/validation/api/errno/.gitignore b/test/validation/api/errno/.gitignore deleted file mode 100644 index 12256e38c..000000000 --- a/test/validation/api/errno/.gitignore +++ /dev/null @@ -1 +0,0 @@ -errno_main diff --git a/test/validation/api/errno/Makefile.am b/test/validation/api/errno/Makefile.am deleted file mode 100644 index de13afbfb..000000000 --- a/test/validation/api/errno/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = errno_main -errno_main_SOURCES = errno.c diff --git a/test/validation/api/event/event.c b/test/validation/api/event.c similarity index 100% rename from test/validation/api/event/event.c rename to test/validation/api/event.c diff --git a/test/validation/api/event/.gitignore b/test/validation/api/event/.gitignore deleted file mode 100644 index 05d34d7c8..000000000 --- a/test/validation/api/event/.gitignore +++ /dev/null @@ -1 +0,0 @@ -event_main diff --git a/test/validation/api/event/Makefile.am b/test/validation/api/event/Makefile.am deleted file mode 100644 index 0d26035ed..000000000 --- a/test/validation/api/event/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = event_main -event_main_SOURCES = event.c diff --git a/test/validation/api/hash/hash.c b/test/validation/api/hash.c similarity index 100% rename from test/validation/api/hash/hash.c rename to test/validation/api/hash.c diff --git a/test/validation/api/hash/.gitignore b/test/validation/api/hash/.gitignore deleted file mode 100644 index 6d0bc9314..000000000 --- a/test/validation/api/hash/.gitignore +++ /dev/null @@ -1 +0,0 @@ -hash_main diff --git a/test/validation/api/hash/Makefile.am b/test/validation/api/hash/Makefile.am deleted file mode 100644 index 0d843ea74..000000000 --- a/test/validation/api/hash/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = hash_main -hash_main_SOURCES = hash.c diff --git a/test/validation/api/init/.gitignore b/test/validation/api/init/.gitignore deleted file mode 100644 index f433708b0..000000000 --- a/test/validation/api/init/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -init_main_abort -init_main_log -init_main_ok diff --git a/test/validation/api/init/Makefile.am b/test/validation/api/init/Makefile.am deleted file mode 100644 index 5af2e00bc..000000000 --- a/test/validation/api/init/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -include ../Makefile.inc - -# most platforms are expected not to support multiple ODP inits -# following each other: therefore 3 separate binaries are -# created, each containing its ODP init test. -test_PROGRAMS = init_main_abort init_main_log init_main_ok -init_main_abort_SOURCES = init_main_abort.c -init_main_log_SOURCES = init_main_log.c -init_main_ok_SOURCES = init_main_ok.c diff --git a/test/validation/api/init/init_main_abort.c b/test/validation/api/init_main_abort.c similarity index 100% rename from test/validation/api/init/init_main_abort.c rename to test/validation/api/init_main_abort.c diff --git a/test/validation/api/init/init_main_log.c b/test/validation/api/init_main_log.c similarity index 100% rename from test/validation/api/init/init_main_log.c rename to test/validation/api/init_main_log.c diff --git a/test/validation/api/init/init_main_ok.c b/test/validation/api/init_main_ok.c similarity index 100% rename from test/validation/api/init/init_main_ok.c rename to test/validation/api/init_main_ok.c diff --git a/test/validation/api/ipsec/ipsec.c b/test/validation/api/ipsec.c similarity index 99% rename from test/validation/api/ipsec/ipsec.c rename to test/validation/api/ipsec.c index b16f84ac9..b4c5f9cba 100644 --- a/test/validation/api/ipsec/ipsec.c +++ b/test/validation/api/ipsec.c @@ -12,7 +12,7 @@ #include "ipsec.h" -#include "test_vectors.h" +#include "ipsec_test_vectors.h" struct suite_context_s suite_context; diff --git a/test/validation/api/ipsec/ipsec.h b/test/validation/api/ipsec.h similarity index 100% rename from test/validation/api/ipsec/ipsec.h rename to test/validation/api/ipsec.h diff --git a/test/validation/api/ipsec/ipsec_async.c b/test/validation/api/ipsec_async.c similarity index 100% rename from test/validation/api/ipsec/ipsec_async.c rename to test/validation/api/ipsec_async.c diff --git a/test/validation/api/ipsec/ipsec_inline_in.c b/test/validation/api/ipsec_inline_in.c similarity index 100% rename from test/validation/api/ipsec/ipsec_inline_in.c rename to test/validation/api/ipsec_inline_in.c diff --git a/test/validation/api/ipsec/ipsec_inline_out.c b/test/validation/api/ipsec_inline_out.c similarity index 100% rename from test/validation/api/ipsec/ipsec_inline_out.c rename to test/validation/api/ipsec_inline_out.c diff --git a/test/validation/api/ipsec/ipsec_sync.c b/test/validation/api/ipsec_sync.c similarity index 100% rename from test/validation/api/ipsec/ipsec_sync.c rename to test/validation/api/ipsec_sync.c diff --git a/test/validation/api/ipsec/ipsec_test_in.c b/test/validation/api/ipsec_test_in.c similarity index 99% rename from test/validation/api/ipsec/ipsec_test_in.c rename to test/validation/api/ipsec_test_in.c index 6262f4cb5..606a64428 100644 --- a/test/validation/api/ipsec/ipsec_test_in.c +++ b/test/validation/api/ipsec_test_in.c @@ -8,7 +8,7 @@ #include "ipsec.h" -#include "test_vectors.h" +#include "ipsec_test_vectors.h" static void test_in_ipv4_ah_sha256(void) { diff --git a/test/validation/api/ipsec/ipsec_test_out.c b/test/validation/api/ipsec_test_out.c similarity index 99% rename from test/validation/api/ipsec/ipsec_test_out.c rename to test/validation/api/ipsec_test_out.c index 4751e6ec8..29f09711f 100644 --- a/test/validation/api/ipsec/ipsec_test_out.c +++ b/test/validation/api/ipsec_test_out.c @@ -8,7 +8,7 @@ #include "ipsec.h" -#include "test_vectors.h" +#include "ipsec_test_vectors.h" static void test_out_ipv4_ah_sha256(void) { diff --git a/test/validation/api/ipsec/test_vectors.h b/test/validation/api/ipsec_test_vectors.h similarity index 100% rename from test/validation/api/ipsec/test_vectors.h rename to test/validation/api/ipsec_test_vectors.h diff --git a/test/validation/api/lock/lock.c b/test/validation/api/lock.c similarity index 100% rename from test/validation/api/lock/lock.c rename to test/validation/api/lock.c diff --git a/test/validation/api/lock/.gitignore b/test/validation/api/lock/.gitignore deleted file mode 100644 index ff16646f4..000000000 --- a/test/validation/api/lock/.gitignore +++ /dev/null @@ -1 +0,0 @@ -lock_main diff --git a/test/validation/api/lock/Makefile.am b/test/validation/api/lock/Makefile.am deleted file mode 100644 index ad75e1854..000000000 --- a/test/validation/api/lock/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = lock_main -lock_main_SOURCES = lock.c diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet.c similarity index 100% rename from test/validation/api/packet/packet.c rename to test/validation/api/packet.c diff --git a/test/validation/api/packet/.gitignore b/test/validation/api/packet/.gitignore deleted file mode 100644 index c05530d2d..000000000 --- a/test/validation/api/packet/.gitignore +++ /dev/null @@ -1 +0,0 @@ -packet_main diff --git a/test/validation/api/packet/Makefile.am b/test/validation/api/packet/Makefile.am deleted file mode 100644 index ad5775d7e..000000000 --- a/test/validation/api/packet/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = packet_main -packet_main_SOURCES = packet.c diff --git a/test/validation/api/pool/pool.c b/test/validation/api/pool.c similarity index 100% rename from test/validation/api/pool/pool.c rename to test/validation/api/pool.c diff --git a/test/validation/api/pool/.gitignore b/test/validation/api/pool/.gitignore deleted file mode 100644 index fc91b28d6..000000000 --- a/test/validation/api/pool/.gitignore +++ /dev/null @@ -1 +0,0 @@ -pool_main diff --git a/test/validation/api/pool/Makefile.am b/test/validation/api/pool/Makefile.am deleted file mode 100644 index 1b0d5934c..000000000 --- a/test/validation/api/pool/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = pool_main -pool_main_SOURCES = pool.c diff --git a/test/validation/api/queue/queue.c b/test/validation/api/queue.c similarity index 100% rename from test/validation/api/queue/queue.c rename to test/validation/api/queue.c diff --git a/test/validation/api/queue/.gitignore b/test/validation/api/queue/.gitignore deleted file mode 100644 index 469506a13..000000000 --- a/test/validation/api/queue/.gitignore +++ /dev/null @@ -1 +0,0 @@ -queue_main diff --git a/test/validation/api/queue/Makefile.am b/test/validation/api/queue/Makefile.am deleted file mode 100644 index 94a6b28a9..000000000 --- a/test/validation/api/queue/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = queue_main -queue_main_SOURCES = queue.c diff --git a/test/validation/api/random/random.c b/test/validation/api/random.c similarity index 100% rename from test/validation/api/random/random.c rename to test/validation/api/random.c diff --git a/test/validation/api/random/.gitignore b/test/validation/api/random/.gitignore deleted file mode 100644 index 2c88ec0b8..000000000 --- a/test/validation/api/random/.gitignore +++ /dev/null @@ -1 +0,0 @@ -random_main diff --git a/test/validation/api/random/Makefile.am b/test/validation/api/random/Makefile.am deleted file mode 100644 index e24ce0af7..000000000 --- a/test/validation/api/random/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = random_main -random_main_SOURCES = random.c diff --git a/test/validation/api/scheduler/scheduler.c b/test/validation/api/scheduler.c similarity index 100% rename from test/validation/api/scheduler/scheduler.c rename to test/validation/api/scheduler.c diff --git a/test/validation/api/scheduler/.gitignore b/test/validation/api/scheduler/.gitignore deleted file mode 100644 index b4eb30091..000000000 --- a/test/validation/api/scheduler/.gitignore +++ /dev/null @@ -1 +0,0 @@ -scheduler_main diff --git a/test/validation/api/scheduler/Makefile.am b/test/validation/api/scheduler/Makefile.am deleted file mode 100644 index 050f22308..000000000 --- a/test/validation/api/scheduler/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = scheduler_main -scheduler_main_SOURCES = scheduler.c diff --git a/test/validation/api/shmem/shmem.c b/test/validation/api/shmem.c similarity index 100% rename from test/validation/api/shmem/shmem.c rename to test/validation/api/shmem.c diff --git a/test/validation/api/shmem/.gitignore b/test/validation/api/shmem/.gitignore deleted file mode 100644 index 4d82fd53a..000000000 --- a/test/validation/api/shmem/.gitignore +++ /dev/null @@ -1 +0,0 @@ -shmem_main diff --git a/test/validation/api/shmem/Makefile.am b/test/validation/api/shmem/Makefile.am deleted file mode 100644 index 52e33fdca..000000000 --- a/test/validation/api/shmem/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = shmem_main -shmem_main_SOURCES = shmem.c diff --git a/test/validation/api/std_clib/std_clib.c b/test/validation/api/std_clib.c similarity index 100% rename from test/validation/api/std_clib/std_clib.c rename to test/validation/api/std_clib.c diff --git a/test/validation/api/std_clib/.gitignore b/test/validation/api/std_clib/.gitignore deleted file mode 100644 index 37828330a..000000000 --- a/test/validation/api/std_clib/.gitignore +++ /dev/null @@ -1 +0,0 @@ -std_clib_main diff --git a/test/validation/api/std_clib/Makefile.am b/test/validation/api/std_clib/Makefile.am deleted file mode 100644 index 9d3b32d3f..000000000 --- a/test/validation/api/std_clib/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = std_clib_main -std_clib_main_SOURCES = std_clib.c diff --git a/test/validation/api/system/system.c b/test/validation/api/system.c similarity index 100% rename from test/validation/api/system/system.c rename to test/validation/api/system.c diff --git a/test/validation/api/system/.gitignore b/test/validation/api/system/.gitignore deleted file mode 100644 index 347b1ee21..000000000 --- a/test/validation/api/system/.gitignore +++ /dev/null @@ -1 +0,0 @@ -system_main diff --git a/test/validation/api/system/Makefile.am b/test/validation/api/system/Makefile.am deleted file mode 100644 index 8090b0b5a..000000000 --- a/test/validation/api/system/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = system_main -system_main_SOURCES = system.c diff --git a/test/validation/api/thread/thread.c b/test/validation/api/thread.c similarity index 99% rename from test/validation/api/thread/thread.c rename to test/validation/api/thread.c index fe504e888..f45521766 100644 --- a/test/validation/api/thread/thread.c +++ b/test/validation/api/thread.c @@ -6,6 +6,7 @@ #include "config.h" +#define TEST_THRMASK #include #include #include diff --git a/test/validation/api/thread/.gitignore b/test/validation/api/thread/.gitignore deleted file mode 100644 index ab1787d97..000000000 --- a/test/validation/api/thread/.gitignore +++ /dev/null @@ -1 +0,0 @@ -thread_main diff --git a/test/validation/api/thread/Makefile.am b/test/validation/api/thread/Makefile.am deleted file mode 100644 index cbd8b2a7b..000000000 --- a/test/validation/api/thread/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = thread_main -thread_main_CPPFLAGS = $(AM_CPPFLAGS) -DTEST_THRMASK -thread_main_SOURCES = thread.c -LDADD += $(LIBTHRMASK_COMMON) diff --git a/test/validation/api/time/time.c b/test/validation/api/time.c similarity index 100% rename from test/validation/api/time/time.c rename to test/validation/api/time.c diff --git a/test/validation/api/time/.gitignore b/test/validation/api/time/.gitignore deleted file mode 100644 index 0ef3e6162..000000000 --- a/test/validation/api/time/.gitignore +++ /dev/null @@ -1 +0,0 @@ -time_main diff --git a/test/validation/api/time/Makefile.am b/test/validation/api/time/Makefile.am deleted file mode 100644 index 9b0392eb9..000000000 --- a/test/validation/api/time/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = time_main -time_main_SOURCES = time.c diff --git a/test/validation/api/timer/timer.c b/test/validation/api/timer.c similarity index 100% rename from test/validation/api/timer/timer.c rename to test/validation/api/timer.c diff --git a/test/validation/api/timer/.gitignore b/test/validation/api/timer/.gitignore deleted file mode 100644 index 74e8fa992..000000000 --- a/test/validation/api/timer/.gitignore +++ /dev/null @@ -1 +0,0 @@ -timer_main diff --git a/test/validation/api/timer/Makefile.am b/test/validation/api/timer/Makefile.am deleted file mode 100644 index bc33e731f..000000000 --- a/test/validation/api/timer/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = timer_main -timer_main_SOURCES = timer.c From patchwork Thu Feb 22 09:00:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 129168 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp375716lja; Thu, 22 Feb 2018 01:07:09 -0800 (PST) X-Google-Smtp-Source: AH8x227rLjCgOdK8vRScyKA4E0YA57UDFQ6hqSoxUOkOKgdvYHaXuvuVFrV4ksp1GugBdWzcHeSu X-Received: by 10.55.17.196 with SMTP id 65mr9225896qkr.86.1519290429028; Thu, 22 Feb 2018 01:07:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519290429; cv=none; d=google.com; s=arc-20160816; b=DK1xc0MFfyyPPx/lpfzujcNb6F0+BplB4HTcBTo3oAkaaz2DmREvTuBbZXq1unodOh LbJdJHkImIu1YtlRcRXHM7V4oA/2IUFLSKnjZ8Us0qOd9Q33YV0NHPqM/gHGLFa2sCIZ Cb8TdxbrJY9TbHOhM/GjUJbR3nuaA69yp152RiHOLxlWUW05jWNKYkmewud6uqQx9ET6 DdvzAM3WIVDc85U4hPrc2RTExm6z35AVHozrAOosfd1Cf9wvJvnEImlOPsOwJP2KAndW KwG9F+oed6eUnazx37HQtX7kd6XjXGkl1/GW8zyRCqbvKNi+7jFFFeHZaJXlneiODiPi ctMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=Sx7EhqH9ODz1VooKp4WKpOBtCHv5XtqthbwapjO8Dtk=; b=cPJz4q9C12EAzz2KsGVgTpkh6VVLYvHkV/4Fgo0BXwEjK/g2TKwOMDTF5AhZth+4qj hFcIHLD/JUnzGjtlbS4dp3xY4NmsP/A+94QhQzHkgH093JgXTKJqq85zQ7zfiovN0+LE 73t6Te/Eck/mIHkh3gFkkWKszxS+utlTQnHLJUEN0MfjPtnYYJgsbuOccJqAbPNOn3FA 1TBtsupe5QUJ4r82vSke0lV1UmlgwcOXVkCdP7Ewx7HCuMyC2UyQVMcTAm91YVrcfwXV KqgXE4Iwd2nzkH4uvXrxeYQvUa2zuCmyFHf51C2b5NJt6yR8FGmmiES5f8eoRmGxN7KO je8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id z9si869562qtb.137.2018.02.22.01.07.08; Thu, 22 Feb 2018 01:07:09 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 9F6756175B; Thu, 22 Feb 2018 09:07:08 +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,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW 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 6147E61760; Thu, 22 Feb 2018 09:03:52 +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 DE64861727; Thu, 22 Feb 2018 09:03:42 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 4AE5D61776 for ; Thu, 22 Feb 2018 09:02:01 +0000 (UTC) Received: from mxback9o.mail.yandex.net (mxback9o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::23]) by forward102p.mail.yandex.net (Yandex) with ESMTP id 4B97743046B6 for ; Thu, 22 Feb 2018 12:00:19 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback9o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id yZOJwISXCO-0JNmebwu; Thu, 22 Feb 2018 12:00:19 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Qk3Eeopztj-0IHOLugM; Thu, 22 Feb 2018 12:00:18 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 22 Feb 2018 12:00:09 +0300 Message-Id: <1519290010-13383-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519290010-13383-1-git-send-email-odpbot@yandex.ru> References: <1519290010-13383-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 496 Subject: [lng-odp] [PATCH v1 6/7] validation: move traffic_mngr test to api/ dir 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" From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 496 (lumag:tests-fix-2) ** https://github.com/Linaro/odp/pull/496 ** Patch: https://github.com/Linaro/odp/pull/496.patch ** Base sha: 5a58bbf2bb331fd7dde2ebbc0430634ace6900fb ** Merge commit sha: 2ca48deb89c7ac000bd44a1da037c36de66720cb **/ test/m4/configure.m4 | 3 +-- test/validation/api/.gitignore | 1 + test/validation/api/Makefile.am | 14 ++++++++++---- test/validation/api/{traffic_mngr => }/traffic_mngr.c | 0 test/validation/api/{traffic_mngr => }/traffic_mngr.sh | 4 ++-- test/validation/api/traffic_mngr/.gitignore | 1 - test/validation/api/traffic_mngr/Makefile.am | 10 ---------- 7 files changed, 14 insertions(+), 19 deletions(-) rename test/validation/api/{traffic_mngr => }/traffic_mngr.c (100%) rename test/validation/api/{traffic_mngr => }/traffic_mngr.sh (90%) delete mode 100644 test/validation/api/traffic_mngr/.gitignore delete mode 100644 test/validation/api/traffic_mngr/Makefile.am diff --git a/test/m4/configure.m4 b/test/m4/configure.m4 index 5a0b4d685..18c71d799 100644 --- a/test/m4/configure.m4 +++ b/test/m4/configure.m4 @@ -8,5 +8,4 @@ AC_CONFIG_FILES([test/Makefile test/performance/Makefile test/validation/Makefile test/validation/api/Makefile - test/validation/api/pktio/Makefile - test/validation/api/traffic_mngr/Makefile]) + test/validation/api/pktio/Makefile]) diff --git a/test/validation/api/.gitignore b/test/validation/api/.gitignore index 6fb6ee62e..f6bf6e54b 100644 --- a/test/validation/api/.gitignore +++ b/test/validation/api/.gitignore @@ -30,3 +30,4 @@ system_main thread_main time_main timer_main +traffic_mngr_main diff --git a/test/validation/api/Makefile.am b/test/validation/api/Makefile.am index bc3a429d2..b45828c54 100644 --- a/test/validation/api/Makefile.am +++ b/test/validation/api/Makefile.am @@ -1,6 +1,5 @@ ODP_MODULES = \ - pktio \ - traffic_mngr + pktio SUBDIRS = $(ODP_MODULES) @@ -35,7 +34,8 @@ test_PROGRAMS = \ system_main \ thread_main \ time_main \ - timer_main + timer_main \ + traffic_mngr_main noinst_LTLIBRARIES = libtestipsec.la libtestipsec_la_SOURCES = \ @@ -79,6 +79,11 @@ thread_main_SOURCES = thread.c thread_main_LDADD = $(LDADD) $(LIBTHRMASK_COMMON) time_main_SOURCES = time.c timer_main_SOURCES = timer.c +traffic_mngr_main_SOURCES = traffic_mngr.c +traffic_mngr_main_LDADD = $(LDADD) -lm + +dist_check_SCRIPTS = traffic_mngr.sh +test_SCRIPTS = $(dist_check_SCRIPTS) classification_main_SOURCES = \ classification_basic.c \ @@ -90,6 +95,7 @@ classification_main_SOURCES = \ classification.h TESTS_ENVIRONMENT += TEST_DIR=${top_builddir}/test/validation +TEST_EXTENSIONS = .sh TESTS = \ atomic_main$(EXEEXT) \ @@ -121,7 +127,7 @@ TESTS = \ thread_main$(EXEEXT) \ time_main$(EXEEXT) \ timer_main$(EXEEXT) \ - traffic_mngr/traffic_mngr.sh + traffic_mngr.sh TESTNAME = validation diff --git a/test/validation/api/traffic_mngr/traffic_mngr.c b/test/validation/api/traffic_mngr.c similarity index 100% rename from test/validation/api/traffic_mngr/traffic_mngr.c rename to test/validation/api/traffic_mngr.c diff --git a/test/validation/api/traffic_mngr/traffic_mngr.sh b/test/validation/api/traffic_mngr.sh similarity index 90% rename from test/validation/api/traffic_mngr/traffic_mngr.sh rename to test/validation/api/traffic_mngr.sh index c88aa805c..0b5f3a03b 100755 --- a/test/validation/api/traffic_mngr/traffic_mngr.sh +++ b/test/validation/api/traffic_mngr.sh @@ -12,8 +12,8 @@ # -in the validation when running standalone (./traffic_mngr) intree. # -in the current directory. # running stand alone out of tree requires setting PATH -PATH=${TEST_DIR}/api/traffic_mngr:$PATH -PATH=$(dirname $0)/../../../../validation/api/traffic_mngr:$PATH +PATH=${TEST_DIR}/api:$PATH +PATH=$(dirname $0)/../../../../validation/api:$PATH PATH=$(dirname $0):$PATH PATH=`pwd`:$PATH diff --git a/test/validation/api/traffic_mngr/.gitignore b/test/validation/api/traffic_mngr/.gitignore deleted file mode 100644 index efd07a27d..000000000 --- a/test/validation/api/traffic_mngr/.gitignore +++ /dev/null @@ -1 +0,0 @@ -traffic_mngr_main diff --git a/test/validation/api/traffic_mngr/Makefile.am b/test/validation/api/traffic_mngr/Makefile.am deleted file mode 100644 index a9b8550d7..000000000 --- a/test/validation/api/traffic_mngr/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -include ../Makefile.inc - -TESTS_ENVIRONMENT += TEST_DIR=${builddir} - -test_PROGRAMS = traffic_mngr_main -traffic_mngr_main_SOURCES = traffic_mngr.c -LDADD += -lm - -dist_check_SCRIPTS = traffic_mngr.sh -test_SCRIPTS = $(dist_check_SCRIPTS) From patchwork Thu Feb 22 09:00:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 129166 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp372893lja; Thu, 22 Feb 2018 01:04:03 -0800 (PST) X-Google-Smtp-Source: AH8x225hco0EEynNe/1cW6bn01OT3t/l2KZfxw9NNELFrhHOcMWqXprwI8veA8Ul+LhLUZMLv5pY X-Received: by 10.55.19.35 with SMTP id d35mr9459800qkh.292.1519290243532; Thu, 22 Feb 2018 01:04:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519290243; cv=none; d=google.com; s=arc-20160816; b=x9wd0pkydpsDJTcIYOACOD00I0k9vidk+RE4y3+7X2/jutUe5ReCWyrte1IXYhN/6W F4SoVTb8o0wrByoWqtYN3nEr2OTUrGZW4reBeqmVCSguw3C5ilm01NRyGkXhrqR1fXar 41st0p3j83xJusYPogM9wZcfHFu7BBdtmVyszVeW8UYfgNfv2YMDAcg9nBnzpj+m2fAU 0KGQo6AVGwRZnudaQAhYibdCiXqh1+NNiB2JeCCMIbqGEYq4fnWii6kDpRt3ZEBrYSAg M+ND0NAuCeARNfRDLPyMGNWWH6Qo+hAyEyT9C8HE8aERlAdh9FhOWjl6Wtjc5D1yi41Z mnYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=8nz6LMUYcnrG3C6u8zP1RNcLDYD9pEIhujBe0ijHis4=; b=t/8En6NqGnFUq5dPR/VzKHT/BP6KiEv5alII/sDDNFVvT4Qertsx7qd8Bl9iSQOjUZ TcWHn/2/CN0Db2h6LuuEXRBkgoG6AZZRSCTXpFzM7Tc9q4LwSCx4FrunorqulOLsa5rj hFSYnHZT9OQfCmo/wrjG4I4cxR2Rh5YBvtEcSr7uLE9xwCI1Ld9gaDyZGbcHtKkKVSaX PJ87ZkiafT1VZ3C97+Ya1Y/LQt4IIWElmrGvs9Efc5Gve4dP3xmT65fYEaQoNKjdltxc w1H3F9KFv6SPl+BB/PyYXsLmRDml9HQloDMIgsG9j99LiCPaCbIKDDPilNaW32Bq/re8 Xr1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id b10si731094qti.210.2018.02.22.01.04.03; Thu, 22 Feb 2018 01:04:03 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 393C56176B; Thu, 22 Feb 2018 09:04:03 +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,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW 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 198AF6171C; Thu, 22 Feb 2018 09:00:47 +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 6168961700; Thu, 22 Feb 2018 09:00:26 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id A3FCA60B06 for ; Thu, 22 Feb 2018 09:00:21 +0000 (UTC) Received: from mxback11g.mail.yandex.net (mxback11g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:90]) by forward102o.mail.yandex.net (Yandex) with ESMTP id 1C1CF5A04908 for ; Thu, 22 Feb 2018 12:00:20 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback11g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id RYP1PVPXAI-0KnuCx95; Thu, 22 Feb 2018 12:00:20 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Qk3Eeopztj-0JHOOLHd; Thu, 22 Feb 2018 12:00:19 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 22 Feb 2018 12:00:10 +0300 Message-Id: <1519290010-13383-8-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519290010-13383-1-git-send-email-odpbot@yandex.ru> References: <1519290010-13383-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 496 Subject: [lng-odp] [PATCH v1 7/7] validation: move pktio test to api/ dir 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" From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 496 (lumag:tests-fix-2) ** https://github.com/Linaro/odp/pull/496 ** Patch: https://github.com/Linaro/odp/pull/496.patch ** Base sha: 5a58bbf2bb331fd7dde2ebbc0430634ace6900fb ** Merge commit sha: 2ca48deb89c7ac000bd44a1da037c36de66720cb **/ platform/linux-generic/test/validation/api/pktio/pktio_run.sh | 4 ++-- platform/linux-generic/test/validation/api/pktio/pktio_run_dpdk.sh | 4 ++-- platform/linux-generic/test/validation/api/pktio/pktio_run_netmap.sh | 4 ++-- platform/linux-generic/test/validation/api/pktio/pktio_run_pcap.sh | 4 ++-- test/m4/configure.m4 | 3 +-- test/validation/api/.gitignore | 1 + test/validation/api/Makefile.am | 5 ++--- test/validation/api/{pktio => }/pktio.c | 2 +- test/validation/api/pktio/.gitignore | 1 - test/validation/api/pktio/Makefile.am | 4 ---- test/validation/api/{pktio/parser.c => pktio_parser.c} | 2 +- test/validation/api/{pktio/parser.h => pktio_parser.h} | 0 12 files changed, 14 insertions(+), 20 deletions(-) rename test/validation/api/{pktio => }/pktio.c (99%) delete mode 100644 test/validation/api/pktio/.gitignore delete mode 100644 test/validation/api/pktio/Makefile.am rename test/validation/api/{pktio/parser.c => pktio_parser.c} (99%) rename test/validation/api/{pktio/parser.h => pktio_parser.h} (100%) diff --git a/platform/linux-generic/test/validation/api/pktio/pktio_run.sh b/platform/linux-generic/test/validation/api/pktio/pktio_run.sh index 5b861bbbf..76c12b901 100755 --- a/platform/linux-generic/test/validation/api/pktio/pktio_run.sh +++ b/platform/linux-generic/test/validation/api/pktio/pktio_run.sh @@ -21,9 +21,9 @@ # -in the validation when running standalone (./pktio_run) intree. # -in the current directory. # running stand alone out of tree requires setting PATH -PATH=${TEST_DIR}/api/pktio:$PATH +PATH=${TEST_DIR}/api:$PATH PATH=$(dirname $0):$PATH -PATH=$(dirname $0)/../../../../../../test/validation/api/pktio:$PATH +PATH=$(dirname $0)/../../../../../../test/validation/api:$PATH PATH=.:$PATH pktio_main_path=$(which pktio_main${EXEEXT}) diff --git a/platform/linux-generic/test/validation/api/pktio/pktio_run_dpdk.sh b/platform/linux-generic/test/validation/api/pktio/pktio_run_dpdk.sh index 24194cbc9..730cdbca1 100755 --- a/platform/linux-generic/test/validation/api/pktio/pktio_run_dpdk.sh +++ b/platform/linux-generic/test/validation/api/pktio/pktio_run_dpdk.sh @@ -21,9 +21,9 @@ # -in the validation when running standalone (./pktio_run) intree. # -in the current directory. # running stand alone out of tree requires setting PATH -PATH=${TEST_DIR}/api/pktio:$PATH +PATH=${TEST_DIR}/api:$PATH PATH=$(dirname $0):$PATH -PATH=$(dirname $0)/../../../../../../test/validation/api/pktio:$PATH +PATH=$(dirname $0)/../../../../../../test/validation/api:$PATH PATH=.:$PATH pktio_main_path=$(which pktio_main${EXEEXT}) diff --git a/platform/linux-generic/test/validation/api/pktio/pktio_run_netmap.sh b/platform/linux-generic/test/validation/api/pktio/pktio_run_netmap.sh index 610be3bdc..e0a19caea 100755 --- a/platform/linux-generic/test/validation/api/pktio/pktio_run_netmap.sh +++ b/platform/linux-generic/test/validation/api/pktio/pktio_run_netmap.sh @@ -15,9 +15,9 @@ # -in the validation when running standalone (./pktio_run) intree. # -in the current directory. # running stand alone out of tree requires setting PATH -PATH=${TEST_DIR}/api/pktio:$PATH +PATH=${TEST_DIR}/api:$PATH PATH=$(dirname $0):$PATH -PATH=$(dirname $0)/../../../../../../test/validation/api/pktio:$PATH +PATH=$(dirname $0)/../../../../../../test/validation/api:$PATH PATH=.:$PATH pktio_main_path=$(which pktio_main${EXEEXT}) diff --git a/platform/linux-generic/test/validation/api/pktio/pktio_run_pcap.sh b/platform/linux-generic/test/validation/api/pktio/pktio_run_pcap.sh index 5ab45094a..247854796 100755 --- a/platform/linux-generic/test/validation/api/pktio/pktio_run_pcap.sh +++ b/platform/linux-generic/test/validation/api/pktio/pktio_run_pcap.sh @@ -15,9 +15,9 @@ # -in the validation when running standalone intree. # -in the current directory. # running stand alone out of tree requires setting PATH -PATH=${TEST_DIR}/api/pktio:$PATH +PATH=${TEST_DIR}/api:$PATH PATH=$(dirname $0):$PATH -PATH=$(dirname $0)/../../../../../../test/validation/api/pktio:$PATH +PATH=$(dirname $0)/../../../../../../test/validation/api:$PATH PATH=.:$PATH pktio_main_path=$(which pktio_main${EXEEXT}) diff --git a/test/m4/configure.m4 b/test/m4/configure.m4 index 18c71d799..52e9317d5 100644 --- a/test/m4/configure.m4 +++ b/test/m4/configure.m4 @@ -7,5 +7,4 @@ AC_CONFIG_FILES([test/Makefile test/miscellaneous/Makefile test/performance/Makefile test/validation/Makefile - test/validation/api/Makefile - test/validation/api/pktio/Makefile]) + test/validation/api/Makefile]) diff --git a/test/validation/api/.gitignore b/test/validation/api/.gitignore index f6bf6e54b..50a76a3b9 100644 --- a/test/validation/api/.gitignore +++ b/test/validation/api/.gitignore @@ -20,6 +20,7 @@ ipsec_inline_out ipsec_sync lock_main packet_main +pktio_main pool_main queue_main random_main diff --git a/test/validation/api/Makefile.am b/test/validation/api/Makefile.am index b45828c54..48a78c16e 100644 --- a/test/validation/api/Makefile.am +++ b/test/validation/api/Makefile.am @@ -1,6 +1,3 @@ -ODP_MODULES = \ - pktio - SUBDIRS = $(ODP_MODULES) include Makefile.inc @@ -25,6 +22,7 @@ test_PROGRAMS = \ ipsec_sync \ lock_main \ packet_main \ + pktio_main \ pool_main \ queue_main \ random_main \ @@ -68,6 +66,7 @@ ipsec_inline_out_SOURCES = ipsec_inline_out.c ipsec_inline_out_LDADD = $(LDADD) libtestipsec.la lock_main_SOURCES = lock.c packet_main_SOURCES = packet.c +pktio_main_SOURCES = pktio.c pktio_parser.c pktio_parser.h pool_main_SOURCES = pool.c queue_main_SOURCES = queue.c random_main_SOURCES = random.c diff --git a/test/validation/api/pktio/pktio.c b/test/validation/api/pktio.c similarity index 99% rename from test/validation/api/pktio/pktio.c rename to test/validation/api/pktio.c index a0496642f..3516d6f4a 100644 --- a/test/validation/api/pktio/pktio.c +++ b/test/validation/api/pktio.c @@ -12,7 +12,7 @@ #include #include -#include "parser.h" +#include "pktio_parser.h" #define PKT_BUF_NUM 32 #define PKT_BUF_SIZE (9 * 1024) diff --git a/test/validation/api/pktio/.gitignore b/test/validation/api/pktio/.gitignore deleted file mode 100644 index 1a5dd46e4..000000000 --- a/test/validation/api/pktio/.gitignore +++ /dev/null @@ -1 +0,0 @@ -pktio_main diff --git a/test/validation/api/pktio/Makefile.am b/test/validation/api/pktio/Makefile.am deleted file mode 100644 index ffd1827be..000000000 --- a/test/validation/api/pktio/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -include ../Makefile.inc - -test_PROGRAMS = pktio_main -pktio_main_SOURCES = pktio.c parser.c parser.h diff --git a/test/validation/api/pktio/parser.c b/test/validation/api/pktio_parser.c similarity index 99% rename from test/validation/api/pktio/parser.c rename to test/validation/api/pktio_parser.c index e0431441f..a998981e0 100644 --- a/test/validation/api/pktio/parser.c +++ b/test/validation/api/pktio_parser.c @@ -13,7 +13,7 @@ #include #include -#include "parser.h" +#include "pktio_parser.h" #define MAX_NUM_IFACES 2 #define PKT_POOL_NUM 256 diff --git a/test/validation/api/pktio/parser.h b/test/validation/api/pktio_parser.h similarity index 100% rename from test/validation/api/pktio/parser.h rename to test/validation/api/pktio_parser.h