From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0070.outbound.protection.outlook.com [104.47.40.70]) by dpdk.org (Postfix) with ESMTP id 8638D2B98 for ; Fri, 31 Mar 2017 21:37:19 +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=5JM2wnNP3jt8/wnR8dp1hQwhU/fJ2o2TsjJLxle2RYA=; b=n/p1f2czM1gM1B8OusptqhPPPvHdQlGCWCb2ElU6/5QcxG0Qr+QC4uBOrQnVUs+ZBIQII0UeCfGShkUXQcovauj6UJPkuUKf9Q+ebtPydv1DK2H74bQMrAbkWZ2aMxVv2dtCAr6QOA/NaF1mtC8n05Za7a8ZUR5Wg/CwoHblSK8= 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:14 +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:52 +0530 Message-Id: <1490988905-12584-26-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: c02afdfa-cc2e-4ee9-626f-08d4786d577e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 3:jsKNZNCeZFRUIZYdDJFVItTyuJXqnUhPyWFJvkWqiU246llAQip/1/vuUbKFkoIDLtcyg81WxJLbeIgBgxlro2uiKYf6h9j5c4OOWPLFiKUPSNvDSqgX5I92C4dl5GLbHSqNWpmK27VeO/hsKuirWrI4gpoxjxhEcOA5Mp961sfUSZD51rMnHBysD+WKFT0CKzL5/mbAjTIi06d74QIednrbfdIx8dmxi+2QcXeIvsQOz2xDwSvB8LBB2MM4ZxToma/IMNHv0fNsj6f4jAFr+dEtCWOhWuo7ndw2DRYwWmmhsXZ2pItbNnvS6vSLNnuFjvKg1M6q9A+14NR2zcmRRA==; 25:IfoQnB++KKwDgD+T/IVUh6a19pVpz6XZqarD3VKTZtQ9mxesJjQBWZ3X90vm6mVtBoT+sz+2mLCvVRW2eM2t4j0aKpFfwGac88H+Z6BdmYVM2WyLMQWENUq064gYXUONti66QWFDeXYc4dq5jbiIY45XjjkYuhCYf3WhL2leMUt1fZytC02lx1CjXRfehxk8x3emgQg0Pm/knn6zbedYZjodbyStCxm7nU8A0/hxsNI07I6tU8yMrEEcQYu5AJ7QsR1FaFCja1nOwqI1nGP68yyLBUNt80FsUIOgqW/pscwmC2d7Dn2R8jPDezSNgP+IcPjlPmXsfrIqf34KSiQk7MymZxazO2Mev0nTHgTW4JIvq7ZMRdyvA3WW3FITOylYAkPnQLdgck2yPp6bdg8uIBnbhS7IvXFq+ZK798EsYckX5yf/2BzX9L0EJBK66LGFxRCumNbdWTbIx5AoEng4Dw== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 31:FAMM5R107/Hs63YY7dKzIcA0kiVlIInCyk2k/n0vd7L1SH7Bg5UHwpMvH52F8I9qarpyPYjKetQw1EZO/GNqLbY1T4RqbWGWEMvS6pgADDAH9sQLKajx/ctxPuF0aMLQsXf4IqJbkeXjKMxJIZFLSZ/962RpF7u7xqduTnCATdcX3on9uZQ4CC1gGO7Bv1cqxpNzfOkIQi8G1vGH0cCJJdyjimcnMJabrzTiDITymyU=; 20:r4vGqm95exV6JJ4uoItU39xcdQjwtPr2feD61/CRsZAAVxiURFnoD+SIQSSLQNCEVjIzoqp3o1a+1XHnU1ptZWdoIrVdeaAp6EklVa+ujWdB7eUVaukr/A90fjhyOp87Ik2SpLQeo1vyWq/wrxRNmsNoBNEfCJcP1p8kke0ZKBeYQxeybsswEK2MJFfdFvs8t7gKItz11tx2ddqXe4NZ52W9uSLORFZIZRN5pC78zmamt7MuAy+fUFYHzzbIKn68eAuBM1dCr9KkAXdyv2q/QAhkC4CaBBgTjgXSF9kjYDbKjIV3litlFrLgVjstpZgE9mO/sDiV89/Z+5OLAhwnitnU0+caYZkbHKeMJ/kTNXltYRpc7lGET64YYXwuU+zjAmgWMMpMCIdfIHJGll7KXGejeluQ+6Khm7V4FMsFZSSv7aCJRmiWtIZCGmqV4i6euLRKXTFHmuIWw5YTNMSAz9Wu+eKGwEQ6Cu1zMz+/LI2cUVflEGmjGNf20DRHi6j3mC/Zo71A0hHBwqllU56ZFe9aZv0GYIjCcKhlxbHWv0YTHloltJPwfyk8bHZVy9QYMq7p1kKlxN8hkmELP/XCTdI1EwoNNl37g6WuWayvQ2I= 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:JXOMp6E2q6mhTQnTHRZ3SAbPbzLfktMt49rWK9Rdr4eKqn+k1oqAgCO/zUYnKerCJNZv0BK2KUUkSB4ImDXv6MgvA/wfPqpEQiwWJpyolLhyHBYL2tyuLgJ+EswnZQK5/2Nj1dDKBsKFsr/F3qd9/MuE93TrVUISH0G+IHB47MjqRAqJBHUaJ6lvm+xoUSOTGRfTrV2Q+rdZlKt+HWXi1hNNW5YBf5QmYaIRlL8y04C6+GHbBsXnBbOJJCyX4Tg1yAKvc1+piQxtVMG360+V0NLcp5d03Bun9uZn4ftS60BEWu3pAIE4V63TXua4erVI6ahNWwCjB44fQzp09tSowxpH/JiBByj+UXNEGiF4MY10nSH8iBgdSDENU8kj2aVyEE7zpdyqNnE5qapBdqAvGyZje79Ylo2yya08B7I+VMrFfUwvA3sELzsZVwCXWrtg96kKcVmNUe++7KPIq/UNYSdlfM6Ba0RAKaWpmAi5jduJoVRN0/ssH96MjbObEGhFyPSOlp6TskzD+9ftr6j9iUatM51l06jjI/DSzK3QSoYYBHFz4GgiE5V60L68QzkitWOxoJ2tRZMuC/CIwA/CkPUKeNJeScK55JR2Ae3FTjRIC0N+K2U2ZNn896hcP3UMJZw8+/Os71lMHIvsMM/V8BpIU/a1XTbzXWENlcGc1mxh5nTTazO8s/K9eJl8Bv55+0lsoSHpQWYQf19uh3y68KLkU/RctPKRmHG9Rir2vz1Yt/fPcwXv7GZldnsYkZud 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:aCDH5SjPQuwp8PGHqomJgToeGEcpEEtCmi6utie?= =?us-ascii?Q?Vfz3GlbNPtJEn9VD5UppzXWTVh1PQAjFzPz6cOlxbClO5+QGtupls7NSz7ZJ?= =?us-ascii?Q?S2cluZDfXgkGsQZDEMHjfzqgJdzSxWLMrXxD/VS/z2g5aoU5O9zc0ExS0kqx?= =?us-ascii?Q?nY1pt9SLM3KBNFKwdj3BWzsTIYgobPsb5uRu+i8m5nE8FSMFnCdWuaQE7Ux0?= =?us-ascii?Q?IYSb6Kp+++ZVUB4rVApmhGooWtlrWf00ZO0Ic407vlRXIvmC7b3oUfHpXAWG?= =?us-ascii?Q?gPdJ2AXP5Wl+nMCksZ64T9bPODua9OXPCe3SXEd2yn0TlFDFv4jWNY6ABoUd?= =?us-ascii?Q?N69R73Vc2jcU+fFUgoyvdhBezyvybAAtykLXL9d3q6N82zp5DUid7hrB6mBa?= =?us-ascii?Q?210XhWs+mqDURLCmo44MDHvGJ2XtwVzAkyjhs8pEBTELIG8DdJPsidLXWkmH?= =?us-ascii?Q?+epwOgswTwyqmDLYvX/yq+jTyARg3n9tyCicNxr74DvkEv+c0XO83V/ZJUXj?= =?us-ascii?Q?NuzwGco8ky3wZ1PARoDb4QsJWW37oNG9pbAUy2erhGsPvFjhLyZnEDJZcwu+?= =?us-ascii?Q?h3p423yN88HI7TDE/0li9BP6q9wuHC7qSVHPu76ecm8vYtZFhrRRy9pA29BW?= =?us-ascii?Q?xL2AY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z0CoZVgLwHY8ktBy4iY+v4whi6Ock/TSLvYKno/VbneF0Y+Q==; 5:2mmNnel3rPflGcD3Ywh+8BcQd9IqF1sv1LUmwN4WyyrvTm1I3yC00AXx8AwZ7/lzIyu00NSUL2ceG9fCBuc2RcDGPRALFCevROoZAGLrc3gtp/J4exnXhWz5JdB21T5lXo28C9EFbj64gqUNgXMQzTPetLj5Xa2Vm0L58tglufc=; 24:0P4l1cLpcMhsW2I3De06jw9QJUfbJnKr4SeM+4sdxlgeiZxX1Idl0CCj2jgih6yB9LAZFUTfvhTe8mdl2ADI7ZCPisxkxeZw/tGEdeLC6Nk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 7:+Sy88kJ0hNPiczdTsqyFYOCpSAnZ+T16USS1fgBZCrMdCQ/ekPHCERlV+6WxiRg3Hr30jHroeybdyIck3KhFIK/dD+/CdHUWsFqL6UeLXSIoZ6BcGHq0n9cqzDETONAlSlvdgyccTOZL4s3jIyIDzWDVemArSZMrVCuACKSz7AYLN/GqaxAupWx43L+YRkAbk+hQX7WWF84wkIphV/+a6TwxE/1OJ7CdpWEHegrmep+lxJogQ7+z7wJ965L2GLt+cKB/eS06sLgtCZjzFahDHQxWeI4hQvGxK/5w+saqP/nxd9QgNRT3AuIQuoZm2n63W77LSDe9dpQfaFx/KGyaLA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2017 19:37:14.7291 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: [dpdk-dev] [PATCH v2 25/38] test/test: add infrastructure for multicore octeontx 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:20 -0000 Add helper functions to launch and wait for n cores to complete the operation with deadlock detection. Signed-off-by: Jerin Jacob Acked-by: Harry van Haaren --- test/test/test_eventdev_octeontx.c | 88 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/test/test/test_eventdev_octeontx.c b/test/test/test_eventdev_octeontx.c index 4e50b65..abb32a2 100644 --- a/test/test/test_eventdev_octeontx.c +++ b/test/test/test_eventdev_octeontx.c @@ -63,6 +63,12 @@ struct event_attr { uint8_t port; }; +struct test_core_param { + rte_atomic32_t *total_events; + uint64_t dequeue_tmo_ticks; + uint8_t port; + uint8_t sched_type; +}; static uint32_t seqn_list_index; static int seqn_list[NUM_PACKETS]; @@ -525,6 +531,88 @@ test_multi_queue_priority(void) return consume_events(0, max_evts_roundoff, validate_queue_priority); } +static inline int +wait_workers_to_join(int lcore, const rte_atomic32_t *count) +{ + uint64_t cycles, print_cycles; + + print_cycles = cycles = rte_get_timer_cycles(); + while (rte_eal_get_lcore_state(lcore) != FINISHED) { + uint64_t new_cycles = rte_get_timer_cycles(); + + if (new_cycles - print_cycles > rte_get_timer_hz()) { + printf("\r%s: events %d\n", __func__, + rte_atomic32_read(count)); + print_cycles = new_cycles; + } + if (new_cycles - cycles > rte_get_timer_hz() * 10) { + printf("%s: No schedules for seconds, deadlock (%d)\n", + __func__, + rte_atomic32_read(count)); + rte_event_dev_dump(evdev, stdout); + cycles = new_cycles; + return TEST_FAILED; + } + } + rte_eal_mp_wait_lcore(); + return TEST_SUCCESS; +} + + +static inline int +launch_workers_and_wait(int (*master_worker)(void *), + int (*slave_workers)(void *), uint32_t total_events, + uint8_t nb_workers, uint8_t sched_type) +{ + uint8_t port = 0; + int w_lcore; + int ret; + struct test_core_param *param; + rte_atomic32_t atomic_total_events; + uint64_t dequeue_tmo_ticks; + + if (!nb_workers) + return 0; + + rte_atomic32_set(&atomic_total_events, total_events); + seqn_list_init(); + + param = malloc(sizeof(struct test_core_param) * nb_workers); + if (!param) + return TEST_FAILED; + + ret = rte_event_dequeue_timeout_ticks(evdev, + rte_rand() % 10000000/* 10ms */, &dequeue_tmo_ticks); + if (ret) + return TEST_FAILED; + + param[0].total_events = &atomic_total_events; + param[0].sched_type = sched_type; + param[0].port = 0; + param[0].dequeue_tmo_ticks = dequeue_tmo_ticks; + rte_smp_wmb(); + + w_lcore = rte_get_next_lcore( + /* start core */ -1, + /* skip master */ 1, + /* wrap */ 0); + rte_eal_remote_launch(master_worker, ¶m[0], w_lcore); + + for (port = 1; port < nb_workers; port++) { + param[port].total_events = &atomic_total_events; + param[port].sched_type = sched_type; + param[port].port = port; + param[port].dequeue_tmo_ticks = dequeue_tmo_ticks; + rte_smp_wmb(); + w_lcore = rte_get_next_lcore(w_lcore, 1, 0); + rte_eal_remote_launch(slave_workers, ¶m[port], w_lcore); + } + + ret = wait_workers_to_join(w_lcore, &atomic_total_events); + free(param); + return ret; +} + static struct unit_test_suite eventdev_octeontx_testsuite = { .suite_name = "eventdev octeontx unit test suite", -- 2.5.5