From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0049.outbound.protection.outlook.com [104.47.32.49]) by dpdk.org (Postfix) with ESMTP id C654DFB0C for ; Fri, 3 Mar 2017 18:30:38 +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=kjdKIX9Nv0c3NK40Lt8dXryx3lTJBgGEzXR8lW9WByU=; b=FHDwI42Jp9thymNYG/4sUc2c86qbsz+4XddMwaMtmPIdzfd2fSSnynNfOQCvSnFIFT+zSJo0LQa+Yk9iNNgxlaCCjM2x0D+nt8aihr/OcPg4FNyFbPFuwOpVeqVtLZXF/OQ4IqQw5pHD5Pq17MOAQfLOUV3i74fkEx7zGOtf6pI= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain.localdomain (14.140.2.178) by BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Fri, 3 Mar 2017 17:30:34 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: thomas.monjalon@6wind.com, bruce.richardson@intel.com, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, gage.eads@intel.com, nipun.gupta@nxp.com, santosh.shukla@caviumnetworks.com, Jerin Jacob Date: Fri, 3 Mar 2017 22:58:07 +0530 Message-Id: <1488562101-6658-26-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1488562101-6658-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1488562101-6658-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BMXPR01CA0021.INDPRD01.PROD.OUTLOOK.COM (10.174.214.159) To BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) X-MS-Office365-Filtering-Correlation-Id: 6e6cd307-0213-4fe4-024c-08d4625b01b5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:/mL6OT4YI8CgAg5a6s96CKD7LOOcNaguWKrnbvFaEhughlp99Wa20lEdgkD8sAxf9I9GdlOiC6qJv/abGH38qXqjF2Rk2nEbcQoWwLRHhjbnGlnI5Jvd8un61XQ9BUQ/6rWV73Bn4qWrWEK81Rdm5K0ZyeUeRev8Q3H9ZUvx9cux5C4HqZcEY9gZLDomv7+9wvwE1MjzQfFSdr4NLIj5n2S9oWPMg+RXalbflaDW3m8kaZGFOttgJmfwlFngDp1MMCKP6pkp5hYVS6heh+TutQ==; 25:KAqaB9tlDg80fPltoah3VBj+YgOIYz8kfVhfIu3zCJO8iqK70QAyus2+Cvsn5GQYXpApewVaBwTRqNEbXvYy+OAhSF75vnpxOFazb9KtYswFeSmPi4i6o3w+Y57uboMRv3457nb6oShvZinEHlihBqKm6SQDGC3UFUgl1f0omneH6qNRg5rfd/FnCbE6oVB4TGh78jvheyQiMqhjJ9iyxk/ffN0YYhrtnQyKmEhVnNPFLsmnyqLd5wRqIhLaqJAdvX9pEhdtRUST9U949sbRZPkROc3d2A8aMKdfuKa2rLl+K/Jg8LaMV3LnhhEyWhizhnDTvXZ2yQJaitEmvRdPRhqbvDr6BLbezg95C8b6w9qwVfN6iUhL6GUzqZmOyqOM/IP75KXiSHLzVaRozE97A7NJYjzJHGzwcjDxxtsfROt81b6dXFW0OqLtEhcEGgVB6exQZNznSTJEOoFR476fbw== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:tqtOkUFqvkqiGc2AGXwFP6vF/5qXS9xj9KS05IzrLTXmGaE8eL0Eky6D//zNGNEhh1V6X11Dma1Br1lW7xEIAghtO3AqceHRI08JzNld+02Gj4NU5Cq+lZ+pwA0AEp+n3qunYC1LMTSCnnPg3+eEdz8pEkz3Zd2Gt1N6noHeuzEG0ww/OCMEFrt4OmSX4IrR8bMo6oBFuBrNNHRB0tqYxsEw8u4aw1pxirL1Do4oEdc=; 20:bO5/+mi8H+ZcJdfqqBhOtJGZsvWcb249WQHUZyYuDYRf+ExJX4PXhkfhtLEnqd+qak5jl0m0Wftq1KGzaao45NCh2xnewohQI5MFmbF346FR2czbXz/DlO1Aek+kl5Ay21wkcW1Zbr0fVFprzAWzjW9YGrJyfugpB5YbfZPaiqeDIpVJxnpPgH8HdhhS+qDvpWOS0hxZU4W+gD1yzaCS/1jLb2p58GIJ8+QwYqCQ6tAM1S3Kiymwy5pZ6CgnjvhZ+K2BiYI2cJFNiwPrmiv1UL+7DExTHggwbEE2cG0i0mAefrxfGqLJ3zpEV7VusUn7KINvgsnqEYmPbu1PXQH9RXkBcwfhjqzcmd9bZg69MQ3Os5Yk79exawTVmORSRa7eVeMJ1KX4wagjr3XRMD9A5+T7QyZ3TJls9i3jHbJcViHwcyV8clurpoOHLLrgGzEIfC3nZoyJPlU9PMWAgAvfr2o92kRD0vs4+F/UsWBeYCzfusTn8Tl5Pp2d8quA6bQusJj9AVQ8ux8pXQ4Y1ysirQzPId1t4Ywq1AsiB/BsPbtr0uziWvxGYjDKokYg324ZOpTpIVcylLjbQ6U7CeKnJOFJ9qjJvsc8A+HsXNR1nt4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123555025)(20161123560025)(20161123562025)(20161123558025)(20161123564025)(6072148); SRVR:BN3PR0701MB1719; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 4:XP/XSR+uEcX6ivzteCkLsWO+YHLRrpfVaA5dBFw5eCc4hPtjJ7vjlSd/0NLPgtl4+TgQrl+yvfoCBUNcCFlBbtZXC6l64O+rqqge3lk3FAoKaGaQXcUOJZLCZEi11JLlyH1Sp2jM7qo0YpOwJzcCFKui72ESw2rvzMYXIJ0Vg8sYXtSjtZv05eqirIhFo4mHIRVhFmrc/sslRfrEMEnkNwAMK4hxQxnzp4Vf8yWlSkHFWE4V3VeVu+fFmBvD2PVrHu11dizCo+1Wci3MqwKUwCuNiMFGs5j2hCVoRPl2t7nqnLJBqWU1rJqtK5Uq1jI2A5s48MHg7WAWPCnWd4ZM/IbARCDz9QaNsboI6E72Woohj+gmxKedXypS4IFs+qmltWjLPGg+h6G+snruNB7PnGdvPfODHbV15E4dNFep4STetLN07GSwFaNOcJVi5UGwuA3y7JOEgx8o0avX81U0hkD3105bXKEYGdMKir3qidDRbf/VhF9wet16ik+crcs2CYe2aZaAY0SimoDTshtOcLjRpP2/22Vr1zvlNPvsVMa5ii6DwofiAdiMWOYVIuQbjoQ6JHVreSgXl457pIuXLFh7yfKxw3w14OsCeUFpBxI= X-Forefront-PRVS: 0235CBE7D0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(3846002)(50986999)(6116002)(36756003)(81166006)(6512007)(97736004)(2361001)(2351001)(6506006)(5660300001)(42186005)(50226002)(8676002)(6666003)(106356001)(8656002)(2950100002)(2906002)(25786008)(47776003)(6486002)(76176999)(33646002)(7736002)(107886003)(42882006)(66066001)(110136004)(4326008)(38730400002)(6916009)(305945005)(48376002)(92566002)(5009440100003)(5003940100001)(50466002)(189998001)(53936002)(7099028)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1719; H:localhost.localdomain.localdomain; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?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Output: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:kvir6M6y5QAUDSUcaylGghVFlwdXEQMlZDBzjJ+aMr8TJJsvKhbck8rbSrQLbM4RMhUxpNYd92ugP0VsZcNVZ4DZRz0bJhvw5ATnT48fRCvaoaL0hdEkIZMeWivMNmOmVJABXNKooU/73/LIRR7tsPoqV2sl4soT0gXnU3ppkvaNPayHi5ITonXSTGjQng8BRwMecx39fvDNkEcC4NQ9y2Gw3i6Azx3Hh/WXgN9Z6gKR+BE4d6/vJ+QgH9wGhIZp7FPh1hzDMBPcYZvJ86M0s+Ft/33p5KvaOT6kQM/kIMLoYCWf0vJ8DK+Al6OO+YPYwNIFcj/u/r+cspTLG0M2Ag== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 17:30:34.2829 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 25/39] app/test: octeontx simple event enqueue and dequeue test X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 17:30:39 -0000 Added unit test case to verify simple event enqueue and dequeue operation with different schedule types Signed-off-by: Jerin Jacob --- app/test/test_eventdev_octeontx.c | 54 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/app/test/test_eventdev_octeontx.c b/app/test/test_eventdev_octeontx.c index 8a03920..47b029d 100644 --- a/app/test/test_eventdev_octeontx.c +++ b/app/test/test_eventdev_octeontx.c @@ -407,10 +407,64 @@ consume_events(uint8_t port, const uint32_t total_events, validate_event_cb fn) return check_excess_events(port); } +static int +validate_simple_enqdeq(uint32_t index, uint8_t port, struct rte_event *ev) +{ + RTE_SET_USED(port); + TEST_ASSERT_EQUAL(index, ev->mbuf->seqn, "index=%d != seqn=%d", index, + ev->mbuf->seqn); + return 0; +} + +static inline int +test_simple_enqdeq(uint8_t sched_type) +{ + int ret; + + ret = inject_events(0 /*flow_id */, + RTE_EVENT_TYPE_CPU /* event_type */, + 0 /* sub_event_type */, + sched_type, + 0 /* queue */, + 0 /* port */, + MAX_EVENTS); + if (ret) + return TEST_FAILED; + + return consume_events(0 /* port */, MAX_EVENTS, validate_simple_enqdeq); +} + +static int +test_simple_enqdeq_ordered(void) +{ + return test_simple_enqdeq(RTE_SCHED_TYPE_ORDERED); +} + +static int +test_simple_enqdeq_atomic(void) +{ + return test_simple_enqdeq(RTE_SCHED_TYPE_ATOMIC); +} + +static int +test_simple_enqdeq_parallel(void) +{ + return test_simple_enqdeq(RTE_SCHED_TYPE_PARALLEL); +} + static struct unit_test_suite eventdev_octeontx_testsuite = { .suite_name = "eventdev octeontx unit test suite", .setup = testsuite_setup, .teardown = testsuite_teardown, + .unit_test_cases = { + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_simple_enqdeq_ordered), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_simple_enqdeq_atomic), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_simple_enqdeq_parallel), + TEST_CASES_END() /**< NULL terminate unit test array */ + } }; static int -- 2.5.5