From patchwork Wed Dec 21 09:25:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerin Jacob X-Patchwork-Id: 18319 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id B2FC710BB3; Wed, 21 Dec 2016 10:26:57 +0100 (CET) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0068.outbound.protection.outlook.com [104.47.42.68]) by dpdk.org (Postfix) with ESMTP id 34EDD10BB3 for ; Wed, 21 Dec 2016 10:26:56 +0100 (CET) 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=djyGwnnXEP/QlaNzYUk6TRaOVKBgCxtYyu1OyQqmnX0=; b=bsAqizb9l7sTyB8TOqVYioSlW/SI4yzlqhPWy+aV2v9Vi4u91EGWx+pfJvmwk1ZfoaxlAgdHTGFGzEydCbcQXvBt45Ljx3gtxzmP/CMHNbISEEenlSUeEM4jh/+tjHohvqVO0NXXa4wGdpCKZzCNrJPqQrBTHT8MphkGwa7W6jY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain.localdomain (14.140.2.178) by CY1PR0701MB1728.namprd07.prod.outlook.com (10.163.21.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.789.14; Wed, 21 Dec 2016 09:26:48 +0000 From: Jerin Jacob To: CC: , , , , , Jerin Jacob Date: Wed, 21 Dec 2016 14:55:26 +0530 Message-ID: <1482312326-2589-7-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1482312326-2589-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1480996340-29871-1-git-send-email-jerin.jacob@caviumnetworks.com> <1482312326-2589-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: PN1PR01CA0075.INDPRD01.PROD.OUTLOOK.COM (10.174.144.143) To CY1PR0701MB1728.namprd07.prod.outlook.com (10.163.21.142) X-MS-Office365-Filtering-Correlation-Id: 345a98a7-d69e-4016-e5ad-08d429837f14 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0701MB1728; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1728; 3:GtclI3unvl5lrzm42OfIOrZmM3cPAyWieXXz9MfAuRfKbP723YYga6QWelUoHM/7sr4Y4WWaSJfwcSjOzmrdHWBj5qjPPOCwySHYHDAqDduPhGAyBUbndba0VODS+w95CLPObh+3K/H57m76E0GnbbnNao3EmkrXsHICltnwLz2pg9Wb+RlZWhMzLk605MXzP+q6bpT/GuncEDYtIVYcnXFL44Pfjjif32rNRoQSpPxMYZF16XR4LWFN418N3OJ989CSEbsP+AWyvfLYnt7yPA== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1728; 25:V8n326+Sge/cFCHqHcXxriKwtZMpf9FgJdf63AFW6OZCEq/jQe4JH36RBE6nHVFQJSalucxFZM8yJJomhwr3ctBEfoQugNINUaKwPFd1asFwaq5YWqnXJdff34qqd2+Tre0M2FrqWasheXDRcBNEJP2HR/5b4MznuvSdBhBTCFSt3LkV/1d6KY7g0j7iskijsfX9l82+gbs3scqiPrkQPSiwAxgqAFcVpeRAffhfvPUx+l9OA9ECtFinws5mxvqn7DaRqSSXrIJymqidCfDfoL+NTP1JKmT8jCfU8imwwUroQXdcyszCHeUGq9k0cGJnT0sSCUEj6KLj0zohr0Uq3bZ9wMYD+j4gAubMFH1x3hpiQIwlqhaFV2w4irNQoAtlajS/l/LIHWcr1ViY45/Eh/dMYD0EM7RSjOcSgv2KcPCIFsGkU4GBrLR8RoY5+sYDIA6YoHU0jjaCt/+MuurTu1GOkK1h33i20FC32EOOxMvyl83XGrcDpEdZoD7Qt6OaVskAJnjKaK1JYrWSjPVWSGlWTJNyqoVI/9kU0C1yY2aiTH9UMZ3vGnP+Z7nODOzG4oLn0kpCQgnu52KyBZgsxJhgKkJkJzspP+3jt2r05flqxUuCh8hVqnW/XKUz52zy7BqaNbn3zN7MUSPhmqtSKL3ACszotfVHtNsExVljRkUsNMxjJtN+/Vk5kGrAmX9Rw212PwXZvuNscRrqjLfnWR6jBSUKTrk/F4Jj+yoV3m9neAa5tWDHExmRjQMtd470affGSdNuC5EpctF66nA5xan2Vs5gUVeGf8sKkZ7EnQM= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1728; 31:SBY+ip1AS9kC3BHAvaVOo4FFT5gHcVDdxXBAUwtcr9Y8gZOZ3F3sKXxmWtn2DSsD+aFfZ8s1OcoWasn9EOHFOUetfDoESpgETA7QVR8zX+qm1hvqBDrxYF87kLMfjQeqrshjtZE+SxgcwucPf5sxqE/gC8YmdSbbttzyFvondMHVIM2uXxHiPiOsgU+n8cqU+ARkGMzEqlgXm73hthCMscNTzHTWN+u4hJldBQ3wmIVzcD9PDVy9UAxdR4BmNoSYTvRXVLK2UaRYFdCmEucEhQ==; 20:BKhHo//IENbbqkoBQSw3pmiEdrE3G7h0EDlo/pMivTrikM+R4Gm7h7vK2GtCnsDtaVHclonMRLREHy+PYAtzSsXHgnxRI+7BHScVYYAhrOCbLXZF6cH9IHZt3dywccwsURkVg7w4mWezoXTqSR/7zGpDtOWNKLltymar3pskYfhndXZpKIWusjtBaWjV3u23v45RYyNtq9vgDuB3olR2t21+SNIy6bYc/gfj/ewiTlLZh3GWZ1GubVVARsMXJM4p44IRRlZ81R/jtM74LsmwBSTTRFYh9SFgcw17JG1Nth9FoGaaDHbTDiaH0mgBYQBuZrdU6jcwmo2T6nf3BPRq27QF+Ic1Pa/h+5CT3Z//x2WI77CAS56geMVlqxC9gzNOKyO+0tG4jkYsWsDUaahiCTUYMnQbJLGu0yhsaZudSsVXNUmlUzc5aRICt0pW3iv4+RyBOc6z4kLxfZd4axKBi00d9oKRCwx4ouJVx/DMxQPx+4+eAD5AZ2UFt7/5SvUjeGjzWWDpaQcwbOmwT5f9G9JxUu2SsE7C32bRBA+O97UTSBNjC3V1UnNsfm2gnhjD6/brF71NFf1k6WoUc9OWugK3cREMIUmvQkfJ9HFetnQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(6072148); SRVR:CY1PR0701MB1728; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1728; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1728; 4:TP9TwbMFJ7lOnAxF1BYj7PWQvFw5T1EbgIvdnuODNjDInFbRrDwqtxD9/nBAHyVHxiLr7344LRWj3ZqhDVCfWx4lDURyXZp7uAjDDSbZ8J2fbcI8Q+SlmY9NKCcpaJSuSSup19X+JWy5oVif+4lykP8vRgu5baWpmiwFJbttjrwwdVfcf37WvZp1eZVYYW47hL4nujNRc0ui70AK4aVUKD6AhG6FX6VbvBHusn/iM56j4lHS3Xto3rz09+Jkfd13Aj+8samYsxC31xYVnIYstK5IeKDn6WYdhvQp25eXcDlv3j5zhGB7jGGaWqdsHxY9yodiH3w/kyIX5oKmyKjHNI1O6rDEpcMGtD3m9FBFuZ0qLvNm0qzTG8jPLFjgmV7KEClVVH/DD7F4AOMEhALE4p5LqqH/woyVGWfIg1xr9cE+RVzeuFxPDyDJgs1j2eIzxlT3by4qNgz+gYFL9a6WYwDaBQqmZBFOP5/S1LMASdsPkL6kukZSbLarHOPQF3GskyJ5YFvYIf3d8hTOjdAKdcX2dLpc6la6BULASBK1pmWoD8uopx76Z6sq7/U0UDnyjk/QcmIk9McjeTWXsj3x4iZxH20aFuhwO08SfJAkFQCRIyZbSCYOResg1SDHSvPY X-Forefront-PRVS: 01630974C0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(199003)(189002)(7736002)(68736007)(92566002)(36756003)(105586002)(38730400001)(305945005)(4001430100002)(5009440100003)(106356001)(8676002)(81166006)(50226002)(8666006)(33646002)(81156014)(42186005)(2351001)(4326007)(76176999)(66066001)(101416001)(48376002)(50466002)(189998001)(110136003)(107886002)(6116002)(5003940100001)(5660300001)(47776003)(42882006)(97736004)(6916009)(2950100002)(6506006)(6512006)(2906002)(25786008)(6486002)(50986999)(3846002)(6666003)(7099028)(110426004)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1728; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1728; 23:Z+q+j3YEidKNwUJ1PllyW6ZvOABda4996XcHcnw?= IKew82aQoXNQ4PLPoKWkMAP1b6ZzHRCm+/WKv13O/FHd35RBgOypm7DRDGqVJ/sDypsDG17mfJjYT//SEcesdYV+AtJ7SqNmonb7BEc3RM+8ymhhY3Xx4ao8AUl4JPGxnAlkSw1XcdmJuvenRPR5rjXGzyL1mk8LsBoQT0lJmOWqQL9glHA47vjtkVTa9ZG7u6kvN4XbadWdTGunUMYmQY/JYtm7PWkw0gWIdd2Y/KNJnCddTtKBLEhyAA5yfKIJyHg4DE1JA9IKV3y4J3VARpCv7m7dc6d92AKxQKWG/1rPODZn5CKsjYz83NcK1xBF72fEmUjHIrgMEZ3fLFrk7YuPVyZ9l3iI9tE+WUPXmVMpTYznz7+2vbiR3cW462oLvBaf8q21HRHIJrRPkWhvE86wVv82G2t5ApLCVgaSKb8zlE3RgOL1Jb4H+dGA9YKGMxFH/QC0Lj2fQi0WgrnUJ00G8hHKgGnEMRUqaamIamVmoG3wbTJnRJavEgEpS/ObcoDuohQ0nwgPl2Nefrup57BYTq249LsXXLq1rWQkBQsZymCzvdtgt9WgrEfo5tyxfxAR5lu8qWsidypksQ8CfWl9RYkbvqBGQQWsgqksx63qKt2v2GbMLWxQDEXPSGdsbwbbYQPopXn+GUKuHIPgzF0iATeAt8d4eOFpHfFXv88s56sNRNVDp624AH4cXOKmuIPieNvykF60qUdHWlXc9X42crajSfk36CK5DgB4PG5LeFgdFL2WJsZEnag9L+YGL7drsccdEBWjOWpXBHL+NLJjjepfWYCo+QyRSVgi9Ljm++vTDj6II30x4J915DwB1JbBRMfLHOSJ9wxfvDdPrlvaJ5GyiXirzryH7RwEDtre2EQaRVsrKKniTgXhUWV2Fl9bYPa/pwim3lVATevJ/dinSkGBBlzgXYArxovowseeRWlqyGnI8Opul2NimrotillWMEiHKrXTulIWGbPuV1ZNgrX1PQyqm0oKakPbwTAvBqMDP87A+RCzXWeEjp60js6bxsjsTuM7anztvIJ58EUADY0UeUlCxBL4/ZDA17eqiHrmsfJ6C45XJEiZMjtjgpqVlT//Xx2DHHiCpsiU8YnRQIX3JDWHTwM7H/ySOGNIEHbnJgdobOy+ebmAAYC2/8qDYSwfvFXGKBdUVNG1xKbw2E40JtO1GM9QdHjTv6aHbD0J3RqO4SKQpMRYCpRP82ge9VUjPruImhT6r4F7Qe44q X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1728; 6:IlfSu9Ztr+IkPRU9CJHuGgnbkRjzFobjL6Xy3ojujGwwDuQxfaETcqaSCg5cXU71slRqs1P4d8UtrpVlEtJ5Ysy/uucvPiIEnrLhbmKX+z40MojBxSsacRogYYA4A2V39NLwezi93WRt9lU6G8j5vjJ22P6YrFPbGrL5p42jOr81nZmdenhXs4NgA5t9ynLC2+BvMUSup7ivCtx48YfjzP6ntF3XV2byh+wTkRtbTmSYcNswiAiptW9OMK+3HNLcVQdF9cHpBt9fa1KKdOq8rVBTK6an94jBjTa/fcxfaAvVPtnUcyCyqHbOWZGDoNzjE3bgWgtABGk+fvcTXhazI041T2Ql0Cgf59DZDZYecrfX7IxGEd6jcTwW5DlAk2AREBovSHs8nc0/NABUA7CrjgHBupGERFurRerVtrtNi9s=; 5:Zp0nIAkq32VWZK0Pp1OPE5rkWE3samTF9WElrHERJPCXZxuR4WK1bMW8k3i0+sEHE//buk239M6i0+xOnf2o1/vlcfxTE6haNbG7l+KOOF1B/+D1MJm3QipY9QoxHYcnpc/M6JgkExglahL0qvEO+Q==; 24:wwBJPLIqmFMZoTmM6t81/Fde9Q5k+N0JcPMZNWieHgn0TbO/QmwpGoH3ztsqmQ0h8h3RLJIhPG64NkjixiblC9rvfFoSKSWaCL84ypAIlcM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1728; 7:m7dtAtlCHZ21FxSZf7fXtdeFMhVe78KHczW/OeJ7ZZl/kK3KZUE46Oxlzc2poMLJjh5fbUtSRd9TcuBaOQv4hOFAGcozf762ncKaAZOUHp5l6jye63f0fRd5gJjavxa89jHex3ZJbTtqXFDghmGi68w88KmszuVh+za82qBJfYwDClJMoJhaqstLcseiHKM+pTEdbHUMjlRQr35cQVderib1qm1lhQKe08pcAnJFsYCUP57BF6UTWc/8qFhKtHr0RQ/fvEDQggkf46YUayhIkp4DaPdYuk/8tX8EfQOaIVZnSKCfpccRtWPc5okGLg/Ry4Qwirw18mW/QapqEb3JzCNST/LVDdnzDstat2MUx1sCuQkIkjDi3+5pi0i9FZ0jmEMRknHUuXVfVz5FwL0altlQF1lxHB1oMZs1a1/roYrKz8G3uLZ4mKsq2zwBOCzOuOYeTJ7VbHAvLyrNAynFig== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2016 09:26:48.3877 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1728 Subject: [dpdk-dev] [PATCH v4 6/6] app/test: unit test case for eventdev APIs 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This commit adds basic unit tests for the eventdev API. commands to run the test app: ./build/app/test -c 2 RTE>>eventdev_common_autotest Signed-off-by: Jerin Jacob Acked-by: Bruce Richardson --- MAINTAINERS | 1 + app/test/Makefile | 2 + app/test/test_eventdev.c | 778 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 781 insertions(+) create mode 100644 app/test/test_eventdev.c diff --git a/MAINTAINERS b/MAINTAINERS index a10899f..21ff4db 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -252,6 +252,7 @@ F: examples/l2fwd-crypto/ Eventdev API - EXPERIMENTAL M: Jerin Jacob F: lib/librte_eventdev/ +F: app/test/test_eventdev* F: drivers/event/skeleton/ Networking Drivers diff --git a/app/test/Makefile b/app/test/Makefile index 8af39cb..3269270 100644 --- a/app/test/Makefile +++ b/app/test/Makefile @@ -198,6 +198,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_perf.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c +SRCS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += test_eventdev.c + SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) += test_kvargs.c CFLAGS += -O3 diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c new file mode 100644 index 0000000..042a446 --- /dev/null +++ b/app/test/test_eventdev.c @@ -0,0 +1,778 @@ +/*- + * BSD LICENSE + * + * Copyright(c) 2016 Cavium networks. All rights reserved. + * + * 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 +#include +#include +#include +#include +#include +#include + +#include "test.h" + +#define TEST_DEV_ID 0 + +static int +testsuite_setup(void) +{ + RTE_BUILD_BUG_ON(sizeof(struct rte_event) != 16); + uint8_t count; + count = rte_event_dev_count(); + if (!count) { + printf("Failed to find a valid event device," + " testing with event_skeleton device\n"); + return rte_eal_vdev_init("event_skeleton", NULL); + } + return TEST_SUCCESS; +} + +static void +testsuite_teardown(void) +{ +} + +static int +test_eventdev_count(void) +{ + uint8_t count; + count = rte_event_dev_count(); + TEST_ASSERT(count > 0, "Invalid eventdev count %" PRIu8, count); + return TEST_SUCCESS; +} + +static int +test_eventdev_get_dev_id(void) +{ + int ret; + ret = rte_event_dev_get_dev_id("not_a_valid_eventdev_driver"); + TEST_ASSERT_FAIL(ret, "Expected <0 for invalid dev name ret=%d", ret); + return TEST_SUCCESS; +} + +static int +test_eventdev_socket_id(void) +{ + int socket_id; + socket_id = rte_event_dev_socket_id(TEST_DEV_ID); + TEST_ASSERT(socket_id != -EINVAL, "Failed to get socket_id %d", + socket_id); + socket_id = rte_event_dev_socket_id(RTE_EVENT_MAX_DEVS); + TEST_ASSERT(socket_id == -EINVAL, "Expected -EINVAL %d", socket_id); + + return TEST_SUCCESS; +} + +static int +test_eventdev_info_get(void) +{ + int ret; + struct rte_event_dev_info info; + ret = rte_event_dev_info_get(TEST_DEV_ID, NULL); + TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret); + ret = rte_event_dev_info_get(TEST_DEV_ID, &info); + TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info"); + TEST_ASSERT(info.max_event_ports > 0, + "Not enough event ports %d", info.max_event_ports); + TEST_ASSERT(info.max_event_queues > 0, + "Not enough event queues %d", info.max_event_queues); + return TEST_SUCCESS; +} + +static inline void +devconf_set_default_sane_values(struct rte_event_dev_config *dev_conf, + struct rte_event_dev_info *info) +{ + memset(dev_conf, 0, sizeof(struct rte_event_dev_config)); + dev_conf->dequeue_timeout_ns = info->min_dequeue_timeout_ns; + dev_conf->nb_event_ports = info->max_event_ports; + dev_conf->nb_event_queues = info->max_event_queues; + dev_conf->nb_event_queue_flows = info->max_event_queue_flows; + dev_conf->nb_event_port_dequeue_depth = + info->max_event_port_dequeue_depth; + dev_conf->nb_event_port_enqueue_depth = + info->max_event_port_enqueue_depth; + dev_conf->nb_event_port_enqueue_depth = + info->max_event_port_enqueue_depth; + dev_conf->nb_events_limit = + info->max_num_events; +} + +static int +test_ethdev_config_run(struct rte_event_dev_config *dev_conf, + struct rte_event_dev_info *info, + void (*fn)(struct rte_event_dev_config *dev_conf, + struct rte_event_dev_info *info)) +{ + devconf_set_default_sane_values(dev_conf, info); + fn(dev_conf, info); + return rte_event_dev_configure(TEST_DEV_ID, dev_conf); +} + +static void +min_dequeue_limit(struct rte_event_dev_config *dev_conf, + struct rte_event_dev_info *info) +{ + dev_conf->dequeue_timeout_ns = info->min_dequeue_timeout_ns - 1; +} + +static void +max_dequeue_limit(struct rte_event_dev_config *dev_conf, + struct rte_event_dev_info *info) +{ + dev_conf->dequeue_timeout_ns = info->max_dequeue_timeout_ns + 1; +} + +static void +max_events_limit(struct rte_event_dev_config *dev_conf, + struct rte_event_dev_info *info) +{ + dev_conf->nb_events_limit = info->max_num_events + 1; +} + +static void +max_event_ports(struct rte_event_dev_config *dev_conf, + struct rte_event_dev_info *info) +{ + dev_conf->nb_event_ports = info->max_event_ports + 1; +} + +static void +max_event_queues(struct rte_event_dev_config *dev_conf, + struct rte_event_dev_info *info) +{ + dev_conf->nb_event_queues = info->max_event_queues + 1; +} + +static void +max_event_queue_flows(struct rte_event_dev_config *dev_conf, + struct rte_event_dev_info *info) +{ + dev_conf->nb_event_queue_flows = info->max_event_queue_flows + 1; +} + +static void +max_event_port_dequeue_depth(struct rte_event_dev_config *dev_conf, + struct rte_event_dev_info *info) +{ + dev_conf->nb_event_port_dequeue_depth = + info->max_event_port_dequeue_depth + 1; +} + +static void +max_event_port_enqueue_depth(struct rte_event_dev_config *dev_conf, + struct rte_event_dev_info *info) +{ + dev_conf->nb_event_port_enqueue_depth = + info->max_event_port_enqueue_depth + 1; +} + + +static int +test_eventdev_configure(void) +{ + int ret; + struct rte_event_dev_config dev_conf; + struct rte_event_dev_info info; + ret = rte_event_dev_configure(TEST_DEV_ID, NULL); + TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret); + + ret = rte_event_dev_info_get(TEST_DEV_ID, &info); + TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info"); + + /* Check limits */ + TEST_ASSERT_EQUAL(-EINVAL, + test_ethdev_config_run(&dev_conf, &info, min_dequeue_limit), + "Config negative test failed"); + TEST_ASSERT_EQUAL(-EINVAL, + test_ethdev_config_run(&dev_conf, &info, max_dequeue_limit), + "Config negative test failed"); + TEST_ASSERT_EQUAL(-EINVAL, + test_ethdev_config_run(&dev_conf, &info, max_events_limit), + "Config negative test failed"); + TEST_ASSERT_EQUAL(-EINVAL, + test_ethdev_config_run(&dev_conf, &info, max_event_ports), + "Config negative test failed"); + TEST_ASSERT_EQUAL(-EINVAL, + test_ethdev_config_run(&dev_conf, &info, max_event_queues), + "Config negative test failed"); + TEST_ASSERT_EQUAL(-EINVAL, + test_ethdev_config_run(&dev_conf, &info, max_event_queue_flows), + "Config negative test failed"); + TEST_ASSERT_EQUAL(-EINVAL, + test_ethdev_config_run(&dev_conf, &info, + max_event_port_dequeue_depth), + "Config negative test failed"); + TEST_ASSERT_EQUAL(-EINVAL, + test_ethdev_config_run(&dev_conf, &info, + max_event_port_enqueue_depth), + "Config negative test failed"); + + /* Positive case */ + devconf_set_default_sane_values(&dev_conf, &info); + ret = rte_event_dev_configure(TEST_DEV_ID, &dev_conf); + TEST_ASSERT_SUCCESS(ret, "Failed to configure eventdev"); + + /* re-configure */ + devconf_set_default_sane_values(&dev_conf, &info); + dev_conf.nb_event_ports = info.max_event_ports/2; + dev_conf.nb_event_queues = info.max_event_queues/2; + ret = rte_event_dev_configure(TEST_DEV_ID, &dev_conf); + TEST_ASSERT_SUCCESS(ret, "Failed to re configure eventdev"); + + /* re-configure back to max_event_queues and max_event_ports */ + devconf_set_default_sane_values(&dev_conf, &info); + ret = rte_event_dev_configure(TEST_DEV_ID, &dev_conf); + TEST_ASSERT_SUCCESS(ret, "Failed to re-configure eventdev"); + + return TEST_SUCCESS; + +} + +static int +eventdev_configure_setup(void) +{ + int ret; + struct rte_event_dev_config dev_conf; + struct rte_event_dev_info info; + + ret = rte_event_dev_info_get(TEST_DEV_ID, &info); + TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info"); + devconf_set_default_sane_values(&dev_conf, &info); + ret = rte_event_dev_configure(TEST_DEV_ID, &dev_conf); + TEST_ASSERT_SUCCESS(ret, "Failed to configure eventdev"); + + return TEST_SUCCESS; +} + +static int +test_eventdev_queue_default_conf_get(void) +{ + int i, ret; + struct rte_event_queue_conf qconf; + + ret = rte_event_queue_default_conf_get(TEST_DEV_ID, 0, NULL); + TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret); + + for (i = 0; i < rte_event_queue_count(TEST_DEV_ID); i++) { + ret = rte_event_queue_default_conf_get(TEST_DEV_ID, i, + &qconf); + TEST_ASSERT_SUCCESS(ret, "Failed to get queue%d info", i); + } + + return TEST_SUCCESS; +} + +static int +test_eventdev_queue_setup(void) +{ + int i, ret; + struct rte_event_dev_info info; + struct rte_event_queue_conf qconf; + + ret = rte_event_dev_info_get(TEST_DEV_ID, &info); + TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info"); + + /* Negative cases */ + ret = rte_event_queue_default_conf_get(TEST_DEV_ID, 0, &qconf); + TEST_ASSERT_SUCCESS(ret, "Failed to get queue0 info"); + qconf.event_queue_cfg = (RTE_EVENT_QUEUE_CFG_ALL_TYPES & + RTE_EVENT_QUEUE_CFG_TYPE_MASK); + qconf.nb_atomic_flows = info.max_event_queue_flows + 1; + ret = rte_event_queue_setup(TEST_DEV_ID, 0, &qconf); + TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret); + + qconf.nb_atomic_flows = info.max_event_queue_flows; + qconf.event_queue_cfg = (RTE_EVENT_QUEUE_CFG_ORDERED_ONLY & + RTE_EVENT_QUEUE_CFG_TYPE_MASK); + qconf.nb_atomic_order_sequences = info.max_event_queue_flows + 1; + ret = rte_event_queue_setup(TEST_DEV_ID, 0, &qconf); + TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret); + + ret = rte_event_queue_setup(TEST_DEV_ID, info.max_event_queues, + &qconf); + TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret); + + /* Positive case */ + ret = rte_event_queue_default_conf_get(TEST_DEV_ID, 0, &qconf); + TEST_ASSERT_SUCCESS(ret, "Failed to get queue0 info"); + ret = rte_event_queue_setup(TEST_DEV_ID, 0, &qconf); + TEST_ASSERT_SUCCESS(ret, "Failed to setup queue0"); + + + for (i = 0; i < rte_event_queue_count(TEST_DEV_ID); i++) { + ret = rte_event_queue_setup(TEST_DEV_ID, i, NULL); + TEST_ASSERT_SUCCESS(ret, "Failed to setup queue%d", i); + } + + return TEST_SUCCESS; +} + +static int +test_eventdev_queue_count(void) +{ + int ret; + struct rte_event_dev_info info; + + ret = rte_event_dev_info_get(TEST_DEV_ID, &info); + TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info"); + + TEST_ASSERT_EQUAL(rte_event_queue_count(TEST_DEV_ID), + info.max_event_queues, "Wrong queue count"); + + return TEST_SUCCESS; +} + +static int +test_eventdev_queue_priority(void) +{ + int i, ret; + struct rte_event_dev_info info; + struct rte_event_queue_conf qconf; + uint8_t priority; + + ret = rte_event_dev_info_get(TEST_DEV_ID, &info); + TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info"); + + for (i = 0; i < rte_event_queue_count(TEST_DEV_ID); i++) { + ret = rte_event_queue_default_conf_get(TEST_DEV_ID, i, + &qconf); + TEST_ASSERT_SUCCESS(ret, "Failed to get queue%d def conf", i); + qconf.priority = i % RTE_EVENT_DEV_PRIORITY_LOWEST; + ret = rte_event_queue_setup(TEST_DEV_ID, i, &qconf); + TEST_ASSERT_SUCCESS(ret, "Failed to setup queue%d", i); + } + + for (i = 0; i < rte_event_queue_count(TEST_DEV_ID); i++) { + priority = rte_event_queue_priority(TEST_DEV_ID, i); + if (info.event_dev_cap & RTE_EVENT_DEV_CAP_QUEUE_QOS) + TEST_ASSERT_EQUAL(priority, + i % RTE_EVENT_DEV_PRIORITY_LOWEST, + "Wrong priority value for queue%d", i); + else + TEST_ASSERT_EQUAL(priority, + RTE_EVENT_DEV_PRIORITY_NORMAL, + "Wrong priority value for queue%d", i); + } + + return TEST_SUCCESS; +} + +static int +test_eventdev_port_default_conf_get(void) +{ + int i, ret; + struct rte_event_port_conf pconf; + + ret = rte_event_port_default_conf_get(TEST_DEV_ID, 0, NULL); + TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret); + + ret = rte_event_port_default_conf_get(TEST_DEV_ID, + rte_event_port_count(TEST_DEV_ID) + 1, NULL); + TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret); + + for (i = 0; i < rte_event_port_count(TEST_DEV_ID); i++) { + ret = rte_event_port_default_conf_get(TEST_DEV_ID, i, + &pconf); + TEST_ASSERT_SUCCESS(ret, "Failed to get port%d info", i); + } + + return TEST_SUCCESS; +} + +static int +test_eventdev_port_setup(void) +{ + int i, ret; + struct rte_event_dev_info info; + struct rte_event_port_conf pconf; + + ret = rte_event_dev_info_get(TEST_DEV_ID, &info); + TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info"); + + /* Negative cases */ + ret = rte_event_port_default_conf_get(TEST_DEV_ID, 0, &pconf); + TEST_ASSERT_SUCCESS(ret, "Failed to get port0 info"); + pconf.new_event_threshold = info.max_num_events + 1; + ret = rte_event_port_setup(TEST_DEV_ID, 0, &pconf); + TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret); + + pconf.new_event_threshold = info.max_num_events; + pconf.dequeue_depth = info.max_event_port_dequeue_depth + 1; + ret = rte_event_port_setup(TEST_DEV_ID, 0, &pconf); + TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret); + + pconf.dequeue_depth = info.max_event_port_dequeue_depth; + pconf.enqueue_depth = info.max_event_port_enqueue_depth + 1; + ret = rte_event_port_setup(TEST_DEV_ID, 0, &pconf); + TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret); + + ret = rte_event_port_setup(TEST_DEV_ID, info.max_event_ports, + &pconf); + TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret); + + /* Positive case */ + ret = rte_event_port_default_conf_get(TEST_DEV_ID, 0, &pconf); + TEST_ASSERT_SUCCESS(ret, "Failed to get port0 info"); + ret = rte_event_port_setup(TEST_DEV_ID, 0, &pconf); + TEST_ASSERT_SUCCESS(ret, "Failed to setup port0"); + + + for (i = 0; i < rte_event_port_count(TEST_DEV_ID); i++) { + ret = rte_event_port_setup(TEST_DEV_ID, i, NULL); + TEST_ASSERT_SUCCESS(ret, "Failed to setup port%d", i); + } + + return TEST_SUCCESS; +} + +static int +test_eventdev_dequeue_depth(void) +{ + int ret; + struct rte_event_dev_info info; + struct rte_event_port_conf pconf; + + ret = rte_event_dev_info_get(TEST_DEV_ID, &info); + TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info"); + + ret = rte_event_port_default_conf_get(TEST_DEV_ID, 0, &pconf); + TEST_ASSERT_SUCCESS(ret, "Failed to get port0 info"); + ret = rte_event_port_setup(TEST_DEV_ID, 0, &pconf); + TEST_ASSERT_SUCCESS(ret, "Failed to setup port0"); + + TEST_ASSERT_EQUAL(rte_event_port_dequeue_depth(TEST_DEV_ID, 0), + pconf.dequeue_depth, "Wrong port dequeue depth"); + + return TEST_SUCCESS; +} + +static int +test_eventdev_enqueue_depth(void) +{ + int ret; + struct rte_event_dev_info info; + struct rte_event_port_conf pconf; + + ret = rte_event_dev_info_get(TEST_DEV_ID, &info); + TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info"); + + ret = rte_event_port_default_conf_get(TEST_DEV_ID, 0, &pconf); + TEST_ASSERT_SUCCESS(ret, "Failed to get port0 info"); + ret = rte_event_port_setup(TEST_DEV_ID, 0, &pconf); + TEST_ASSERT_SUCCESS(ret, "Failed to setup port0"); + + TEST_ASSERT_EQUAL(rte_event_port_enqueue_depth(TEST_DEV_ID, 0), + pconf.enqueue_depth, "Wrong port enqueue depth"); + + return TEST_SUCCESS; +} + +static int +test_eventdev_port_count(void) +{ + int ret; + struct rte_event_dev_info info; + + ret = rte_event_dev_info_get(TEST_DEV_ID, &info); + TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info"); + + TEST_ASSERT_EQUAL(rte_event_port_count(TEST_DEV_ID), + info.max_event_ports, "Wrong port count"); + + return TEST_SUCCESS; +} + +static int +test_eventdev_timeout_ticks(void) +{ + int ret; + uint64_t timeout_ticks; + + ret = rte_event_dequeue_timeout_ticks(TEST_DEV_ID, 100, &timeout_ticks); + TEST_ASSERT_SUCCESS(ret, "Fail to get timeout_ticks"); + + return TEST_SUCCESS; +} + + +static int +test_eventdev_start_stop(void) +{ + int i, ret; + + ret = eventdev_configure_setup(); + TEST_ASSERT_SUCCESS(ret, "Failed to configure eventdev"); + + for (i = 0; i < rte_event_queue_count(TEST_DEV_ID); i++) { + ret = rte_event_queue_setup(TEST_DEV_ID, i, NULL); + TEST_ASSERT_SUCCESS(ret, "Failed to setup queue%d", i); + } + + for (i = 0; i < rte_event_port_count(TEST_DEV_ID); i++) { + ret = rte_event_port_setup(TEST_DEV_ID, i, NULL); + TEST_ASSERT_SUCCESS(ret, "Failed to setup port%d", i); + } + + ret = rte_event_dev_start(TEST_DEV_ID); + TEST_ASSERT_SUCCESS(ret, "Failed to start device%d", TEST_DEV_ID); + + rte_event_dev_stop(TEST_DEV_ID); + return TEST_SUCCESS; +} + + +static int +eventdev_setup_device(void) +{ + int i, ret; + + ret = eventdev_configure_setup(); + TEST_ASSERT_SUCCESS(ret, "Failed to configure eventdev"); + + for (i = 0; i < rte_event_queue_count(TEST_DEV_ID); i++) { + ret = rte_event_queue_setup(TEST_DEV_ID, i, NULL); + TEST_ASSERT_SUCCESS(ret, "Failed to setup queue%d", i); + } + + for (i = 0; i < rte_event_port_count(TEST_DEV_ID); i++) { + ret = rte_event_port_setup(TEST_DEV_ID, i, NULL); + TEST_ASSERT_SUCCESS(ret, "Failed to setup port%d", i); + } + + ret = rte_event_dev_start(TEST_DEV_ID); + TEST_ASSERT_SUCCESS(ret, "Failed to start device%d", TEST_DEV_ID); + + return TEST_SUCCESS; +} + +static void +eventdev_stop_device(void) +{ + rte_event_dev_stop(TEST_DEV_ID); +} + +static int +test_eventdev_link(void) +{ + int ret, nb_queues, i; + uint8_t queues[RTE_EVENT_MAX_QUEUES_PER_DEV]; + uint8_t priorities[RTE_EVENT_MAX_QUEUES_PER_DEV]; + + ret = rte_event_port_link(TEST_DEV_ID, 0, NULL, NULL, 0); + TEST_ASSERT(ret >= 0, "Failed to link with NULL device%d", + TEST_DEV_ID); + + nb_queues = rte_event_queue_count(TEST_DEV_ID); + for (i = 0; i < nb_queues; i++) { + queues[i] = i; + priorities[i] = RTE_EVENT_DEV_PRIORITY_NORMAL; + } + + ret = rte_event_port_link(TEST_DEV_ID, 0, queues, + priorities, nb_queues); + TEST_ASSERT(ret == nb_queues, "Failed to link(device%d) ret=%d", + TEST_DEV_ID, ret); + return TEST_SUCCESS; +} + +static int +test_eventdev_unlink(void) +{ + int ret, nb_queues, i; + uint8_t queues[RTE_EVENT_MAX_QUEUES_PER_DEV]; + + ret = rte_event_port_unlink(TEST_DEV_ID, 0, NULL, 0); + TEST_ASSERT(ret >= 0, "Failed to unlink with NULL device%d", + TEST_DEV_ID); + + nb_queues = rte_event_queue_count(TEST_DEV_ID); + for (i = 0; i < nb_queues; i++) + queues[i] = i; + + + ret = rte_event_port_unlink(TEST_DEV_ID, 0, queues, nb_queues); + TEST_ASSERT(ret == nb_queues, "Failed to unlink(device%d) ret=%d", + TEST_DEV_ID, ret); + return TEST_SUCCESS; +} + +static int +test_eventdev_link_get(void) +{ + int ret, nb_queues, i; + uint8_t queues[RTE_EVENT_MAX_QUEUES_PER_DEV]; + uint8_t priorities[RTE_EVENT_MAX_QUEUES_PER_DEV]; + + /* link all queues */ + ret = rte_event_port_link(TEST_DEV_ID, 0, NULL, NULL, 0); + TEST_ASSERT(ret >= 0, "Failed to link with NULL device%d", + TEST_DEV_ID); + + nb_queues = rte_event_queue_count(TEST_DEV_ID); + for (i = 0; i < nb_queues; i++) + queues[i] = i; + + ret = rte_event_port_unlink(TEST_DEV_ID, 0, queues, nb_queues); + TEST_ASSERT(ret == nb_queues, "Failed to unlink(device%d) ret=%d", + TEST_DEV_ID, ret); + + ret = rte_event_port_links_get(TEST_DEV_ID, 0, queues, priorities); + TEST_ASSERT(ret == 0, "(%d)Wrong link get=%d", TEST_DEV_ID, ret); + + /* link all queues and get the links */ + nb_queues = rte_event_queue_count(TEST_DEV_ID); + for (i = 0; i < nb_queues; i++) { + queues[i] = i; + priorities[i] = RTE_EVENT_DEV_PRIORITY_NORMAL; + } + ret = rte_event_port_link(TEST_DEV_ID, 0, queues, priorities, + nb_queues); + TEST_ASSERT(ret == nb_queues, "Failed to link(device%d) ret=%d", + TEST_DEV_ID, ret); + ret = rte_event_port_links_get(TEST_DEV_ID, 0, queues, priorities); + TEST_ASSERT(ret == nb_queues, "(%d)Wrong link get ret=%d expected=%d", + TEST_DEV_ID, ret, nb_queues); + /* unlink all*/ + ret = rte_event_port_unlink(TEST_DEV_ID, 0, NULL, 0); + TEST_ASSERT(ret == nb_queues, "Failed to unlink(device%d) ret=%d", + TEST_DEV_ID, ret); + /* link just one queue */ + queues[0] = 0; + priorities[0] = RTE_EVENT_DEV_PRIORITY_NORMAL; + + ret = rte_event_port_link(TEST_DEV_ID, 0, queues, priorities, 1); + TEST_ASSERT(ret == 1, "Failed to link(device%d) ret=%d", + TEST_DEV_ID, ret); + ret = rte_event_port_links_get(TEST_DEV_ID, 0, queues, priorities); + TEST_ASSERT(ret == 1, "(%d)Wrong link get ret=%d expected=%d", + TEST_DEV_ID, ret, 1); + /* unlink all*/ + ret = rte_event_port_unlink(TEST_DEV_ID, 0, NULL, 0); + TEST_ASSERT(ret == nb_queues, "Failed to unlink(device%d) ret=%d", + TEST_DEV_ID, ret); + /* 4links and 2 unlinks */ + nb_queues = rte_event_queue_count(TEST_DEV_ID); + if (nb_queues >= 4) { + for (i = 0; i < 4; i++) { + queues[i] = i; + priorities[i] = 0x40; + } + ret = rte_event_port_link(TEST_DEV_ID, 0, queues, priorities, + 4); + TEST_ASSERT(ret == 4, "Failed to link(device%d) ret=%d", + TEST_DEV_ID, ret); + + for (i = 0; i < 2; i++) + queues[i] = i; + + ret = rte_event_port_unlink(TEST_DEV_ID, 0, queues, 2); + TEST_ASSERT(ret == 2, "Failed to unlink(device%d) ret=%d", + TEST_DEV_ID, ret); + ret = rte_event_port_links_get(TEST_DEV_ID, 0, + queues, priorities); + TEST_ASSERT(ret == 2, "(%d)Wrong link get ret=%d expected=%d", + TEST_DEV_ID, ret, 2); + TEST_ASSERT(queues[0] == 2, "ret=%d expected=%d", ret, 2); + TEST_ASSERT(priorities[0] == 0x40, "ret=%d expected=%d", + ret, 0x40); + TEST_ASSERT(queues[1] == 3, "ret=%d expected=%d", ret, 3); + TEST_ASSERT(priorities[1] == 0x40, "ret=%d expected=%d", + ret, 0x40); + } + + return TEST_SUCCESS; +} + +static int +test_eventdev_close(void) +{ + rte_event_dev_stop(TEST_DEV_ID); + return rte_event_dev_close(TEST_DEV_ID); +} + +static struct unit_test_suite eventdev_common_testsuite = { + .suite_name = "eventdev common code unit test suite", + .setup = testsuite_setup, + .teardown = testsuite_teardown, + .unit_test_cases = { + TEST_CASE_ST(NULL, NULL, + test_eventdev_count), + TEST_CASE_ST(NULL, NULL, + test_eventdev_get_dev_id), + TEST_CASE_ST(NULL, NULL, + test_eventdev_socket_id), + TEST_CASE_ST(NULL, NULL, + test_eventdev_info_get), + TEST_CASE_ST(NULL, NULL, + test_eventdev_configure), + TEST_CASE_ST(eventdev_configure_setup, NULL, + test_eventdev_queue_default_conf_get), + TEST_CASE_ST(eventdev_configure_setup, NULL, + test_eventdev_queue_setup), + TEST_CASE_ST(eventdev_configure_setup, NULL, + test_eventdev_queue_count), + TEST_CASE_ST(eventdev_configure_setup, NULL, + test_eventdev_queue_priority), + TEST_CASE_ST(eventdev_configure_setup, NULL, + test_eventdev_port_default_conf_get), + TEST_CASE_ST(eventdev_configure_setup, NULL, + test_eventdev_port_setup), + TEST_CASE_ST(eventdev_configure_setup, NULL, + test_eventdev_dequeue_depth), + TEST_CASE_ST(eventdev_configure_setup, NULL, + test_eventdev_enqueue_depth), + TEST_CASE_ST(eventdev_configure_setup, NULL, + test_eventdev_port_count), + TEST_CASE_ST(eventdev_configure_setup, NULL, + test_eventdev_timeout_ticks), + TEST_CASE_ST(NULL, NULL, + test_eventdev_start_stop), + TEST_CASE_ST(eventdev_setup_device, eventdev_stop_device, + test_eventdev_link), + TEST_CASE_ST(eventdev_setup_device, eventdev_stop_device, + test_eventdev_unlink), + TEST_CASE_ST(eventdev_setup_device, eventdev_stop_device, + test_eventdev_link_get), + TEST_CASE_ST(eventdev_setup_device, NULL, + test_eventdev_close), + TEST_CASES_END() /**< NULL terminate unit test array */ + } +}; + +static int +test_eventdev_common(void) +{ + return unit_test_suite_runner(&eventdev_common_testsuite); +} + +REGISTER_TEST_COMMAND(eventdev_common_autotest, test_eventdev_common);