get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/17083/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 17083,
    "url": "https://patches.dpdk.org/api/patches/17083/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1479447902-3700-5-git-send-email-jerin.jacob@caviumnetworks.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1479447902-3700-5-git-send-email-jerin.jacob@caviumnetworks.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1479447902-3700-5-git-send-email-jerin.jacob@caviumnetworks.com",
    "date": "2016-11-18T05:45:02",
    "name": "[dpdk-dev,4/4] app/test: unit test case for eventdev APIs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e6c4890ee4a856c0a6f0b441fb268b7a768f263d",
    "submitter": {
        "id": 305,
        "url": "https://patches.dpdk.org/api/people/305/?format=api",
        "name": "Jerin Jacob",
        "email": "jerin.jacob@caviumnetworks.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1479447902-3700-5-git-send-email-jerin.jacob@caviumnetworks.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/17083/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/17083/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id F1529591F;\n\tFri, 18 Nov 2016 06:46:35 +0100 (CET)",
            "from NAM01-BY2-obe.outbound.protection.outlook.com\n\t(mail-by2nam01on0074.outbound.protection.outlook.com [104.47.34.74])\n\tby dpdk.org (Postfix) with ESMTP id C8E845684\n\tfor <dev@dpdk.org>; Fri, 18 Nov 2016 06:45:48 +0100 (CET)",
            "from localhost.net (50.254.132.37) by\n\tBY1PR0701MB1724.namprd07.prod.outlook.com (10.162.111.143) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12;\n\tFri, 18 Nov 2016 05:45:43 +0000"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=tnoDMtyRIAiOKonTVkZd1PzhY4wvXde/DIYfxYPHhAU=;\n\tb=Iwd1d4wTNYAwD891PeJwXkBPTQ88XfV86xvV29nH0bCbnvppI4lj9wdSFMr6Xbv08DTz0fAUC2sLYsatptlPyKFwkcSkGJf/wIv47PCKqwIaWwdPjhvhmTkM1kbLQfoapIdwmf+8LWvv+JyHVMmZ0Rn+5p16FrsNH9jnD+NRgUk=",
        "Authentication-Results": "spf=none (sender IP is )\n\tsmtp.mailfrom=Jerin.Jacob@cavium.com; ",
        "From": "Jerin Jacob <jerin.jacob@caviumnetworks.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<bruce.richardson@intel.com>, <harry.van.haaren@intel.com>,\n\t<hemant.agrawal@nxp.com>, <gage.eads@intel.com>, Jerin Jacob\n\t<jerin.jacob@caviumnetworks.com>",
        "Date": "Fri, 18 Nov 2016 11:15:02 +0530",
        "Message-ID": "<1479447902-3700-5-git-send-email-jerin.jacob@caviumnetworks.com>",
        "X-Mailer": "git-send-email 2.5.5",
        "In-Reply-To": "<1479447902-3700-1-git-send-email-jerin.jacob@caviumnetworks.com>",
        "References": "<1479447902-3700-1-git-send-email-jerin.jacob@caviumnetworks.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[50.254.132.37]",
        "X-ClientProxiedBy": "CY1PR1101CA0016.namprd11.prod.outlook.com (10.169.17.26)\n\tTo\n\tBY1PR0701MB1724.namprd07.prod.outlook.com (10.162.111.143)",
        "X-Microsoft-Exchange-Diagnostics": [
            "1; BY1PR0701MB1724;\n\t2:ZRaeA3MCg72bXXXioHsGkhK45dehlbbmKtK54iAqC1HsOiWCOYchZNwuwEA162RWcqb98S/1kspNLIzGyi+fY6jAMoFIkQG3L1EiQojUTUUYu+qph4OsKONoi71doQUwBSiDk7ty3wtjs06nx5fUaYopH81HiDUbkPqCq13WM80=;\n\t3:4884m0TYu6EeA2C7BvtzTtKU0+R3rzNJ7al6mlmgYoJL3XzYOrZDTfORb/vivn+UGdFFdF8595Cnc6A7/fBTlytTypOHPCZ9o9ScO3HrU7QQCHXyMIgZW3JICr60+kb0a+GGoM9ZeigYppeD1eQSc5bmRwBpEcmebOo9gV4/jQo=",
            "1; BY1PR0701MB1724;\n\t25:fXWXgwbmIYmNsiTr9B+bzqJrIR/f2pLo7WOzZWnegJ/OSk+0tiWTBGYcwnPFu2gtYJPUARJ41NLAG0ps62Rr0vB9E49PBgwzISTOMhHzThXmUpFi5wcrznVvsm1UacKBi4bbMjncrRbYsarwIUNOHrJ8kQCfT4Bg+xjSZI7mDknB5kUNY2DOZvb5yPJos0fCr7bBdPpjYWV5ivFK79VKotyfJwx0zlvniXKWgpxELziVpb6C+1ffQcpy/HqNowCWdgrKIqicyP7qyTII71rdbCGz8H5pEpgR3scUUaPSzCn12whoZQgP7ixDcWlZEs8ahaYuBAVuzTZz88hCg+4aXE93H7gcwNpk/gODAd3c6VXgBFkrctJU8BjANdA5k79LX0gdLy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W31lCfYM1+Y+yQEefaI4cGwQp702ZXwhdCMDB6Gql63fkr8FvjZUJ1wOwAhmsI3KhEz+BdzNzLaBABLg8NI2pTRvDrYveG9rmDpUu8P+3PAWPbZ971JRw5JkM5uiWPKDClWwv4vbV6L8FHbXzqNjTfQFrG0BX8gMBl1gEma0D33A1useQPpdTdw97BrZ3+v5WtREbRUkVBBUYa97nKR/n2+dM7H4XXrBqE0JqmDyRXRVGHruwv+vqYEJb++y6ZlbuCPX9QpamhQ6kdPvDVp0="
        ],
        "X-MS-Office365-Filtering-Correlation-Id": "84694bcb-f8f5-4fa0-85a2-08d40f762345",
        "X-Microsoft-Antispam": "UriScan:; BCL:0; PCL:0; RULEID:(22001);\n\tSRVR:BY1PR0701MB1724; ",
        "X-Microsoft-Antispam-PRVS": "<BY1PR0701MB17241ABA3C60F22EFF26EB6481B00@BY1PR0701MB1724.namprd07.prod.outlook.com>",
        "X-Exchange-Antispam-Report-Test": "UriScan:;",
        "X-Exchange-Antispam-Report-CFA-Test": "BCL:0; PCL:0;\n\tRULEID:(6060326)(6040281)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6061324)(6041223);\n\tSRVR:BY1PR0701MB1724; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1724; ",
        "X-Forefront-PRVS": "01304918F3",
        "X-Forefront-Antispam-Report": "SFV:NSPM;\n\tSFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(189002)(199003)(68736007)(66066001)(3846002)(7736002)(50226002)(69596002)(81166006)(47776003)(4326007)(4001430100002)(48376002)(6116002)(8676002)(81156014)(8666005)(42186005)(33026002)(105586002)(2351001)(92566002)(2906002)(7846002)(50466002)(50986999)(110136003)(5660300001)(76176999)(42882006)(33646002)(6916009)(189998001)(21086003)(107886002)(36756003)(305945005)(2950100002)(6666003)(101416001)(97736004)(77096005)(5003940100001)(106356001)(76506005)(7059030);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1724; H:localhost.net; FPR:;\n\tSPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; ",
        "Received-SPF": "None (protection.outlook.com: cavium.com does not designate\n\tpermitted sender hosts)",
        "SpamDiagnosticOutput": "1:99",
        "SpamDiagnosticMetadata": "NSPM",
        "X-OriginatorOrg": "caviumnetworks.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "18 Nov 2016 05:45:43.2634\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "Hosted",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "BY1PR0701MB1724",
        "Subject": "[dpdk-dev] [PATCH 4/4] app/test: unit test case for eventdev APIs",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This commit adds basic unit tests for the eventdev API.\n\ncommands to run the test app:\n./build/app/test -c 2\nRTE>>eventdev_common_autotest\n\nSigned-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>\n---\n MAINTAINERS              |   1 +\n app/test/Makefile        |   2 +\n app/test/test_eventdev.c | 776 +++++++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 779 insertions(+)\n create mode 100644 app/test/test_eventdev.c",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex c594a23..887f133 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -252,6 +252,7 @@ F: examples/l2fwd-crypto/\n Eventdev API - EXPERIMENTAL\n M: Jerin Jacob <jerin.jacob@caviumnetworks.com>\n F: lib/librte_eventdev/\n+F: app/test/test_eventdev*\n F: drivers/event/skeleton/\n \n Networking Drivers\ndiff --git a/app/test/Makefile b/app/test/Makefile\nindex 5be023a..e28c079 100644\n--- a/app/test/Makefile\n+++ b/app/test/Makefile\n@@ -197,6 +197,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c\n SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_perf.c\n SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c\n \n+SRCS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += test_eventdev.c\n+\n SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) += test_kvargs.c\n \n CFLAGS += -O3\ndiff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c\nnew file mode 100644\nindex 0000000..e876804\n--- /dev/null\n+++ b/app/test/test_eventdev.c\n@@ -0,0 +1,776 @@\n+/*-\n+ *   BSD LICENSE\n+ *\n+ *   Copyright(c) 2016 Cavium networks. All rights reserved.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *\t * Redistributions of source code must retain the above copyright\n+ *\t   notice, this list of conditions and the following disclaimer.\n+ *\t * Redistributions in binary form must reproduce the above copyright\n+ *\t   notice, this list of conditions and the following disclaimer in\n+ *\t   the documentation and/or other materials provided with the\n+ *\t   distribution.\n+ *\t * Neither the name of Cavium networks nor the names of its\n+ *\t   contributors may be used to endorse or promote products derived\n+ *\t   from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include <rte_common.h>\n+#include <rte_hexdump.h>\n+#include <rte_mbuf.h>\n+#include <rte_malloc.h>\n+#include <rte_memcpy.h>\n+#include <rte_eventdev.h>\n+#include <rte_cryptodev.h>\n+\n+#include \"test.h\"\n+\n+#define TEST_DEV_NAME EVENTDEV_NAME_SKELETON_PMD\n+\n+static inline uint8_t\n+test_dev_id_get(void)\n+{\n+\treturn rte_event_dev_get_dev_id(RTE_STR(TEST_DEV_NAME)\"_0\");\n+}\n+\n+static int\n+testsuite_setup(void)\n+{\n+\treturn rte_eal_vdev_init(RTE_STR(TEST_DEV_NAME), NULL);\n+}\n+\n+static void\n+testsuite_teardown(void)\n+{\n+}\n+\n+static int\n+test_eventdev_count(void)\n+{\n+\tuint8_t count;\n+\tcount = rte_event_dev_count();\n+\tTEST_ASSERT(count > 0, \"Invalid eventdev count %\" PRIu8, count);\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_eventdev_get_dev_id(void)\n+{\n+\tint ret;\n+\tret = rte_event_dev_get_dev_id(RTE_STR(TEST_DEV_NAME)\"_0\");\n+\tTEST_ASSERT(ret >= 0, \"Failed to get dev_id %d\", ret);\n+\tret = rte_event_dev_get_dev_id(\"not_a_valid_ethdev_driver\");\n+\tTEST_ASSERT_FAIL(ret, \"Expected <0 for invalid dev name ret=%d\", ret);\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_eventdev_socket_id(void)\n+{\n+\tint ret, socket_id;\n+\tret = rte_event_dev_get_dev_id(RTE_STR(TEST_DEV_NAME)\"_0\");\n+\tsocket_id = rte_event_dev_socket_id(ret);\n+\tTEST_ASSERT(socket_id != -EINVAL, \"Failed to get socket_id %d\",\n+\t\t\t\tsocket_id);\n+\tsocket_id = rte_event_dev_socket_id(RTE_EVENT_MAX_DEVS);\n+\tTEST_ASSERT(socket_id == -EINVAL, \"Expected -EINVAL %d\", socket_id);\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_eventdev_info_get(void)\n+{\n+\tint ret;\n+\tstruct rte_event_dev_info info;\n+\tret = rte_event_dev_info_get(test_dev_id_get(), NULL);\n+\tTEST_ASSERT(ret == -EINVAL, \"Expected -EINVAL, %d\", ret);\n+\tret = rte_event_dev_info_get(test_dev_id_get(), &info);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to get event dev info\");\n+\tTEST_ASSERT(info.max_event_ports > 0,\n+\t\t\t\"Not enough event ports %d\", info.max_event_ports);\n+\tTEST_ASSERT(info.max_event_queues > 0,\n+\t\t\t\"Not enough event queues %d\", info.max_event_queues);\n+\treturn TEST_SUCCESS;\n+}\n+\n+static inline void\n+devconf_set_default_sane_values(struct rte_event_dev_config *dev_conf,\n+\t\t\tstruct rte_event_dev_info *info)\n+{\n+\tmemset(dev_conf, 0, sizeof(struct rte_event_dev_config));\n+\tdev_conf->dequeue_wait_ns = info->min_dequeue_wait_ns;\n+\tdev_conf->nb_event_ports = info->max_event_ports;\n+\tdev_conf->nb_event_queues = info->max_event_queues;\n+\tdev_conf->nb_event_queue_flows = info->max_event_queue_flows;\n+\tdev_conf->nb_event_port_dequeue_depth =\n+\t\t\tinfo->max_event_port_dequeue_depth;\n+\tdev_conf->nb_event_port_enqueue_depth =\n+\t\t\tinfo->max_event_port_enqueue_depth;\n+\tdev_conf->nb_event_port_enqueue_depth =\n+\t\t\tinfo->max_event_port_enqueue_depth;\n+\tdev_conf->nb_events_limit =\n+\t\t\tinfo->max_num_events;\n+}\n+\n+static int\n+test_ethdev_config_run(struct rte_event_dev_config *dev_conf,\n+\t\tstruct rte_event_dev_info *info,\n+\t\tvoid (*fn)(struct rte_event_dev_config *dev_conf,\n+\t\t\tstruct rte_event_dev_info *info))\n+{\n+\tdevconf_set_default_sane_values(dev_conf, info);\n+\tfn(dev_conf, info);\n+\treturn rte_event_dev_configure(test_dev_id_get(), dev_conf);\n+}\n+\n+static void\n+min_dequeue_limit(struct rte_event_dev_config *dev_conf,\n+\t\t  struct rte_event_dev_info *info)\n+{\n+\tdev_conf->dequeue_wait_ns = info->min_dequeue_wait_ns - 1;\n+}\n+\n+static void\n+max_dequeue_limit(struct rte_event_dev_config *dev_conf,\n+\t\t  struct rte_event_dev_info *info)\n+{\n+\tdev_conf->dequeue_wait_ns = info->max_dequeue_wait_ns + 1;\n+}\n+\n+static void\n+max_events_limit(struct rte_event_dev_config *dev_conf,\n+\t\t  struct rte_event_dev_info *info)\n+{\n+\tdev_conf->nb_events_limit  = info->max_num_events + 1;\n+}\n+\n+static void\n+max_event_ports(struct rte_event_dev_config *dev_conf,\n+\t\t  struct rte_event_dev_info *info)\n+{\n+\tdev_conf->nb_event_ports = info->max_event_ports + 1;\n+}\n+\n+static void\n+max_event_queues(struct rte_event_dev_config *dev_conf,\n+\t\t  struct rte_event_dev_info *info)\n+{\n+\tdev_conf->nb_event_queues = info->max_event_queues + 1;\n+}\n+\n+static void\n+max_event_queue_flows(struct rte_event_dev_config *dev_conf,\n+\t\t  struct rte_event_dev_info *info)\n+{\n+\tdev_conf->nb_event_queue_flows = info->max_event_queue_flows + 1;\n+}\n+\n+static void\n+max_event_port_dequeue_depth(struct rte_event_dev_config *dev_conf,\n+\t\t  struct rte_event_dev_info *info)\n+{\n+\tdev_conf->nb_event_port_dequeue_depth =\n+\t\tinfo->max_event_port_dequeue_depth + 1;\n+}\n+\n+static void\n+max_event_port_enqueue_depth(struct rte_event_dev_config *dev_conf,\n+\t\t  struct rte_event_dev_info *info)\n+{\n+\tdev_conf->nb_event_port_enqueue_depth =\n+\t\tinfo->max_event_port_enqueue_depth + 1;\n+}\n+\n+\n+static int\n+test_eventdev_configure(void)\n+{\n+\tint ret;\n+\tstruct rte_event_dev_config dev_conf;\n+\tstruct rte_event_dev_info info;\n+\tret = rte_event_dev_configure(test_dev_id_get(), NULL);\n+\tTEST_ASSERT(ret == -EINVAL, \"Expected -EINVAL, %d\", ret);\n+\n+\tret = rte_event_dev_info_get(test_dev_id_get(), &info);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to get event dev info\");\n+\n+\t/* Check limits */\n+\tTEST_ASSERT_EQUAL(-EINVAL,\n+\t\ttest_ethdev_config_run(&dev_conf, &info, min_dequeue_limit),\n+\t\t \"Config negative test failed\");\n+\tTEST_ASSERT_EQUAL(-EINVAL,\n+\t\ttest_ethdev_config_run(&dev_conf, &info, max_dequeue_limit),\n+\t\t \"Config negative test failed\");\n+\tTEST_ASSERT_EQUAL(-EINVAL,\n+\t\ttest_ethdev_config_run(&dev_conf, &info, max_events_limit),\n+\t\t \"Config negative test failed\");\n+\tTEST_ASSERT_EQUAL(-EINVAL,\n+\t\ttest_ethdev_config_run(&dev_conf, &info, max_event_ports),\n+\t\t \"Config negative test failed\");\n+\tTEST_ASSERT_EQUAL(-EINVAL,\n+\t\ttest_ethdev_config_run(&dev_conf, &info, max_event_queues),\n+\t\t \"Config negative test failed\");\n+\tTEST_ASSERT_EQUAL(-EINVAL,\n+\t\ttest_ethdev_config_run(&dev_conf, &info, max_event_queue_flows),\n+\t\t \"Config negative test failed\");\n+\tTEST_ASSERT_EQUAL(-EINVAL,\n+\t\ttest_ethdev_config_run(&dev_conf, &info,\n+\t\t\tmax_event_port_dequeue_depth),\n+\t\t\t \"Config negative test failed\");\n+\tTEST_ASSERT_EQUAL(-EINVAL,\n+\t\ttest_ethdev_config_run(&dev_conf, &info,\n+\t\tmax_event_port_enqueue_depth),\n+\t\t \"Config negative test failed\");\n+\n+\t/* Positive case */\n+\tdevconf_set_default_sane_values(&dev_conf, &info);\n+\tret = rte_event_dev_configure(test_dev_id_get(), &dev_conf);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to configure eventdev\");\n+\n+\t/* re-configure */\n+\tdevconf_set_default_sane_values(&dev_conf, &info);\n+\tdev_conf.nb_event_ports = info.max_event_ports/2;\n+\tdev_conf.nb_event_queues = info.max_event_queues/2;\n+\tret = rte_event_dev_configure(test_dev_id_get(), &dev_conf);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to re configure eventdev\");\n+\n+\t/* re-configure back to max_event_queues and max_event_ports */\n+\tdevconf_set_default_sane_values(&dev_conf, &info);\n+\tret = rte_event_dev_configure(test_dev_id_get(), &dev_conf);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to re-configure eventdev\");\n+\n+\treturn TEST_SUCCESS;\n+\n+}\n+\n+static int\n+eventdev_configure_setup(void)\n+{\n+\tint ret;\n+\tstruct rte_event_dev_config dev_conf;\n+\tstruct rte_event_dev_info info;\n+\n+\tret = rte_event_dev_info_get(test_dev_id_get(), &info);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to get event dev info\");\n+\tdevconf_set_default_sane_values(&dev_conf, &info);\n+\tret = rte_event_dev_configure(test_dev_id_get(), &dev_conf);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to configure eventdev\");\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_eventdev_queue_default_conf_get(void)\n+{\n+\tint i, ret;\n+\tstruct rte_event_queue_conf qconf;\n+\n+\tret = rte_event_queue_default_conf_get(test_dev_id_get(), 0, NULL);\n+\tTEST_ASSERT(ret == -EINVAL, \"Expected -EINVAL, %d\", ret);\n+\n+\tfor (i = 0; i < rte_event_queue_count(test_dev_id_get()); i++) {\n+\t\tret = rte_event_queue_default_conf_get(test_dev_id_get(), i,\n+\t\t\t\t\t\t &qconf);\n+\t\tTEST_ASSERT_SUCCESS(ret, \"Failed to get queue%d info\", i);\n+\t}\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_eventdev_queue_setup(void)\n+{\n+\tint i, ret;\n+\tstruct rte_event_dev_info info;\n+\tstruct rte_event_queue_conf qconf;\n+\n+\tret = rte_event_dev_info_get(test_dev_id_get(), &info);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to get event dev info\");\n+\n+\t/* Negative cases */\n+\tret = rte_event_queue_default_conf_get(test_dev_id_get(), 0, &qconf);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to get queue0 info\");\n+\tqconf.event_queue_cfg =\t(RTE_EVENT_QUEUE_CFG_ALL_TYPES &\n+\t\t RTE_EVENT_QUEUE_CFG_TYPE_MASK);\n+\tqconf.nb_atomic_flows = info.max_event_queue_flows + 1;\n+\tret = rte_event_queue_setup(test_dev_id_get(), 0, &qconf);\n+\tTEST_ASSERT(ret == -EINVAL, \"Expected -EINVAL, %d\", ret);\n+\n+\tqconf.nb_atomic_flows = info.max_event_queue_flows;\n+\tqconf.event_queue_cfg =\t(RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY &\n+\t\t RTE_EVENT_QUEUE_CFG_TYPE_MASK);\n+\tqconf.nb_atomic_order_sequences = info.max_event_queue_flows + 1;\n+\tret = rte_event_queue_setup(test_dev_id_get(), 0, &qconf);\n+\tTEST_ASSERT(ret == -EINVAL, \"Expected -EINVAL, %d\", ret);\n+\n+\tret = rte_event_queue_setup(test_dev_id_get(), info.max_event_queues,\n+\t\t\t\t\t&qconf);\n+\tTEST_ASSERT(ret == -EINVAL, \"Expected -EINVAL, %d\", ret);\n+\n+\t/* Positive case */\n+\tret = rte_event_queue_default_conf_get(test_dev_id_get(), 0, &qconf);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to get queue0 info\");\n+\tret = rte_event_queue_setup(test_dev_id_get(), 0, &qconf);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to setup queue0\");\n+\n+\n+\tfor (i = 0; i < rte_event_queue_count(test_dev_id_get()); i++) {\n+\t\tret = rte_event_queue_setup(test_dev_id_get(), i, NULL);\n+\t\tTEST_ASSERT_SUCCESS(ret, \"Failed to setup queue%d\", i);\n+\t}\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_eventdev_queue_count(void)\n+{\n+\tint ret;\n+\tstruct rte_event_dev_info info;\n+\n+\tret = rte_event_dev_info_get(test_dev_id_get(), &info);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to get event dev info\");\n+\n+\tTEST_ASSERT_EQUAL(rte_event_queue_count(test_dev_id_get()),\n+\t\t info.max_event_queues, \"Wrong queue count\");\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_eventdev_queue_priority(void)\n+{\n+\tint i, ret;\n+\tstruct rte_event_dev_info info;\n+\tstruct rte_event_queue_conf qconf;\n+\tuint8_t priority;\n+\n+\tret = rte_event_dev_info_get(test_dev_id_get(), &info);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to get event dev info\");\n+\n+\tfor (i = 0; i < rte_event_queue_count(test_dev_id_get()); i++) {\n+\t\tret = rte_event_queue_default_conf_get(test_dev_id_get(), i,\n+\t\t\t\t\t&qconf);\n+\t\tTEST_ASSERT_SUCCESS(ret, \"Failed to get queue%d def conf\", i);\n+\t\tqconf.priority = i %  RTE_EVENT_QUEUE_PRIORITY_LOWEST;\n+\t\tret = rte_event_queue_setup(test_dev_id_get(), i, &qconf);\n+\t\tTEST_ASSERT_SUCCESS(ret, \"Failed to setup queue%d\", i);\n+\t}\n+\n+\tfor (i = 0; i < rte_event_queue_count(test_dev_id_get()); i++) {\n+\t\tpriority =  rte_event_queue_priority(test_dev_id_get(), i);\n+\t\tif (info.event_dev_cap & RTE_EVENT_DEV_CAP_QUEUE_QOS)\n+\t\t\tTEST_ASSERT_EQUAL(priority,\n+\t\t\t i %  RTE_EVENT_QUEUE_PRIORITY_LOWEST,\n+\t\t\t \"Wrong priority value for queue%d\", i);\n+\t\telse\n+\t\t\tTEST_ASSERT_EQUAL(priority,\n+\t\t\t RTE_EVENT_QUEUE_PRIORITY_NORMAL,\n+\t\t\t \"Wrong priority value for queue%d\", i);\n+\t}\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_eventdev_port_default_conf_get(void)\n+{\n+\tint i, ret;\n+\tstruct rte_event_port_conf pconf;\n+\n+\tret = rte_event_port_default_conf_get(test_dev_id_get(), 0, NULL);\n+\tTEST_ASSERT(ret == -EINVAL, \"Expected -EINVAL, %d\", ret);\n+\n+\tret = rte_event_port_default_conf_get(test_dev_id_get(),\n+\t\t\trte_event_port_count(test_dev_id_get()) + 1, NULL);\n+\tTEST_ASSERT(ret == -EINVAL, \"Expected -EINVAL, %d\", ret);\n+\n+\tfor (i = 0; i < rte_event_port_count(test_dev_id_get()); i++) {\n+\t\tret = rte_event_port_default_conf_get(test_dev_id_get(), i,\n+\t\t\t\t\t\t\t&pconf);\n+\t\tTEST_ASSERT_SUCCESS(ret, \"Failed to get port%d info\", i);\n+\t}\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_eventdev_port_setup(void)\n+{\n+\tint i, ret;\n+\tstruct rte_event_dev_info info;\n+\tstruct rte_event_port_conf pconf;\n+\n+\tret = rte_event_dev_info_get(test_dev_id_get(), &info);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to get event dev info\");\n+\n+\t/* Negative cases */\n+\tret = rte_event_port_default_conf_get(test_dev_id_get(), 0, &pconf);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to get port0 info\");\n+\tpconf.new_event_threshold = info.max_num_events + 1;\n+\tret = rte_event_port_setup(test_dev_id_get(), 0, &pconf);\n+\tTEST_ASSERT(ret == -EINVAL, \"Expected -EINVAL, %d\", ret);\n+\n+\tpconf.new_event_threshold = info.max_num_events;\n+\tpconf.dequeue_depth = info.max_event_port_dequeue_depth + 1;\n+\tret = rte_event_port_setup(test_dev_id_get(), 0, &pconf);\n+\tTEST_ASSERT(ret == -EINVAL, \"Expected -EINVAL, %d\", ret);\n+\n+\tpconf.dequeue_depth = info.max_event_port_dequeue_depth;\n+\tpconf.enqueue_depth = info.max_event_port_enqueue_depth + 1;\n+\tret = rte_event_port_setup(test_dev_id_get(), 0, &pconf);\n+\tTEST_ASSERT(ret == -EINVAL, \"Expected -EINVAL, %d\", ret);\n+\n+\tret = rte_event_port_setup(test_dev_id_get(), info.max_event_ports,\n+\t\t\t\t\t&pconf);\n+\tTEST_ASSERT(ret == -EINVAL, \"Expected -EINVAL, %d\", ret);\n+\n+\t/* Positive case */\n+\tret = rte_event_port_default_conf_get(test_dev_id_get(), 0, &pconf);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to get port0 info\");\n+\tret = rte_event_port_setup(test_dev_id_get(), 0, &pconf);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to setup port0\");\n+\n+\n+\tfor (i = 0; i < rte_event_port_count(test_dev_id_get()); i++) {\n+\t\tret = rte_event_port_setup(test_dev_id_get(), i, NULL);\n+\t\tTEST_ASSERT_SUCCESS(ret, \"Failed to setup port%d\", i);\n+\t}\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_eventdev_dequeue_depth(void)\n+{\n+\tint ret;\n+\tstruct rte_event_dev_info info;\n+\tstruct rte_event_port_conf pconf;\n+\n+\tret = rte_event_dev_info_get(test_dev_id_get(), &info);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to get event dev info\");\n+\n+\tret = rte_event_port_default_conf_get(test_dev_id_get(), 0, &pconf);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to get port0 info\");\n+\tret = rte_event_port_setup(test_dev_id_get(), 0, &pconf);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to setup port0\");\n+\n+\tTEST_ASSERT_EQUAL(rte_event_port_dequeue_depth(test_dev_id_get(), 0),\n+\t\t pconf.dequeue_depth, \"Wrong port dequeue depth\");\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_eventdev_enqueue_depth(void)\n+{\n+\tint ret;\n+\tstruct rte_event_dev_info info;\n+\tstruct rte_event_port_conf pconf;\n+\n+\tret = rte_event_dev_info_get(test_dev_id_get(), &info);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to get event dev info\");\n+\n+\tret = rte_event_port_default_conf_get(test_dev_id_get(), 0, &pconf);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to get port0 info\");\n+\tret = rte_event_port_setup(test_dev_id_get(), 0, &pconf);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to setup port0\");\n+\n+\tTEST_ASSERT_EQUAL(rte_event_port_enqueue_depth(test_dev_id_get(), 0),\n+\t\t pconf.enqueue_depth, \"Wrong port enqueue depth\");\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_eventdev_port_count(void)\n+{\n+\tint ret;\n+\tstruct rte_event_dev_info info;\n+\n+\tret = rte_event_dev_info_get(test_dev_id_get(), &info);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to get event dev info\");\n+\n+\tTEST_ASSERT_EQUAL(rte_event_port_count(test_dev_id_get()),\n+\t\t info.max_event_ports, \"Wrong port count\");\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_eventdev_wait_time(void)\n+{\n+\tint ret;\n+\tuint64_t wait_ticks;\n+\n+\tret = rte_event_dequeue_wait_time(test_dev_id_get(), 100, &wait_ticks);\n+\tTEST_ASSERT_SUCCESS(ret, \"Fail to get wait_time\");\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+\n+static int\n+test_eventdev_start_stop(void)\n+{\n+\tint i, ret;\n+\n+\tret = eventdev_configure_setup();\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to configure eventdev\");\n+\n+\tfor (i = 0; i < rte_event_queue_count(test_dev_id_get()); i++) {\n+\t\tret = rte_event_queue_setup(test_dev_id_get(), i, NULL);\n+\t\tTEST_ASSERT_SUCCESS(ret, \"Failed to setup queue%d\", i);\n+\t}\n+\n+\tfor (i = 0; i < rte_event_port_count(test_dev_id_get()); i++) {\n+\t\tret = rte_event_port_setup(test_dev_id_get(), i, NULL);\n+\t\tTEST_ASSERT_SUCCESS(ret, \"Failed to setup port%d\", i);\n+\t}\n+\n+\tret = rte_event_dev_start(test_dev_id_get());\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to start device%d\", test_dev_id_get());\n+\n+\trte_event_dev_stop(test_dev_id_get());\n+\treturn TEST_SUCCESS;\n+}\n+\n+\n+static int\n+eventdev_setup_device(void)\n+{\n+\tint i, ret;\n+\n+\tret = eventdev_configure_setup();\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to configure eventdev\");\n+\n+\tfor (i = 0; i < rte_event_queue_count(test_dev_id_get()); i++) {\n+\t\tret = rte_event_queue_setup(test_dev_id_get(), i, NULL);\n+\t\tTEST_ASSERT_SUCCESS(ret, \"Failed to setup queue%d\", i);\n+\t}\n+\n+\tfor (i = 0; i < rte_event_port_count(test_dev_id_get()); i++) {\n+\t\tret = rte_event_port_setup(test_dev_id_get(), i, NULL);\n+\t\tTEST_ASSERT_SUCCESS(ret, \"Failed to setup port%d\", i);\n+\t}\n+\n+\tret = rte_event_dev_start(test_dev_id_get());\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to start device%d\", test_dev_id_get());\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static void\n+eventdev_stop_device(void)\n+{\n+\trte_event_dev_stop(test_dev_id_get());\n+}\n+\n+static int\n+test_eventdev_link(void)\n+{\n+\tint ret, nb_queues, i;\n+\tstruct rte_event_queue_link links[RTE_EVENT_MAX_QUEUES_PER_DEV];\n+\n+\tret = rte_event_port_link(test_dev_id_get(), 0, NULL, 0);\n+\tTEST_ASSERT(ret >= 0, \"Failed to link with NULL device%d\",\n+\t\t\t\t test_dev_id_get());\n+\n+\tnb_queues = rte_event_queue_count(test_dev_id_get());\n+\tfor (i = 0; i < nb_queues; i++) {\n+\t\tlinks[i].queue_id = i;\n+\t\tlinks[i].priority = RTE_EVENT_QUEUE_SERVICE_PRIORITY_NORMAL;\n+\t}\n+\n+\tret = rte_event_port_link(test_dev_id_get(), 0, links, nb_queues);\n+\tTEST_ASSERT(ret == nb_queues, \"Failed to link(device%d) ret=%d\",\n+\t\t\t\t test_dev_id_get(), ret);\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_eventdev_unlink(void)\n+{\n+\tint ret, nb_queues, i;\n+\tuint8_t queues[RTE_EVENT_MAX_QUEUES_PER_DEV];\n+\n+\tret = rte_event_port_unlink(test_dev_id_get(), 0, NULL, 0);\n+\tTEST_ASSERT(ret >= 0, \"Failed to unlink with NULL device%d\",\n+\t\t\t\t test_dev_id_get());\n+\n+\tnb_queues = rte_event_queue_count(test_dev_id_get());\n+\tfor (i = 0; i < nb_queues; i++)\n+\t\tqueues[i] = i;\n+\n+\n+\tret = rte_event_port_unlink(test_dev_id_get(), 0, queues, nb_queues);\n+\tTEST_ASSERT(ret == nb_queues, \"Failed to unlink(device%d) ret=%d\",\n+\t\t\t\t test_dev_id_get(), ret);\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_eventdev_link_get(void)\n+{\n+\tint ret, nb_queues, i;\n+\tuint8_t queues[RTE_EVENT_MAX_QUEUES_PER_DEV];\n+\tstruct rte_event_queue_link links[RTE_EVENT_MAX_QUEUES_PER_DEV];\n+\n+\t/* link all queues */\n+\tret = rte_event_port_link(test_dev_id_get(), 0, NULL, 0);\n+\tTEST_ASSERT(ret >= 0, \"Failed to link with NULL device%d\",\n+\t\t\t\t test_dev_id_get());\n+\n+\tnb_queues = rte_event_queue_count(test_dev_id_get());\n+\tfor (i = 0; i < nb_queues; i++)\n+\t\tqueues[i] = i;\n+\n+\tret = rte_event_port_unlink(test_dev_id_get(), 0, queues, nb_queues);\n+\tTEST_ASSERT(ret == nb_queues, \"Failed to unlink(device%d) ret=%d\",\n+\t\t\t\t test_dev_id_get(), ret);\n+\n+\tret = rte_event_port_links_get(test_dev_id_get(), 0, links);\n+\tTEST_ASSERT(ret == 0, \"(%d)Wrong link get=%d\", test_dev_id_get(), ret);\n+\n+\t/* link all queues and get the links */\n+\tnb_queues = rte_event_queue_count(test_dev_id_get());\n+\tfor (i = 0; i < nb_queues; i++) {\n+\t\tlinks[i].queue_id = i;\n+\t\tlinks[i].priority = RTE_EVENT_QUEUE_SERVICE_PRIORITY_NORMAL;\n+\t}\n+\tret = rte_event_port_link(test_dev_id_get(), 0, links, nb_queues);\n+\tTEST_ASSERT(ret == nb_queues, \"Failed to link(device%d) ret=%d\",\n+\t\t\t\t test_dev_id_get(), ret);\n+\tret = rte_event_port_links_get(test_dev_id_get(), 0, links);\n+\tTEST_ASSERT(ret == nb_queues, \"(%d)Wrong link get ret=%d expected=%d\",\n+\t\t\t\t test_dev_id_get(), ret, nb_queues);\n+\t/* unlink all*/\n+\tret = rte_event_port_unlink(test_dev_id_get(), 0, NULL, 0);\n+\tTEST_ASSERT(ret == nb_queues, \"Failed to unlink(device%d) ret=%d\",\n+\t\t\t\t test_dev_id_get(), ret);\n+\t/* link just one queue */\n+\tlinks[0].queue_id = 0;\n+\tlinks[0].priority = RTE_EVENT_QUEUE_SERVICE_PRIORITY_NORMAL;\n+\n+\tret = rte_event_port_link(test_dev_id_get(), 0, links, 1);\n+\tTEST_ASSERT(ret == 1, \"Failed to link(device%d) ret=%d\",\n+\t\t\t\t test_dev_id_get(), ret);\n+\tret = rte_event_port_links_get(test_dev_id_get(), 0, links);\n+\tTEST_ASSERT(ret == 1, \"(%d)Wrong link get ret=%d expected=%d\",\n+\t\t\t\t\ttest_dev_id_get(), ret, 1);\n+\t/* unlink all*/\n+\tret = rte_event_port_unlink(test_dev_id_get(), 0, NULL, 0);\n+\tTEST_ASSERT(ret == nb_queues, \"Failed to unlink(device%d) ret=%d\",\n+\t\t\t\t test_dev_id_get(), ret);\n+\t/* 4links and 2 unlinks */\n+\tnb_queues = rte_event_queue_count(test_dev_id_get());\n+\tif (nb_queues >= 4) {\n+\t\tfor (i = 0; i < 4; i++) {\n+\t\t\tlinks[i].queue_id = i;\n+\t\t\tlinks[i].priority = 0x40;\n+\t\t}\n+\t\tret = rte_event_port_link(test_dev_id_get(), 0, links, 4);\n+\t\tTEST_ASSERT(ret == 4, \"Failed to link(device%d) ret=%d\",\n+\t\t\t\t\t test_dev_id_get(), ret);\n+\n+\t\tfor (i = 0; i < 2; i++)\n+\t\t\tqueues[i] = i;\n+\n+\t\tret = rte_event_port_unlink(test_dev_id_get(), 0, queues, 2);\n+\t\tTEST_ASSERT(ret == 2, \"Failed to unlink(device%d) ret=%d\",\n+\t\t\t\t\t test_dev_id_get(), ret);\n+\t\tret = rte_event_port_links_get(test_dev_id_get(), 0, links);\n+\t\tTEST_ASSERT(ret == 2, \"(%d)Wrong link get ret=%d expected=%d\",\n+\t\t\t\t\t\ttest_dev_id_get(), ret, 2);\n+\t\tTEST_ASSERT(links[0].queue_id == 2, \"ret=%d expected=%d\",\n+\t\t\t\t\tret, 2);\n+\t\tTEST_ASSERT(links[0].priority == 0x40, \"ret=%d expected=%d\",\n+\t\t\t\t\tret, 0x40);\n+\t\tTEST_ASSERT(links[1].queue_id == 3, \"ret=%d expected=%d\",\n+\t\t\t\t\tret, 3);\n+\t\tTEST_ASSERT(links[1].priority == 0x40, \"ret=%d expected=%d\",\n+\t\t\t\t\tret, 0x40);\n+\t}\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_eventdev_close(void)\n+{\n+\trte_event_dev_stop(test_dev_id_get());\n+\treturn rte_event_dev_close(test_dev_id_get());\n+}\n+\n+static struct unit_test_suite eventdev_common_testsuite  = {\n+\t.suite_name = \"eventdev common code unit test suite\",\n+\t.setup = testsuite_setup,\n+\t.teardown = testsuite_teardown,\n+\t.unit_test_cases = {\n+\t\tTEST_CASE_ST(NULL, NULL,\n+\t\t\ttest_eventdev_count),\n+\t\tTEST_CASE_ST(NULL, NULL,\n+\t\t\ttest_eventdev_get_dev_id),\n+\t\tTEST_CASE_ST(NULL, NULL,\n+\t\t\ttest_eventdev_socket_id),\n+\t\tTEST_CASE_ST(NULL, NULL,\n+\t\t\ttest_eventdev_info_get),\n+\t\tTEST_CASE_ST(NULL, NULL,\n+\t\t\ttest_eventdev_configure),\n+\t\tTEST_CASE_ST(eventdev_configure_setup, NULL,\n+\t\t\ttest_eventdev_queue_default_conf_get),\n+\t\tTEST_CASE_ST(eventdev_configure_setup, NULL,\n+\t\t\ttest_eventdev_queue_setup),\n+\t\tTEST_CASE_ST(eventdev_configure_setup, NULL,\n+\t\t\ttest_eventdev_queue_count),\n+\t\tTEST_CASE_ST(eventdev_configure_setup, NULL,\n+\t\t\ttest_eventdev_queue_priority),\n+\t\tTEST_CASE_ST(eventdev_configure_setup, NULL,\n+\t\t\ttest_eventdev_port_default_conf_get),\n+\t\tTEST_CASE_ST(eventdev_configure_setup, NULL,\n+\t\t\ttest_eventdev_port_setup),\n+\t\tTEST_CASE_ST(eventdev_configure_setup, NULL,\n+\t\t\ttest_eventdev_dequeue_depth),\n+\t\tTEST_CASE_ST(eventdev_configure_setup, NULL,\n+\t\t\ttest_eventdev_enqueue_depth),\n+\t\tTEST_CASE_ST(eventdev_configure_setup, NULL,\n+\t\t\ttest_eventdev_port_count),\n+\t\tTEST_CASE_ST(eventdev_configure_setup, NULL,\n+\t\t\ttest_eventdev_wait_time),\n+\t\tTEST_CASE_ST(NULL, NULL,\n+\t\t\ttest_eventdev_start_stop),\n+\t\tTEST_CASE_ST(eventdev_setup_device, eventdev_stop_device,\n+\t\t\ttest_eventdev_link),\n+\t\tTEST_CASE_ST(eventdev_setup_device, eventdev_stop_device,\n+\t\t\ttest_eventdev_unlink),\n+\t\tTEST_CASE_ST(eventdev_setup_device, eventdev_stop_device,\n+\t\t\ttest_eventdev_link_get),\n+\t\tTEST_CASE_ST(eventdev_setup_device, NULL,\n+\t\t\ttest_eventdev_close),\n+\t\tTEST_CASES_END() /**< NULL terminate unit test array */\n+\t}\n+};\n+\n+static int\n+test_eventdev_common(void)\n+{\n+\treturn unit_test_suite_runner(&eventdev_common_testsuite);\n+}\n+\n+REGISTER_TEST_COMMAND(eventdev_common_autotest, test_eventdev_common);\n",
    "prefixes": [
        "dpdk-dev",
        "4/4"
    ]
}