From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0086.outbound.protection.outlook.com [104.47.33.86]) by dpdk.org (Postfix) with ESMTP id 91EC7FAC8 for ; Fri, 3 Mar 2017 18:31:11 +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=vnaYJZBUJ9XVTtrE1G7vngr1/o9Aq0ybRGGOW8Rn6bo=; b=MBV9v9DsxCgLvmhu/OgTSipHtpScx4J7bL1CcNa/JSvbz1HfKm3j5bpQ2D0GDcxpW1+udO6N1uBDQtDDEw4Uf4KKLc9bVsqotZGhAQVCkBnbH/PqrPRCaUei/ZwxPBE7OMvejm3jgko1Zz/f4e9ZhsrU2Aa/EjNTwklJ3SlwufE= 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:31:06 +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:15 +0530 Message-Id: <1488562101-6658-34-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: 1df47224-29b0-40dc-f0ec-08d4625b1505 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:5RSdDrfwh5aBVo1O3zHBZXaoE7Sg8u5rx4zIi3D0AffBM1rc8LLn3blU+48faDVsYNIY0hz9Ku8pvZgRmyuBiR75tlofzbXBT6G5ZlgKx7qjTmQtwM0F2jdaRG+gcrqBnUhpPtbVdarMAMyzxoVXKyzkeaY0j4D8E367Xp2hFc4K83Cz/rTMMbOuJvMDPLU/LXZH2NyreznLC/ngZAf9jIqPraHZe2eSaQRc8XjliZYMESIeoD/GUpwI/EgssLGUQhk3Mc7aJyH+9wCSSSVddw==; 25:oSNdoLBwoAVEwNI+bZOM8xDHoEYngU9c4UxpDhscx6IpXYpP5fJvlzKHECeA5eMRLjXxDe2FKONEMWIYS9ajMIixpnZFygS3vJn4qnHFUE1UEXWKJV6N0xjG5mbyKrhHi7qq0AM0CIp6UKg1kdVmlu6tCx7Ph2Z1ExpFL9nsBgDPPF+3s0o2YwXkk6kcQc7DsUdtWyfcOTl9L8Wsay8uJ14DeEDVXE/pv98iV2OOSjRIPVupVkUrvwGIgjDYHaPsBjFzj9cRbuhC+0tmpRUP9dgvw3C/MIImemQj3jpzBFH3Lv/rePTxDsoQqCRFf+xBURo9gj/h6vr7tnm+24DpAOkmbXtnNw+s3zXNNrFpvW7WclQWEadtamB95Uu+x5C+ZcSkOq8rQyHaO0lE7qmfe27w8ctwlK5yisswlM21i65tR+/eZQUCaGVRwc154FkRkA/CAvYaPhifnwcJRrQO3w== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:C1oC6RztsUEuzrShZFexOINLJCxc54fgnicE27CGnSQ1ffDk9CyAY+F0Z7puQ/erBZupEDdW10qa2XowcZKTXF+wefrULvGN3gFRHyWtCdSFoynwEvvd/xskfTTNZoJZq1ChUVJw+CKfsP1fhtucx14cZXknPXewKLza6aar98Ru/Ao0FdWe6defBrF0suxQdZhtSznPb6o1bWL7tCq89c7ES4U6V310x4+fPHSmAS9+RIm4e5zz5ljN4MD/2Bw0; 20:0sUfzKA5WO/E/cHE5FYI4PcbfLzclX9F0e0uE3zWDyZBOGv/nR6tK42uWTZgLTDAptNuHzZNN+PyJrBMD4PSMXGUlp4BVMXkoJinSN4GyqeM5xfMOrqsdblv/hGC6Hk1PPYNAs+6GnjxBFSMFZfAWz8Wu7iGPZo7ztQiYagK0zG0Hg5jFV3ZDP+0AF4El5jd3r4qL3wFlnprm2zYNQgQ88edNEg1cGes1sn8inxn5EBL5n/hG7z/rFPmyH5SNA5JgS9tK7oXx2xL6YBF049cw23g641Ha4WMlKT6foqSB3jnnaBeJwL68PfQLUffflXre7CMal8pq61Z+wi3Bg6/SkPqmqxmAlLi3ZQIswUFLnIRIbdwvxTDzMVfEsAdmwOxifXFAT5BYq+k+/uJL2JYgeelSh3aX0iDh+qvkm/kol4brVcZvmyDijRK+4eelSYN5otJCLQ77CLKUIL9OG2XlFMCXEPzYovpfZ95pG5YxwDav19UbWUmV4Xcqhha4dCa0JMAGGFa8b5o0WrEJDRqzkhDyxM2rEJxFR80UNmf7fSjcUBcERZ98dcsPxrAhGxV9mN9tR2lmtnY9RRtv2qEL+jQ12blTOJG7TlbeP5VC8I= 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:wcoIImVx/nrUVrq6eG8a7YKsnsX00m1xLwhsnJu5rY8U66rCadXtZjAcfDgKXmterRjuxahsNy6DadfNIsUStEACbtng/4bxyGF25riaamADrWbkBz3lG8GRwUH6lHlTiGspytKMWbj39HwLQpDt6YH87Wv457KJrJ+yJwKgX6L8hGNwgCkmdf38n+dT93iSXL9LcIu0vmJrZ/a678xMVkVuOf5yTUNmLLpIC5Wi09PjfgtZfAjfg7cvBbHEFkpGVs653BWuH1M+fOrHWqtHkpXKKPa1QEk0yDD4mM4Xm6zSb3I5rcP8YuKcAeKBiaa6EPdahbQEbkdFqBlKF8kZ6MPZyQzLwQ2Mhoj5czCp7YYYodzjXap7hGGxCsiff8cmsm/dYtlBH6qPFFI7bqzp6TQ3KWjIen4iPun9NP09SfFwVENEpuuJKfN7xnlfTPd2Nv2BNP9FM7C4rl+NDtPN5zofBmQtOLuT5tNNipryO6Nf3fe+w5L3v/EfFtt0RLWaDl6h3ZAQzlwEi3Sz87hUtmbfCKS+zHBgvGWnXmBKAqv4MNN1TFhb9sZTY98QqCkwIddZ2Z3W+KRkRyrQGMr8J6xRUQrsOTgC5QmrLkrC2NA= 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-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EQUJDHOs1URb/N3g1E= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:6++5jPkr6VYxUOZb8clXvt/GfxI8/vOGTOEA7aedJF8gYfGd0nTl7QucEhl01WgOqWn53GpYk9Bg9E4mua//SHWXgnFt+AZS8fbJEaSXn08aUs4oV9qMUiUxmcUlCmWUTtO2yJeHKh/nHIoM9XNLKJ1D+pFS07/79oVA9kaBpKDMnMy2WLwfiJI45fDH9CGFHBLeX/0CeGGqH3LMzrKhyZdM27BiQbGGo3mcRhP4dSgXeRmjmda3919INyGsok/oE0EC4BizFkl8p3iTLiE9WAuZ98G5w9T5jAciinrY2UZhtq/H+9PCII8KBEwQomthcdyV4pJAeDBZswtEIHfY6g== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 17:31:06.5807 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 33/39] app/test: octeontx queue based two stage sched type 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:31:12 -0000 Add queue based two stage pipeline test with all combination of schedule types. Signed-off-by: Jerin Jacob --- app/test/test_eventdev_octeontx.c | 169 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 169 insertions(+) diff --git a/app/test/test_eventdev_octeontx.c b/app/test/test_eventdev_octeontx.c index e17bc82..2265576 100644 --- a/app/test/test_eventdev_octeontx.c +++ b/app/test/test_eventdev_octeontx.c @@ -952,6 +952,157 @@ test_multi_port_flow_parallel_to_parallel(void) RTE_SCHED_TYPE_PARALLEL); } +static int +worker_group_based_pipeline(void *arg) +{ + struct test_core_param *param = arg; + struct rte_event ev; + uint16_t valid_event; + uint8_t port = param->port; + uint8_t new_sched_type = param->sched_type; + rte_atomic32_t *total_events = param->total_events; + uint64_t dequeue_tmo_ticks = param->dequeue_tmo_ticks; + + while (rte_atomic32_read(total_events) > 0) { + valid_event = rte_event_dequeue_burst(evdev, port, &ev, 1, + dequeue_tmo_ticks); + if (!valid_event) + continue; + + /* Events from stage 0(group 0) */ + if (ev.queue_id == 0) { + /* Move to atomic flow to maintain the ordering */ + ev.flow_id = 0x2; + ev.event_type = RTE_EVENT_TYPE_CPU; + ev.sched_type = new_sched_type; + ev.queue_id = 1; /* Stage 1*/ + ev.op = RTE_EVENT_OP_FORWARD; + rte_event_enqueue_burst(evdev, port, &ev, 1); + } else if (ev.queue_id == 1) { /* Events from stage 1(group 1)*/ + if (seqn_list_update(ev.mbuf->seqn) == TEST_SUCCESS) { + rte_pktmbuf_free(ev.mbuf); + rte_atomic32_sub(total_events, 1); + } else { + printf("Failed to update seqn_list\n"); + return TEST_FAILED; + } + } else { + printf("Invalid ev.queue_id = %d\n", ev.queue_id); + return TEST_FAILED; + } + } + + + return 0; +} + +static int +test_multiport_queue_sched_type_test(uint8_t in_sched_type, + uint8_t out_sched_type) +{ + const unsigned int total_events = MAX_EVENTS; + uint8_t nr_ports; + int ret; + + nr_ports = RTE_MIN(rte_event_port_count(evdev), rte_lcore_count() - 1); + + if (rte_event_queue_count(evdev) < 2 || !nr_ports) { + printf("%s: Not enough queues=%d ports=%d or workers=%d\n", + __func__, rte_event_queue_count(evdev), + rte_event_port_count(evdev), rte_lcore_count() - 1); + return TEST_SUCCESS; + } + + /* Injects events with m->seqn=0 to total_events */ + ret = inject_events( + 0x1 /*flow_id */, + RTE_EVENT_TYPE_CPU /* event_type */, + 0 /* sub_event_type (stage 0) */, + in_sched_type, + 0 /* queue */, + 0 /* port */, + total_events /* events */); + if (ret) + return TEST_FAILED; + + ret = launch_workers_and_wait(worker_group_based_pipeline, + worker_group_based_pipeline, + total_events, nr_ports, out_sched_type); + if (ret) + return TEST_FAILED; + + if (in_sched_type != RTE_SCHED_TYPE_PARALLEL && + out_sched_type == RTE_SCHED_TYPE_ATOMIC) { + /* Check the events order maintained or not */ + return seqn_list_check(total_events); + } + return TEST_SUCCESS; +} + +static int +test_multi_port_queue_ordered_to_atomic(void) +{ + /* Ingress event order test */ + return test_multiport_queue_sched_type_test(RTE_SCHED_TYPE_ORDERED, + RTE_SCHED_TYPE_ATOMIC); +} + +static int +test_multi_port_queue_ordered_to_ordered(void) +{ + return test_multiport_queue_sched_type_test(RTE_SCHED_TYPE_ORDERED, + RTE_SCHED_TYPE_ORDERED); +} + +static int +test_multi_port_queue_ordered_to_parallel(void) +{ + return test_multiport_queue_sched_type_test(RTE_SCHED_TYPE_ORDERED, + RTE_SCHED_TYPE_PARALLEL); +} + +static int +test_multi_port_queue_atomic_to_atomic(void) +{ + /* Ingress event order test */ + return test_multiport_queue_sched_type_test(RTE_SCHED_TYPE_ATOMIC, + RTE_SCHED_TYPE_ATOMIC); +} + +static int +test_multi_port_queue_atomic_to_ordered(void) +{ + return test_multiport_queue_sched_type_test(RTE_SCHED_TYPE_ATOMIC, + RTE_SCHED_TYPE_ORDERED); +} + +static int +test_multi_port_queue_atomic_to_parallel(void) +{ + return test_multiport_queue_sched_type_test(RTE_SCHED_TYPE_ATOMIC, + RTE_SCHED_TYPE_PARALLEL); +} + +static int +test_multi_port_queue_parallel_to_atomic(void) +{ + return test_multiport_queue_sched_type_test(RTE_SCHED_TYPE_PARALLEL, + RTE_SCHED_TYPE_ATOMIC); +} + +static int +test_multi_port_queue_parallel_to_ordered(void) +{ + return test_multiport_queue_sched_type_test(RTE_SCHED_TYPE_PARALLEL, + RTE_SCHED_TYPE_ORDERED); +} + +static int +test_multi_port_queue_parallel_to_parallel(void) +{ + return test_multiport_queue_sched_type_test(RTE_SCHED_TYPE_PARALLEL, + RTE_SCHED_TYPE_PARALLEL); +} static struct unit_test_suite eventdev_octeontx_testsuite = { .suite_name = "eventdev octeontx unit test suite", .setup = testsuite_setup, @@ -991,6 +1142,24 @@ static struct unit_test_suite eventdev_octeontx_testsuite = { test_multi_port_flow_parallel_to_ordered), TEST_CASE_ST(eventdev_setup, eventdev_teardown, test_multi_port_flow_parallel_to_parallel), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_queue_ordered_to_atomic), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_queue_ordered_to_ordered), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_queue_ordered_to_parallel), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_queue_atomic_to_atomic), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_queue_atomic_to_ordered), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_queue_atomic_to_parallel), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_queue_parallel_to_atomic), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_queue_parallel_to_ordered), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_queue_parallel_to_parallel), TEST_CASES_END() /**< NULL terminate unit test array */ } }; -- 2.5.5