From patchwork Tue Dec 6 03:52:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerin Jacob X-Patchwork-Id: 17692 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 CEB674CC5; Tue, 6 Dec 2016 04:53:50 +0100 (CET) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0074.outbound.protection.outlook.com [104.47.33.74]) by dpdk.org (Postfix) with ESMTP id 5090B2BC5 for ; Tue, 6 Dec 2016 04:52:58 +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=v88vXgHFVs8Qn5tXl+KXo+4wu5rHVA2bBCwCEdK47Qs=; b=XuyJbIQJazO3UumIARV5lmaH8TIbPBiUZPW57lbi1Z8/UcW5KLhvRLBCOU7HCfs5ClY9YKqwupiWLo8rWuySwcf515nZcEHbpmj2PU7s1MVCxvJ7d+7Lqc7Ur9bitASuQs42M2vF04SdWi8FN2LfhNPybbGnL8weLeCHJdgtQhQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.caveonetworks.com (50.233.148.156) by BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12; Tue, 6 Dec 2016 03:52:54 +0000 From: Jerin Jacob To: CC: , , , , , Jerin Jacob Date: Tue, 6 Dec 2016 09:22:20 +0530 Message-ID: <1480996340-29871-7-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1480996340-29871-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1479447902-3700-2-git-send-email-jerin.jacob@caviumnetworks.com> <1480996340-29871-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: BLUPR13CA0014.namprd13.prod.outlook.com (10.160.191.24) To BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 2:yJX5DnnbMl6DT2cA644fxuTWJ2oYC4hrtG1/tsaHU6ppjvN+JPyXCi51Bzad9V6u2uT2BZou+i5v4LRxprxeKhGoho6wVWRV4pzJnaNdXx7uvLq27RShPbqsRqQx4GODNxRtxRYshvrlBS1WZXrBWmoEiyhQzZCwqT2NkuQUAGk=; 3:+CxSAlqHa9zyjq2En8t/XzD67/GSsFARWVtBoExv4dEIbt0EQkKHiOx8hwAOiWgLvCPr9mCQfmJL/AMLMi/ZfaqYcVFRylfLs+QbqK8W9kP+bEY9GI1v0NTm2BE7iZEAokn8MgwiJTek2S2ekoJYCsTRQ1WqEgck9IJKMp+03lk= X-MS-Office365-Filtering-Correlation-Id: aba585c1-6cae-45c1-9ced-08d41d8b5ca9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 25:kZQsBanPtj86ihLwu89UGaFRNtOgdiju7j+oeq8GNyImTMc2rq+Zq0s8av7M/KoURg4xji9GWBYgPuBtN7Fi39qIe4x5R/5Cmq9ls9+DpK2b2oN7pEZ849/Hn7cTPUu8KXamXRWXRdK7ZlZZtv8rCmArHVLxenq1quSIPMaZNXdo3yoxm92vkPyP1r3vD7bJmmaCQEibqtnl8dd2rwXMyG79346HiHTYRCOJyxoMaGk3DzPEhdzVV9RsKtfOIUGV3j1EtJJL5LgaVj0m8c1eeic8VGiq7fqI77gFtHJf7hVrWZKI6wKQb804xMGB1Ra6Rn8qsorTmxFTewZokg4DEAij6pwItaY9ioc6LHhfe6iUYknoFzNrxM2ZfSV/CqMnP/kJGGKnRkFsYOSF/6q7FTTk5x4jEP5PIlejsmwnauCL3DW5sJyPQcYS05H0jDFW7Q1uKssYfA0t6llvkSYfB4kZxIxYVj4pPspMSV+t9otG9tJI34AhBvVRvpWfSEqQhwYQblo1afJ6GqPqWjroZJEz6LE//RM2iITaFrNNZkE7GN7S1X6DM5bddRrsMWmYim1vgk+KO4J/Y5Lp7azyEtG28xMKOC9EiY7Ty/N8//5NiRmx+0QyV3htXmlwvoCbkf3xoRgPWrj7Bk3K1+kmpacW52r4klYGnLGbyiZEC8IrdIssRCnruqS69sQPfz+ZkyF2F2XZzLJhvwKl8ngxZ7dW20O0YTKlTpFsnW8wP3v7IWjSuDfOhan083bwX4h8NBewatQD12QeMtEWFnhWvo/GFQsguuHS+qFItoj81a0= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 31:l/TC54I/P5zfdv4jLulxfWcLOyAKjTNWb7w9nXFKKPp6dPa09MiM0Q7yI4HwLffOGxWG33x15rYJrRcEO1tU/WOzQRUTLBv2f71YgFc8+A5Hm3f7qW3pJMSe04Ox6oCqhGfC/n8DJJ4NVy8IdEsZUUTKSCbonjSeJtfaz2GbHJf8D9/rCCsxgfQpNVHhgs0Yh0y3SSB22JYU5iD29kifptP+f0E0cSERUmMtJQLg7bivhbaEUnIAIK4/mjHgK18CVfFKOx8vnI8Y1QwFlKa/Iw==; 20:VF/mNiqhZ0fJ4WW6OJzPhiBvu2Im8mNesBCkKqq+o2lerRVA9G6D1H84Zl8zLNrYHivKwzEB6CQwPBQLUkKjQaxyLgM1vhHAqT+k/GTufY7VJPKo4E4MHJy7QFkT7bDWhzYvv9rZhLIMhWiK+xGgjcsleafa1ndMoGTNll55kxSNSroQVeH5XcfzfXxmJK4gd7o5PXBxK9X/mooNfCDDJ1S293cHepPjAMeROSoyH2nD+LnSkRMbNT9w5Ou8zfmrLEuWiSwg3nIczD+5I3YvQ3ysGWTtMa83IUlQckgWg79JrPxRtsWgZVizdI8/8z7cqF5NHJvD/NW334aS55m+mt0bDvzsquD+QaQluzwLmf26XVa/qSxW2SsmMk7vZglQ1GIO+gc1/xXz5FGuCyAcMAMz10UQAgZ6FaBN9ce8vCiTv/wqw3qutTQSW87TNWNk2Tyfh2KdTn6CIDZGKyjUz++11oIUmb8TW4bL6l8pLiubViK5x3bSOdsLSyWcNVQTiE2FBgjWYlPm+WPlrjpT4SCO92H0bHobapg73+wWlWe63SeGy73RvH2mwP8bpAi/2/AqLF1Lf2BshxSgmlD+u3dsJx15vTZjRvWZrSC2eWU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(6072148); SRVR:BY1PR0701MB1723; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 4:JGVZYqabUWcCAvMOACJPDrz8ZPJwJHoU3zP5ulfN773AFu8tRiNXALL6h60Wfr852NoxAwLhfFojK6Yz5ETeMrCxm51Nq4apuQy5kehl29Dls/Oc3HOm0x7oZTJtfV1cbrVASO5mupz/t1rj9VWZgZlluF3VvoxBARrJqiUAZzVR3lT3y0Erz5qyNREHbU4EqBJ4yAhbNm/k4mUssHU6rMcVUQt4JcsMd7lc4HODKArchvGQL5fnym8uhijg+S3yZa63yzFVuIxQpIBr74oAYo44H/dIxKzWWHBnr/TmHW0+wEFYUZqdLrIlpXWZQMP5y4spD2jWQnz6NUoGVFBrDW7u9TeSFE3P/7tFlWm2KjAK5OlzBmDt08CliMHeVWK+wzgFlmEAaQB4Zfg1BwVGuC8mDL2WtbshRHQz8N6zcKfPrefQHUiSc37EuRnRCXHULjX//OUVZfg34+YnDhADXyu1YsxuQ6nCZOfkzzWkr6e5buaQvhjd8t6VpNwnFFpRQZBCX09qCFPI9jMnrR2eH0D7/47Hinhj9AJ2f/08YZ2qfhth/hHZqkVI9+4irLcwCJUzoGI5MdmzOtcS7m5cWg== X-Forefront-PRVS: 01480965DA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(199003)(189002)(101416001)(110136003)(6916009)(69596002)(4326007)(8666005)(106356001)(76176999)(2351001)(47776003)(97736004)(2906002)(107886002)(7846002)(5660300001)(92566002)(305945005)(48376002)(733004)(42882006)(68736007)(50986999)(39850400001)(50466002)(6666003)(36756003)(2950100002)(81156014)(105586002)(42186005)(3846002)(33646002)(81166006)(8676002)(5003940100001)(6512006)(6506006)(6486002)(53416004)(7736002)(189998001)(38730400001)(4001430100002)(6116002)(50226002)(39840400001)(39450400002)(39410400001)(66066001)(76506005)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1723; H:localhost.caveonetworks.com; 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; BY1PR0701MB1723; 23:0pbJsKVaWyouYSItkReMy/ICeiJ8oTGBntXnl2a?= =?us-ascii?Q?I7Xa2P6E/VmL1/DtS6ti1YcfVvYYwZuOF1j7pPypKsvrTodTafubbZXwl/z2?= =?us-ascii?Q?+BrxpcPQdD8qf4A3iuHF0gX4USauaUPx42HzM0lpZ1i8n+0RpYoIaPS7lkJR?= =?us-ascii?Q?SP2PKsX84IdAa9XdeB/gyBMXheG6a7TfGiCHPrC1S+41kT33M1z2157o6VEL?= =?us-ascii?Q?jHagtWmPeJlOB1dclnIYu9gKga5pv5d9h2OthSmOr29Oe+zyZ+0CsJStrvyP?= =?us-ascii?Q?13MFN2U1h99AWbzXJjtoYYHXmN7YZ6xWpP5z2xjt3lizhUUMBUJ3ycSckWfA?= =?us-ascii?Q?wy+fNk2o/lZPhnQ2NgiFLnu+UIKUnaBIASDkm4SdR6o9DZn36+PhGUxzMIRY?= =?us-ascii?Q?sxfD/ILWhbP5V4v9V4h2MXiH99w6ykqwXpwR5uJA30mNqFfTfIcwJl9D6dme?= =?us-ascii?Q?Io/TFI4w9mPwxSCYUrBC9ryVLiy7jBmqHnd0flr2H06eDOdzg9DeZfjxuSF+?= =?us-ascii?Q?POAGuOdQTUu4imqQ1Dy9RmdTL0uAE0VWcsgi1kLw+nThOlfxUwhgo4kcC2o5?= =?us-ascii?Q?Awu6BHtYxtXGVa40Nps+4fjCbgRrImf3nPlUhflljrgi2A+VgBLA5T/BSnHM?= =?us-ascii?Q?gY6bD24S1aMxpySuUh+BxIS4a1Fcix3fQcavjr98DoLFGV3RWhotEIAKg6sb?= =?us-ascii?Q?33BRp7bdwwmyPj/jjzzDeaajuoMb7CSNyezgsdl8hWrw1H4t7M5yi6JAPzVq?= =?us-ascii?Q?c+EVIMNOSKQNE8YQv5/fr2TXAG7kXK57IBNB7lnDdygPNgm9ksG8DQrz6z4M?= =?us-ascii?Q?7udWaBOe0W65j16m/ViMRAylLOqeX3Ihm94twfbxeHe0WNoakfKaec+QiDi0?= =?us-ascii?Q?sHPcUBkQBpDdjiGVW8KJfsp/rujFuLENd6f9MjsDK53Fs78vy4I33A3B/ocv?= =?us-ascii?Q?zA61RsXlg5KgVPkVpZS3dY6Tmg10yIS6jxS68aiO2m6q5a92HgcMq+1KYHnk?= =?us-ascii?Q?3HtoWFL9PC0lFlm3YzozuhwyE0xL8ggsT6cEUuuFfx08HiyIxTOZZLO3ZKRJ?= =?us-ascii?Q?Nd6GuNWgQkbj5JShyMJCprw5sXhaZ6+qiNEFXEUkXq7nL8riTrb9AVbzDlr6?= =?us-ascii?Q?qxJ0FqEJ2BzOO73gSdwty4bS6vHCxJkPVnxPoHACDhieIM+q2L1H8Vom1/yY?= =?us-ascii?Q?yfimUAyC3CZEO3vys0WtbLJt1ozvA4gcreKfqhTYmp5RjiD0YD237HpaCmFe?= =?us-ascii?Q?+JdrBPWHjBYKiXg7FHV+34ohlDQQDCIf27/tYAbNwKRQaSLucXRAIz9GuDh8?= =?us-ascii?Q?8ZV31iAHag95RUFy3+WikmAHw8OkH136s7v5AYS/p+wr9S9nscuckhRwrMrj?= =?us-ascii?Q?6jtKtOXBbDw/ZGJ3hRXeZXzmeCEx3Td0pNJO8amq+vXwLRWvG?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 6:nC54lkQbPb+FNDJ4snlPPPWt2wPm0YG1mGjipMHrDq/A/+sz7XP5EYK+oPJBQ12NQF57Hki2M5J+g8V0eWx8wghjD6+DYBFSzPikqLx/f/5gRgCNyNfosZLbD0OAbTVXF5ku/Vo+2oH43aaYe5Y28cX4ex+9pxIVnVwaHpX0VQZZl0opAr/j9zAji3UqHekY+T8RMMavmUwnrBcg/CGB3vi+6jNJKltwjpprUfnbuIcmAd22z65qKBBXNpspn0b6eKW9JIo1vcBBBRrIgkri2bKOodroEKPbqPc+MlkvTWjfqB3VqLEvuJO7K+4VgK511QSTNmPz0GgiGeytHtGD2E0IF01Cht5OKJhMbtegqhE=; 5:P2Lzd/Ch7K86j452aQGC1GQZPMe58mLuT2DhAP5HbFD73J0hnjtm2AEXUMJ6NIJbF0MsV9Uq+boLGsms01vQgy/wAvGOdjKjTwvsExqI3uKh3m/ehyoJS70l7BoVu40CoQRA1xke9DFi1/ZOEx3M2A==; 24:42KWYwT8cRUlqrv1PGMX1H4sYd2kWM7oBiBT6QJRwlDKf6pqUAJTUMkkKDjjJgrDsH4X1QPSJg8xBEextjOxQIU6ppEyl10ykndIpYYcUuI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 7:mmPtrx4mHfQBpF+1UuD3H64wlEXDSfRBWj3iFDaz6OVFtISFGaXbFwptJ6GU/tqr4hBgcm0+FgqflUsPV2N3nicCF9iUzppbLIu6qXooXhpwuw0QBuj/lG/trTLGWPXBHAbsk2obafGEzkaCaXAE3o6E6AfaQQQY/bS8V4YW/aO1YaEvsE4YlvndHB4mG5g06/+sNCMOcIcN9QYLx9iBaB7F6xlhLi+ofZ/lm2AG1xTrbiuklHaOwWKZyOdGh2AjUmA/PlbJGOtP68XIawtRQIQVB0IZSAdxea2fZwHR6wZgDlyaEH9DmxvEkeBGD4FtAdYEDVdyAGNtsfA3vY4ANPzgzcV5G6d+0FIIJh18+vk= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2016 03:52:54.6250 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: [dpdk-dev] [PATCH v2 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 --- MAINTAINERS | 1 + app/test/Makefile | 2 + app/test/test_eventdev.c | 775 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 778 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 5be023a..e28c079 100644 --- a/app/test/Makefile +++ b/app/test/Makefile @@ -197,6 +197,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..b5a4a83 --- /dev/null +++ b/app/test/test_eventdev.c @@ -0,0 +1,775 @@ +/*- + * 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_FLAG_ALL_TYPES & + RTE_EVENT_QUEUE_CFG_FLAG_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_FLAG_ORDERED_ONLY & + RTE_EVENT_QUEUE_CFG_FLAG_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_FLAG_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; + struct rte_event_queue_link links[RTE_EVENT_MAX_QUEUES_PER_DEV]; + + ret = rte_event_port_link(TEST_DEV_ID, 0, 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++) { + links[i].queue_id = i; + links[i].priority = RTE_EVENT_DEV_PRIORITY_NORMAL; + } + + ret = rte_event_port_link(TEST_DEV_ID, 0, links, 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]; + struct rte_event_queue_link links[RTE_EVENT_MAX_QUEUES_PER_DEV]; + + /* link all queues */ + ret = rte_event_port_link(TEST_DEV_ID, 0, 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, links); + 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++) { + links[i].queue_id = i; + links[i].priority = RTE_EVENT_DEV_PRIORITY_NORMAL; + } + ret = rte_event_port_link(TEST_DEV_ID, 0, links, 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, links); + 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 */ + links[0].queue_id = 0; + links[0].priority = RTE_EVENT_DEV_PRIORITY_NORMAL; + + ret = rte_event_port_link(TEST_DEV_ID, 0, links, 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, links); + 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++) { + links[i].queue_id = i; + links[i].priority = 0x40; + } + ret = rte_event_port_link(TEST_DEV_ID, 0, links, 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, links); + TEST_ASSERT(ret == 2, "(%d)Wrong link get ret=%d expected=%d", + TEST_DEV_ID, ret, 2); + TEST_ASSERT(links[0].queue_id == 2, "ret=%d expected=%d", + ret, 2); + TEST_ASSERT(links[0].priority == 0x40, "ret=%d expected=%d", + ret, 0x40); + TEST_ASSERT(links[1].queue_id == 3, "ret=%d expected=%d", + ret, 3); + TEST_ASSERT(links[1].priority == 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);