From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0074.outbound.protection.outlook.com [104.47.41.74]) by dpdk.org (Postfix) with ESMTP id 90A7E7CDC for ; Sun, 28 May 2017 22:00:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=MRaj84WqlhvdJRYwK7N2equhafQV5pjcbsgUNUK5BYU=; b=c7EfKIoYXMW0WEOl2a3jJ1YJOGe6SSqrwr7OQXbQdtUFCmuTGKsZJ5lqE39GirjKYAbdEcmFQV0snwuDRaUCd97VmOObzA559l7rHKdqKF+Q7yW7c0iUVXP9Al/YoKsoLYapedHJY+2094U8zkNowdo6B6zY7aZCIXQDINjytzk= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from jerin.domain.name (111.93.218.67) by CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Sun, 28 May 2017 20:00:45 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: bruce.richardson@intel.com, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, gage.eads@intel.com, nipun.gupta@nxp.com, narender.vangati@intel.com, nikhil.rao@intel.com, gprathyusha@caviumnetworks.com, Jerin Jacob Date: Mon, 29 May 2017 01:28:33 +0530 Message-Id: <20170528195854.6064-13-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170528195854.6064-1-jerin.jacob@caviumnetworks.com> References: <20170528195854.6064-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BMXPR01CA0003.INDPRD01.PROD.OUTLOOK.COM (10.174.214.141) To CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY1PR0701MB1725: X-MS-Office365-Filtering-Correlation-Id: 53330500-f636-4642-2368-08d4a6043cd6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 3:qVypBqLrGXV/Aq1q6SaXZ9TznMVRWfoAeOEdOUtOkY2khb4Xri7ouHB00QVFcFGyuyQsMYC/1Eq4tuyCP4S6NnzWExr1bS8vh9FTQI+qUYso45jMYsVDLQdSDodR/mDezudEMjWo+O6l5f34iXS7PuUtKYXqJxzBB/U6bM7mYhoATpAE2ynwwkkc8mXskVlAvNFmS/q2C1v0IIbXpIR6sMyn/CpLsl6MH+KotO9PgXzC5u0sz135JN7oHsYZaYazF9cxvn0/GFUynbRSOBxq+7PiZwnSt9N9wFVZlSaBzqZCnwZEY5xNC7A9B5Z6CRNIrweRzcbMpR6PaXJxV5MdiQ==; 25:1WnEfV1wi8+QEGXFtBDWAsD2fj6bn+sR+uJe7zzezVIKnhaBQpVgD9+UpKptWrs0gXknbdV210zD9g/Mkaw5MnotrcZh50Mm3pmZpV8c2cC6W7F33YPAIy0tqDpr6wq/iL9nM6nbYAtp+oNSMUS/xCmRFRpYQ/FlzVmhS17HiTNpsMAW3npHoqpmmNq+mRR9g3Ig6iFxvEKEBW1q/SzUMErT6lR5heiKXh8UCCDPZVEt59vUNc8ajV3qggKr6qmurFujrNBeabqtEAVTWJtsLIdPHeexwQ2dbkCg5G7wnM2fjPg5FCZie5KVd4bX+p+4m35d0VK8umEi36lgJH3CylJqKIBLNYD+nsevN69exEAEzvWKNAM6pz1nR3JkWOEIvpB9fKuwBkJ2/dhIqcsgbsUxBmicTqeD+An75A1BjMiB42d0LnFhX6BUpUzlU2vYm9e4JPsaDyA8hGgQVJyUrtGAR9zx9gqAx2yR4k8uYGk= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 31:LzPtjBYXAHlidhJTUdsUVOtXXT91Tequ3i8sQQfX3D3bgGTvUs85a5ZrxvjmgjPyrLGXVskPZMDfx5PHAGvkFTjmESGQmcRSi/oMQOk3QtiAKN70LcK17+2cxPn6JJCZ1eYX8w1pHrjGoNNaaMidrlG8DPR5+NcjtRZkGphgmo9Pk2o1bCam5nQM6RC7NjbG1FxuqRHMKk8RfOWo9+YtuEpbV2uzgulc1LfmtOk1xcA=; 20:LXmknUZKaxPQLWvnLY4Y3avMmPocz1KAwSfq4+K7cLf5LD1ApqSeRPeWmgnC+og2rfP5yD/DqiWrLbZG4BlqCvbLNSO5SBSiDQywNQgq61ismh/8SoEnd2POC1IYcLA9rPFsjMzyKkincMFT9q8/P2eJihnDMHjBxclD7MM0kXM3KCVghC7LKR+dbKRex2P1xZczNLVmKovxxy121IF+Q1RrXJoih0L2AjhihwwByozWwxdXeLBNBsGZU2nJLJKcEOGCwgSnUHASb85HLxZHANlDuvDKh+Jme20rIPpeaRoQg8hPefIJ6/HIXfaqvANjhcvouUmdGsrH4P+wdHm2D0odAcGOZdFFpOXj8cI332pP81lMPzLWsi34sfib19K9jaD5F/8jlV+T/T2mslAwd+P6LvsVfjfiGTSoH5rGxWJ3RnXf5Ds4+u9gRqkAj/j8c2Tu1pfH6+qqIaQ8fRFk7RS+XS+x2FSO7FuCKVyCMbOzWK4YLvWxpN276kR60TTnoPtKSu9koOQdFdQJahwgYLBz02Zxl1SKAGhhz65iZv5RQt0OCmAc3ycM9Etxy2cLp+VfX46KAs8QsJZaTVlGTIZmtjCgh6DFmNcG1OFiXig= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700073)(100105000095)(100000701073)(100105300095)(100000702073)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(100000703073)(100105400095)(6041248)(20161123562025)(20161123555025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(100000704073)(100105200095)(100000705073)(100105500095); SRVR:CY1PR0701MB1725; BCL:0; PCL:0; RULEID:(100000800073)(100110000095)(100000801073)(100110300095)(100000802073)(100110100095)(100000803073)(100110400095)(100000804073)(100110200095)(100000805073)(100110500095); SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1725; 4:agpR/voAHawBydnESVBqxoDcfq+4WbF8ptPnXlRn?= =?us-ascii?Q?gf6K72Kphp3nqjjzEk2vS3nltVQavV8uVXO1BL6HAMlPiChBy+fhoIyJN5xy?= =?us-ascii?Q?ajOFPczdXQzlGUQRh4bVVlvi5POXIml4UFBWJC1xbOIEmqDZsNAKAHUF2TuE?= =?us-ascii?Q?GaCU6Ezum6JcTaYxDf/vehBsqrOy/fG2ox2/ERdfavVrvoEShrPzej8a3nM1?= =?us-ascii?Q?ngpOrNIl6JIveHBdaFmG5Kwjl6yhg8uHDdG1jiOKDE0HwKIyCvaqHKoWEM5G?= =?us-ascii?Q?SFaPoTZsv6uw9YL3kqwIjEWkDWYscDRdgV85tHdxIx7n5xDdBiTY7D9xrXix?= =?us-ascii?Q?zr+rRlEiW6sAJQkjuhJPof15K6isYo2HwLi3lzSf5abdUszREXqU28fezAxg?= =?us-ascii?Q?QOINYQlIjalCWYlVRHTYJ44oL35Fnj5m5PbRoj7Gc3vxVzLJE1LxltQ4b9XG?= =?us-ascii?Q?SoH1etzvxvth0B6oDxN6xPJeWwjf5EEod13hu6r+EuGBEaLi0psnXy+D6KE+?= =?us-ascii?Q?V+C63v9YdUV7xiVMKj9B7avMok5gAX+OhIS3wSdfIdflq+8l23FtwMSEWDGq?= =?us-ascii?Q?p6RoUHHd2hRoxUiChbP38kVGbEM95uryqA04d3sJtEM7WtXEyiU6VO1Rdq4E?= =?us-ascii?Q?/RdONI9aZgyj8WQci/Y1HzIClHvmAhS4jEU6y3OVeqDz5HKrTHr2ouvrYIXO?= =?us-ascii?Q?eEovP3CeQfYbIvTUlXr1PWNPK/OBCxbICr85PgpNrENACrtMUc6q3AoMrc7O?= =?us-ascii?Q?aCBcanZAUeajlv5Dkd+JW4EnDBwor/AFMONH1dxjYTAW+BSPirNP00y2KB4A?= =?us-ascii?Q?gSE8XIfTj2z1n7g3Kx+5k+VMlTyrw0lRoj4Uxq37aYXmzkQQtTx0Dijj2ZFR?= =?us-ascii?Q?3dLwIYMqSYqqBKDPf6JpC6Cg4WozqJtmAymuugjf8YM4LKYV2n6YNkVSDO7u?= =?us-ascii?Q?JVIPuF/9OL1oDdFodQXK+Yod3xsU4t2qRExxyepJYcPU9W3kebOqFt6WvQgL?= =?us-ascii?Q?NHu6uLP8XhDJuEO1HAA6c5AMQYlrGJrJTbVoD/GYQh8OaALgm3HMQe8vv+wV?= =?us-ascii?Q?XSRhsIggY86IR0nGJ1zYd1t8YZizjwuM1ys5ClLFCuAeP0Mvud18x1XgRztt?= =?us-ascii?Q?Ruoi+061SQ4=3D?= X-Forefront-PRVS: 03218BFD9F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39850400002)(39410400002)(39840400002)(39400400002)(81166006)(6486002)(66066001)(4326008)(50986999)(76176999)(50226002)(189998001)(72206003)(36756003)(6506006)(38730400002)(5003940100001)(5009440100003)(110136004)(107886003)(42186005)(53416004)(7736002)(8676002)(48376002)(50466002)(1076002)(3846002)(6116002)(575784001)(6512007)(2361001)(305945005)(2906002)(6666003)(478600001)(25786009)(5660300001)(2351001)(6916009)(42882006)(2950100002)(33646002)(8656002)(47776003)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1725; H:jerin.domain.name; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-asc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viumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2017 20:00:45.8228 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1725 Subject: [dpdk-dev] [PATCH 12/33] app/testeventdev: order: add test setup and destroy X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 20:00:51 -0000 order test has the queue and all types queue variants.Introduce test_order_common* to share the common code between those tests. Signed-off-by: Jerin Jacob --- app/test-eventdev/Makefile | 2 + app/test-eventdev/test_order_common.c | 92 +++++++++++++++++++++++++++++++++++ app/test-eventdev/test_order_common.h | 90 ++++++++++++++++++++++++++++++++++ 3 files changed, 184 insertions(+) create mode 100644 app/test-eventdev/test_order_common.c create mode 100644 app/test-eventdev/test_order_common.h diff --git a/app/test-eventdev/Makefile b/app/test-eventdev/Makefile index 168e56416..acbf74ca6 100644 --- a/app/test-eventdev/Makefile +++ b/app/test-eventdev/Makefile @@ -43,4 +43,6 @@ SRCS-y += evt_options.c SRCS-y += evt_test.c SRCS-y += parser.c +SRCS-y += test_order_common.c + include $(RTE_SDK)/mk/rte.app.mk diff --git a/app/test-eventdev/test_order_common.c b/app/test-eventdev/test_order_common.c new file mode 100644 index 000000000..b8ba8a0d1 --- /dev/null +++ b/app/test-eventdev/test_order_common.c @@ -0,0 +1,92 @@ +/* + * BSD LICENSE + * + * Copyright (C) Cavium 2017. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Cavium networks nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "test_order_common.h" + +int +order_test_setup(struct evt_test *test, struct evt_options *opt) +{ + void *test_order; + + test_order = rte_zmalloc_socket(test->name, sizeof(struct test_order), + RTE_CACHE_LINE_SIZE, opt->socket_id); + if (test_order == NULL) { + evt_err("failed to allocate test_order memory"); + goto nomem; + } + test->test_priv = test_order; + + struct test_order *t = evt_test_priv(test); + + t->producer_flow_seq = rte_zmalloc_socket("test_producer_flow_seq", + sizeof(*t->producer_flow_seq) * opt->nb_flows, + RTE_CACHE_LINE_SIZE, opt->socket_id); + + if (t->producer_flow_seq == NULL) { + evt_err("failed to allocate t->producer_flow_seq memory"); + goto prod_nomem; + } + + t->expected_flow_seq = rte_zmalloc_socket("test_expected_flow_seq", + sizeof(*t->expected_flow_seq) * opt->nb_flows, + RTE_CACHE_LINE_SIZE, opt->socket_id); + + if (t->expected_flow_seq == NULL) { + evt_err("failed to allocate t->expected_flow_seq memory"); + goto exp_nomem; + } + rte_atomic64_set(&t->outstand_pkts, opt->nb_pkts); + t->err = false; + t->nb_pkts = opt->nb_pkts; + t->nb_flows = opt->nb_flows; + t->result = EVT_TEST_FAILED; + t->opt = opt; + return 0; + +exp_nomem: + rte_free(t->producer_flow_seq); +prod_nomem: + rte_free(test->test_priv); +nomem: + return -ENOMEM; +} + +void +order_test_destroy(struct evt_test *test, struct evt_options *opt) +{ + RTE_SET_USED(opt); + struct test_order *t = evt_test_priv(test); + + rte_free(t->expected_flow_seq); + rte_free(t->producer_flow_seq); + rte_free(test->test_priv); +} diff --git a/app/test-eventdev/test_order_common.h b/app/test-eventdev/test_order_common.h new file mode 100644 index 000000000..a9dfb647a --- /dev/null +++ b/app/test-eventdev/test_order_common.h @@ -0,0 +1,90 @@ +/* + * BSD LICENSE + * + * Copyright (C) Cavium 2017. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Cavium networks nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _TEST_ORDER_COMMON_ +#define _TEST_ORDER_COMMON_ + +#include +#include + +#include +#include +#include +#include +#include + +#include "evt_common.h" +#include "evt_options.h" +#include "evt_test.h" + +#define BURST_SIZE 16 + +struct test_order; + +struct worker_data { + uint8_t dev_id; + uint8_t port_id; + struct test_order *t; +}; + +struct prod_data { + uint8_t dev_id; + uint8_t port_id; + uint8_t queue_id; + struct test_order *t; +}; + +struct test_order { + /* Don't change the offset of "err". Signal handler use this memory + * to terminate all lcores work. + */ + int err; + /* + * The atomic_* is an expensive operation,Since it is a functional test, + * We are using the atomic_ operation to reduce the code complexity. + */ + rte_atomic64_t outstand_pkts; + enum evt_test_result result; + uint32_t nb_flows; + uint64_t nb_pkts; + struct rte_mempool *pool; + struct prod_data prod; + struct worker_data worker[EVT_MAX_PORTS]; + uint32_t *producer_flow_seq; + uint32_t *expected_flow_seq; + struct evt_options *opt; +} __rte_cache_aligned; + +int order_test_setup(struct evt_test *test, struct evt_options *opt); +void order_test_destroy(struct evt_test *test, struct evt_options *opt); + +#endif /* _TEST_ORDER_COMMON_ */ -- 2.13.0