From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0057.outbound.protection.outlook.com [104.47.33.57]) by dpdk.org (Postfix) with ESMTP id 98B6EFB03 for ; Fri, 3 Mar 2017 18:30:50 +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=h+/kewo/rBNID5/tJtKEV2mtWF58lyXGOmcmQBFx+PM=; b=I5AScy1/mlNzXIwo9MGqObNVv2E+wO5T35zV24QwlhEt+bBeyCjwxkuF+T+t4BdqPuwsCJ2hhtZ56+qsYV/39wtWXd7pmuNPCZvvybl87RHPpLEDMDLp1v0iGsWgaroZvAEYzFUWOdC33vJk4jkCu1NNUlaHNbiqHd1qsSyskZY= 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:46 +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:10 +0530 Message-Id: <1488562101-6658-29-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: 143bd76e-55ec-491a-f6d4-08d4625b08b5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:yCMYq/+8l5COWFTLB/MvSV2qB5Cd0iKzfegJwqewykdQxPgMefnsnse412OAWzUz7m3VatmzsIGMOJ6MaiPpwnZ4sgARsFGamsdyv/2xhXegK1kEsFk8zZadM+AzVcSqrgUtMMHfgx+EoTGay3ercNs/L9aZgVMFQlEd5t8ot+A5kyvKRVVVg4hLO1C/++4ccaZYLpuDXN3ZcDWbaI3svsgZo4dGrqmvK5ojj3zFDH+gFQ6AZuZABV7OxFHnepElFNK6waguW9DAHkK3WwWikA==; 25:bdHownVq26AixVWPpGI3YLdJJPBwApdy3wqsTv7IbFNveIycmuiTi2aXMphyktL+CpJ/BJeBspkOxtbtsPUGLvIwhXUIcYXlEUOuq0qwoWSl0AuqRfBCUQ6Wd7k+flMFhd0K3Gavt9PGCWgL2Xwj3yjPnRt+/lj6gxreM3UyaI+zgzwsY0/sOGdqegGN5ai2fE9D1XwPHJ4FCymgJa/3Nejzc7vjb1fm/BJCK49+2F8/w+8mleKWFjhPr4Mc2oz0ieUKARtMbWacxdcpcEbSuT40EXEyKqc1BvToPDiRCgU+O52MDonAdHxWGfRZVQgGBfA5QD6uOftVDLC3XKh7dgQfZAJXLkY8WAhVjUxDzbonekr0DCqT4uyD/YtW+y2JcE5utkZPTD2MeaJMmlGj71TpNpxEhtW3y9wFCXMkSvDoV1gsfsRvnr923CiBcZG4cFTFh0rESnm5LuVnf0ROqg== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:Qqa+zYuu2DNnNEEVNHYWGM0iv/fCZue+nGc/MmryoZsZ7SppAHvbQ48R8TrIHJ8mjt6X+AQqCEbMpm77FTKAW5sd0LVSg0iGXsCtjnia4EJpKxTfwyS/dQ/cotJ+T9erYJR0mRyQzJwcPJATQVmMI/cVo5RabKYI0D6b71Fl8HWkCH8jTklg4E2kUd4+fNkve/wZkgrjDVXCoNUH1cEq+LRRW3XyqnT+UvJ7OBFv5IPIn3ULfvAYq+5BnT5+wHH5; 20:6El82XXr1hBXiy70HfHHOnbqdaIlfZ9fJWa+0CBnKP0qik/aHrw8mGxvPk9yNszYCv1B5yrYO2OfywiRaZW3A1aR03+zbQnZSI5jb+wCIBGd5knhBz0qy0W/A822xSHgJEYHKzhGPrdzlZn+60IzsDJ+ScYGkahWV4xpFwBM19LcyiIl0cKJdEadEJouY0NvGFyQzaK1hgZ/TnHJqZoEY2H62lCQYMV8zJZza8u7QSWY1Vr56rJcgZsKIZKG2lKDbBi6E3i2tLNk2rPuAvN7zUCxsKI6KMP81XPiSuonZ9ic4cRMEggyrdKsb5vDdP2uzYNDvlqsUTieBKFNLgapuThW4VydGxD6t7jD2vqAOhHtSqSt+CBa5bCS3n1Uyl0mep3WWVDBy1p8biSvQNeV7mvbbAJVQ66MlS/ZocKeWvJW7rBzWferh9Lm5vx9I4yO8b8mshyNg73N/lvyLKtSFRUAmMSsYKAV1C4YG3ItTMAMzqeqb2WPfEnk290ZTSg4fYTAT0h6mgmJLiZ71TJB147J9CPecLtp/qBM2EHbuubCxdhLcq5EBZDcooEXWKs5b3o9Jymaw4AKmowYXbx92/fBbFI4sl3s6uYuPUPV0EU= 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:7fC60t3b71nBl+izSk+GPSzEn8EnDiRCZrNNVWw/0S26u2Zep850CrNBP6LrKIMvxusFYtTMP4qS8aduk62oBK/2VmOMx5qfSlZCL30IoOnaxQp/4tdYsOZSFc4CubUHT8r2y/lx6Yg91MpMykSZcYhs1x3t4RlYIC+YFmjN/0pCTQyhrNjX8uEC0h/FBsWulsTuPuKP2yMphA0dopGw/0t3mD2QcyjC9PPGZmN9KzgACxkvjn7bHbG6Q96ym9uQwbLFlQvDLZRb7FVbbidne4k2qsW0j7YNGvAgpn5hv6okHXrOHW5x+LCV7ITWYxJZAzC2qlSn99FpLNKhOtaGZeUJhsma58EJPV0w1lF58qQFiW6Y2ytlntOGaeJ+jUGCEu78yYPoNBoTEMlKpgOWAXpE+FBGLuGuioTp3jkPi6uHcUjrxsk2BUSmF4/FLt8v34NTBaKZw9bC7R8wf3h1SFVBkBTSGm/3AhM4OpOxNkc/Nm2n0Ts9hWw9vQnITiLwLlHmUiHdC97cu/WWUAEaUsygGr0Pi4K2gjpmyudx5AflhRD4KeP7sfLwqaFxWTqv6lbzwrzgczkfNQdGzHUSb4T1y9Lps3XoJBaO89Sj+VM= 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-Ex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jOj8aeJRtx6uWqEBng2li8J4pYx/M13ErQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:KYQ3PDJVbygm8nFk3oA86OMnScNXOILmJhgnJLX0EtsvZk1HMU8vwNbME/5g7lnCLtv1qPiIFf2N2iSyUGzpHwW+HVmzq/b80HL4f6yxSrJqSvsQN0/kRE4FVG1DeITWJ3dZ4zMNLcYq0y5OLjye2fvGaaW28sc7H6LVXvVxyw3I9vm6H/0DpAPYTJDNUnDsOYNgxylqoWBkS9gcqpNb69GGC3DgzcmhQesXVeEK/C5CVXmC5Q1mOK3366kKkDjervOyMW+yH1tnEg4/kfWJPzuuWAWmT08s+T8di34k/u5ORmzI16FVMQ4VqN/yfMAtOY6bqhuVjCVkwr32VPv62g== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 17:30:46.0489 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 28/39] app/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, 03 Mar 2017 17:30:51 -0000 Add helper functions to launch and wait for n cores to complete the operation with deadlock detection. Signed-off-by: Jerin Jacob --- app/test/test_eventdev_octeontx.c | 88 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/app/test/test_eventdev_octeontx.c b/app/test/test_eventdev_octeontx.c index 4a63d15..1b2a5e1 100644 --- a/app/test/test_eventdev_octeontx.c +++ b/app/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