From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0056.outbound.protection.outlook.com [104.47.38.56]) by dpdk.org (Postfix) with ESMTP id 8E7572B98 for ; Fri, 31 Mar 2017 21:37:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=SjSLvEqwzmx0wIc09jiPJGsXe+eTEaj0hBycGJtnsIo=; b=QG7G6d/Q0pGVZregsH9FfMDMQ6z+s5mCVNwSqA1ZsSWy6sZMzjaDHRnYGsxX19JkLQQgNH1X3yhYx/LkXQ/YPA9fxnKQsXtv8M7X785XSPoATT6eiNtj00wYEDJFCo285mn/0iMTOwNeLEBz2YjV1voxOBlD4dfsq3oUEptBTZA= 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 (14.140.2.178) by BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14; Fri, 31 Mar 2017 19:37:18 +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: Sat, 1 Apr 2017 01:04:53 +0530 Message-Id: <1490988905-12584-27-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1490988905-12584-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1488562101-6658-1-git-send-email-jerin.jacob@caviumnetworks.com> <1490988905-12584-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: MAXPR01CA0058.INDPRD01.PROD.OUTLOOK.COM (10.164.146.158) To BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) X-MS-Office365-Filtering-Correlation-Id: 48d5bad3-381e-4984-a42b-08d4786d59d0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 3:TTBas+mHtNCn69omTQen4h4xLhPJXUpUPbdcUQcWWUkxL+rWlXcfyrAsQ6U6JWFwM6uOl9Q/t42whu6ZqSrJGRvjYbgoMFE77hHBDyYFZADc+QszrSdfOHn6d3rks6eg6tIXFMJM34d0gKj6opk5l7fTbtQV83EI3EEfsqB6yWm3n/5AzmWJAOXISSfvWk3Hz//m50OfAdOEapHixkoRb0ex3gfBNKzpQKedeMRFwHJ9kSQZ5N/f62TtOpmZfBOxzdfHK3qqOz7CoL3XF4JEwYKmnuOaXJcJ3Ij9Djy0/yPLeuwOS0IXVAu7VythoUCU7W15zo3G4TZTO7r6EIFggA==; 25:dj+iAQQAcSkjbqy1ARVUzl30FRSFDaBsOyp9bPoUGBBWbsyKPO8WM41gHBP9nl8i6LG5BbfZDEnHUMivZfon7K54Gp423b4jwmeQJLGOa2MYgOB3SPs86IHndKvSHs8b1sW/NzMFxWq5D9Oe+WBBBAwOykSgPqjpuCxouzp8h7XbitWW1g2FdxHSHaqX/mWEoXj3rLgM6SQB05cvxMhFi3ChghMsILjGTcaAFhNzRlEVNhZF35QLUHDESoCe9Kzz2/uvfMA1sLKsJMAZdRkVe3yIq9/p2C5NBlULMAY/7vgtHghD6TStkZeaHBhK+dg8Hl+lsRf0E3SVCWuPyDMY14bXN4BZZ4hKF3I2pPb1DvkFOn9xr+XC55m9D1z//HxetoB4xPHBJXe2USh6DfrYCOcNKaH9gyScW3ipXEuI/uQyO5yGIrrWpS79EWNbRTSfpu2VfmBYmuxfXbpkYQ32Lw== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 31:ZQD1+Kqyt/B5yNoC/g1y8d9eIXJmDykEOUmCgR3shvLkbPnLvafuBt5fpp8+/cqZjB2FcUoTCedbRgDEYSvtLDfoQfnp1xLZY1t7AQe/eNB/xJBYH1lLMcs8NLtciJJYrqAe4xkzWiFW1vLJXIju3F9pEvHSyWOh0zFnDeE80wcCCiW0nAdotIJZlycBbJpElD/aA/wryYCL/Z4Ur952GYTaPKe2UhkGaeSIwm5AnpE=; 20:bTWh/7tvK5NJbhJ8YRy3WQ5+BJD5DZGE/ybb/MFG1pY6et2HMqkKOtzkKCGYoQfZUsX6Yf5cjzt4UpdWYewB40Be7qZXlb0x7v6Dp5kPlS7zNclaQHqol1xQ0ZFDhaCN3lKA5+bc8YwrsNNjKN7OdDQwTa/f2KoQW0vv8FZWI74u7FK3htUo20/N2SmEKU5oFefPghZT/uMowXpbmAqrpXygaWFccrE65A+Vt/hlYNs0Ufxw/t0PdAvXAy38EcuX1qbLWFwF4hD+aKpKd54IjQf14KOh3ujQO0p9BUvlzgDDijGSZEILcfpCvMfI3clB8gweox6wmgvNfwKPWD8P1woxsrXvc72e53DSJACrTTFVmAyPW78r7xZWy+4fA71GQ8TGBVj1ylul4+/H5t0Xim/5Ch9OO2LyxsAlY0rhNYu+g2vYUJ3ladwFkmrOkbuGAeSYGD5+TESJYkazV5oitDhUduRhYIQiBAyE+vHP9m57zTMfBMxZTSyKiUEgJC4tm07TMyz+8JtOR+LWvFUm1XDiatyLkH8Xq8oIFCEm3Klcfqp/xtsFRLJUkG6GWvT1ZL0Ru6qLF8n1g3j3vJ3SBjNXJkTVUgpWgUtwlQNajAo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(93006095)(3002001)(6041248)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(20161123560025)(20161123564025)(6072148); SRVR:BY1PR0701MB1723; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 4:sF/E/c8Zo7V4zlKizSNGJPL6HJRV3dwv2zbXDLWuUfNhneNTHjthRmj/EPT2LgofM8ooOMct3NnYfr+2ulmvF5iNkmmjEulbwqHg8Er6p3FL6UoFiQLX6n6J5lRkZh5lgr/anQ6bU5uaNbLuo+E889VuOn4/r4LYMIwRq2le5hQC6Ke8qB4XAEzNbiNKlBMeW0AamfXFmZzpy95ahENefi9jGvREG1mFZDcbuzrUqpBoZu5pJRrtyVQgvIFWH+Fq66rfYAIFaGXJiq8N0sTNfuR23faDgKIADVMQFC6ew+OzRtVlhjohQwG8u4WdQyl21CPbOKX9J/Ow61dnD2gbN5pvIDswzDtdxtBy3SIfxf3npEEw+DOZEVchJkCxSABmgkPwgs1CeSjYvhEWGNvPS5mO7HxIb4X8Q+LRgnIjlYy5I88Vn3bLqzZe9TJc9IKUykKzyITAR08azu4IPm0vIySrMMhabMj6i0pfHbdOblWLvJwpYA58mOTpobqo8FfN/LubXWgIb9REzf2Ty79NTZriP2AFX/pzWsHOm2A9tiD2npZ+bRauhaLQGKzHscYBxcJ4RIZoag1aAUmbkFeFajUPjUhXY+vS3LtrDKr4Ld+weeyU2kESEbXpD5LaAeBEWa7aP/qsGsXNVOvTS3+I23Y8t66UZ5CqASVlhTyKA1kwFm0m4w1Wua8FEr0BXKqT97d7BK1hEc0rRpNg4xzyiqfGfXNsRjP2aug4iJmj8f26DX52bH8LqQ5j8Xqg5YxP X-Forefront-PRVS: 02638D901B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(39450400003)(39410400002)(39400400002)(39850400002)(39840400002)(38730400002)(8676002)(107886003)(110136004)(50466002)(189998001)(305945005)(6506006)(36756003)(50226002)(25786009)(48376002)(6666003)(8656002)(6486002)(7736002)(2950100002)(5660300001)(53936002)(81156014)(81166006)(3846002)(42882006)(6916009)(6116002)(6512007)(42186005)(33646002)(2361001)(2351001)(76176999)(50986999)(5003940100001)(47776003)(2906002)(5009440100003)(4326008)(66066001)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1723; H:localhost.localdomain; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1723; 23:7C0WFrxgvqmeCmGDumpkHmx2p3sAEoT38vVZIfP?= =?us-ascii?Q?TJSzSSdXUF+OwfK8EgWiIK6O6+wgHTSP8raXsicSNEU6gUFuvNMDzW4meo6M?= =?us-ascii?Q?FEqLIrS6LyrW7F6/hh+pfl/55ideCBOVAFwdxyHbmO7WWvWFIkPALMXWDi6E?= =?us-ascii?Q?oKTx8PSrBF/KPObBI/FE/GtYsAtgZzk59O+T9pLL1+hnc+cEICzBrrXzsNag?= =?us-ascii?Q?JXYw66PfJIkIO1vocVifMNHM90vb5b0EPJ+Hyp+5WtJ7C8YiCEAKiwSNnXVn?= =?us-ascii?Q?s/D8h3chs1ucWGWKZF2eG+3Y+x3b6lmfCU3F5jmIShOL96DU7E8AV81K88FJ?= =?us-ascii?Q?S8dnFN7hq7mI3vHDtInRRawgbG+rUBdgvg1Hjx3B0KHLOgXp3HPX9Q7tk1d4?= =?us-ascii?Q?UCCw+tQ9j2BUbXfFkhTot/+pcd+VlVupn8/X4CTkiBcLJyGpSOs74XxDOO74?= =?us-ascii?Q?DAtlW2t+4wngoX8H+LLKKECGuwW1OLK1QpPmEEXM4cDwx1KRu5zmXzhzX8VV?= =?us-ascii?Q?4ij/s8EudLcNSAEjsJQBcamgFQceYShDIr/LdFhPfNTvECrqh9nm1uv1K2uO?= =?us-ascii?Q?iYiAk1U4+3A6MDic/c9NpCEVdQbieB2M86KWSgHAyvuZGWAMB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8JqYAU81fjkxOJvkr55qWn7NSOsrZxTHidVEhWoMLhTVDBsZSd/vPFr6hZPe44v32qUhuQNpq0qrhy470j2iIh3swA==; 5:xIo97JKOWWArGEnfvLWsS79U0vzUiiLyhtXjEZXPtcX/1aDP8Y4JuXn4Y8Nh8/l4weKocSvYE7702FZLHff7mSxVWG7y4/DbhwIa+bohPIcilJ3ItuKg5xT+wTdCWSzcpw9djAcKprfJRhhV2w3RqM2MTdkybscmA+NEOINCqzk=; 24:q7NYFei3gdICqY+bidtXGj/ZNrraDev/Isfes22Hx2COi/3zkVXB3wsLnbIzpo4Ce8dx4AF/gTD69tngusb1IzdWN+kghRmLFCTDesluxF0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 7:nsEmNSdJF2Eo5JZzYyRtuQ+o7+ucUw+cSuR3CYW6+B/zT/AJ7g71xF6edHldlBo5sDGTHffe2t+gPvkETHpavX/nVydcb2+jQ6LZQariaJjvIurCJjvoEWvT03dV0iJAySRSSDpqWYOZvsPDlKR49GUp3lresJ/t3UwrxMK32rSC39kx7oSyJ5QpUogZXj3m5aEa7NYDhsR1x6/IcQ5GqWPA3ZB1LaoTud72FA2YpAWzyr6skJzK6pUtXBdBIg4C7gaHUc+6/FUr82oyzLsAYkfbr7YGaGWL0SfYGkSZdKBjlcXYF71wdZArMZhGm0sR92s5TReN+pIEFOvkDToang== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2017 19:37:18.7267 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: [dpdk-dev] [PATCH v2 26/38] test/test: octeontx multi queue and multi core/port tests 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, 31 Mar 2017 19:37:24 -0000 Add unit test case to verify multi queue enqueue and multi core/port dequeue operation. Signed-off-by: Jerin Jacob Acked-by: Harry van Haaren --- test/test/test_eventdev_octeontx.c | 53 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/test/test/test_eventdev_octeontx.c b/test/test/test_eventdev_octeontx.c index abb32a2..7ad2076 100644 --- a/test/test/test_eventdev_octeontx.c +++ b/test/test/test_eventdev_octeontx.c @@ -531,6 +531,29 @@ test_multi_queue_priority(void) return consume_events(0, max_evts_roundoff, validate_queue_priority); } +static int +worker_multi_port_fn(void *arg) +{ + struct test_core_param *param = arg; + struct rte_event ev; + uint16_t valid_event; + uint8_t port = param->port; + rte_atomic32_t *total_events = param->total_events; + int ret; + + while (rte_atomic32_read(total_events) > 0) { + valid_event = rte_event_dequeue_burst(evdev, port, &ev, 1, 0); + if (!valid_event) + continue; + + ret = validate_event(&ev); + TEST_ASSERT_SUCCESS(ret, "Failed to validate event"); + rte_pktmbuf_free(ev.mbuf); + rte_atomic32_sub(total_events, 1); + } + return 0; +} + static inline int wait_workers_to_join(int lcore, const rte_atomic32_t *count) { @@ -613,6 +636,34 @@ launch_workers_and_wait(int (*master_worker)(void *), return ret; } +/* + * Generate a prescribed number of events and spread them across available + * queues. Dequeue the events through multiple ports and verify the enqueued + * event attributes + */ +static int +test_multi_queue_enq_multi_port_deq(void) +{ + const unsigned int total_events = MAX_EVENTS; + uint8_t nr_ports; + int ret; + + ret = generate_random_events(total_events); + if (ret) + return TEST_FAILED; + + nr_ports = RTE_MIN(rte_event_port_count(evdev), rte_lcore_count() - 1); + + if (!nr_ports) { + printf("%s: Not enough ports=%d or workers=%d\n", __func__, + rte_event_port_count(evdev), rte_lcore_count() - 1); + return TEST_SUCCESS; + } + + return launch_workers_and_wait(worker_multi_port_fn, + worker_multi_port_fn, total_events, + nr_ports, 0xff /* invalid */); +} static struct unit_test_suite eventdev_octeontx_testsuite = { .suite_name = "eventdev octeontx unit test suite", @@ -629,6 +680,8 @@ static struct unit_test_suite eventdev_octeontx_testsuite = { test_multi_queue_enq_single_port_deq), TEST_CASE_ST(eventdev_setup_priority, eventdev_teardown, test_multi_queue_priority), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_queue_enq_multi_port_deq), TEST_CASES_END() /**< NULL terminate unit test array */ } }; -- 2.5.5