From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0076.outbound.protection.outlook.com [104.47.32.76]) by dpdk.org (Postfix) with ESMTP id 2B432FB30 for ; Fri, 3 Mar 2017 18:31:07 +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=l/uAKHAYYCIG2nCrWZ3O3rCve3vvOsZSz4VwWW2/Hhg=; b=QO46+nY5EIZSnM17e/HGPEq2TeoOtviwP5BNjW0//XnCAGcMMv/lgk98Ys4ztGFfvAh9m2mI8ru5zo8g1I4vB4WQgxx5mnrNKBSFmk7D1YOvBgxoh1A4vIdn9TZi+eba3QtM5apGRriOWaAJyJK9FmqAKC9UMhhXtPJxj/AQdU8= 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:02 +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:14 +0530 Message-Id: <1488562101-6658-33-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: 21b4000e-4075-40d1-953e-08d4625b1265 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:++oJvkkV1HNJXMB4t/M20iSfBEs/qwjJvOeGot43zylxGVUkSj0aP1khuoEoZFhi2sCWJs1HKaiBnDyFuZBbM4RdxvL9MmAmeNHPxtGuGczMi2hWgWts9ao2DI7g45pdoFz1DGGyG40G5B9k2UbopZF8Qn44KaMhfZdHHx+W3E7FJol5yQUM2EoG3SdnaJBtGG+09R0KITuGDLbrwhiYQiuW1p55d4yKROC3nvSwBTueV+3n63/CPtoy9OCBGO9mJ0xBswnnWqAQIaAF1NWvGQ==; 25:JglqVLM9TkR5JCz68b1PE2ODFKIVlqVxK40r9W2cWsoTKv24HRq0hr4wlk2GSDm76L+JMSt77UZhrEvQ0ZO3cwMwK6gOKaE7YeRVEcYDINYlMKoP7Jl72YohKXNjm7sC7Q+okqPexa79rzWYz2Q/+x9DaZsQAVtq7JuLMHgEnMoxThP/cOIGNLKGMZv5maBHwDirRN04izDWJOmMdP8bjvBXiugmfujM6pLAnZHhgkijyNgdRZFNYOgNwIyjEvDI9AViWXh9dEvcX3tChzLGYQf3APy+bRgUBOjD9r9nFD0WJtB5ROpgnXD2r5RkOLr3wy/Ix+os3kABy7hY7Jh+LQLHkUAus/kcPCdGQXyjPzaO6UPXGTLGumEYUtTwnznAJSpvLXBUBCp3G2KJMxvOjVbO6FQ9ebLoH09NuWj2fPq9Mes9/RFqTixrdAbDYeXi4x8XNr8WmWl3FW7DkUbbBg== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:ibiX/Pv11nQBuuNt/WSf+LO4kKwJouhxx/fXtIHH6iPlbrqke5+q1O74d7v7E8tp9VKvDvNDyxaXSPqhG2TPqzz7OgFwNq2uBqoybsZOZq0LBnTaYjBGeyYDjElJ4tZoDKjdw2nRACiiBNmKdMKZYU5F+wgPT8uGzth1j9TJtcBSsJiUOAyfxxPbvxMoy8RxHd8iYPhzkhRg5sPGsh5AAqRXwWWEmHEKXMr4/pJeTPE=; 20:bpdW3aWgHDZCG+aAq8EXBQinkumgHfVvlbGW1DvcZhRbBeiKLGGOUG2fu0IPUvRy9vgajGSR9ypheVxdUkc+3vkS6N+Ma9uHF0Ziiem7i2eiLhRQzYbl8niYoBdcCXGK8+kSYXxXe2aG9qBsVTR8kNVUbJZE4qe20YEPnYpJ3IhS464EftU5nkfFdSsFybrKeTQIZBf/DySp819m9CBalHzTp8/ju+LK6BngQnvS/xXCY7M4qYq/CtiAa40xUD11O1dg/i/DJEk8UL9wZ1BWDugMMgYtF2S1ChhY8TAxcnHQJfZVjYpEi8Tk+vrdkCYgsZ/ZDHws2z4kxsnHJ70nWCPFBEYvY4m4PDnfjr0OBKDWizpZ1pWbtAEC5ca/VSIjK+vTH4ETlhpT+l7o0lnNFxpVHdwnFwwbKQW15xFio1MJ/qdU7edpYGLw2Zsnhk5p6t/JXS7LVVo4/bJi965aFgkpYsapq2ojKhQ4gCpgB7bVtcP2x9V7CHS2tkiUwWz7NsazF1H/JlJnNKiuMp1iZ66nPr8Gfb8A+EGGgA4F8Ha7iXWBQqvt3VY7jXbaYWLtayJXRVEi2w2X88AttQsl6Relo1Ykzk9qtGHQ+yyDRoI= 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:4aRebyjnpu2ayDrHumL1aGEjtHMAmcsMFgU6ic17k7LsXJPWNwHGIG5AZUw+c6ikZuOK31bdwNpYFxnu7PlifFO87rMiRO+NYChkwYRzj6O4pE69kPPVW6ouSw/BCtAS8NYMR0XT8CyhOLvbY+ILf4AtNGswr3JQ5hCltDI6o8PDKAWJFb/4xkbaNbKDxzvc23fWU2IHrRDoLG4Jzi4Kg9qCJXvNHdtCpGqJAoHABdY+fZbYaWG0jKuU6VJCTWh+rQnHFTeDj2rsAsymrNrUX8UX29HyeG35sY8QDTYhepjXs2YnhIODKEWDE5s/AZb924zLazFZJ0pJ+lCTKnGdlmdltC5P4kAgJ03hmcG/woliUxYl2pZqlUZCIAWK5cbPkQK8Uei1PQ8/FKYdcaTJCfbzBVAIHifzTjdA4AJMHL508d82tJaGNoQdSCqgf90u5BuUzOLTBity7Wrao96ohGO2ihXvHSZrKhlzwtlgjCY+ZwcQ5oelRbszkFuibf/s0IA9L+on+4cump85wvZhzNpGXnEd6hmEJNKJ3rNRst+Vj3ZsYRRfXj0y6Nfx1xXUsXmsdHD+tRre6nMfBwUaeWi5Ctu7QqtRQXyh2ZcFX8g= 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)(551934003)(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-Micro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XJ3ZBEYQsTU7NRCWIGQGhT1oWorN7ClTe3msFfKmnHndAjnTo+/mbAZmpxEfuAQck5tLEJdK5H29JUHLvDeJ29a4JJPodnTThzyTyps= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:oCgt+bhXcjtb77PlOaaBwP23l9KmpYJxdDikQ233Yk8P/wMYHUHEUPcD6XE6zjf7bam+368L8oITiLzta6gMWbYXtOp+QjdfCcGGPGYCtKN6hsA78OQNk3kfMdJli2RCqjBCG3eqQVB+CXgX7FOVd1UZ9cm9ndpXaqctDjbtmn8hwLlXstOCk/m4mXYvgtdHq4psTaOZOLH0tbyl+ekd0SYGt8iyCDsZ82T5Fp3jjz72Xb43xc9joc5nsgfIXkfKU9VeE3FGllo3Le5giGJ4F/+crS3xzN4TL0VgrElzovEK1JZ/EaGWvaBxXPvtFahKYU8wd+GHOZyGU3RosmXcIw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 17:31:02.3306 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 32/39] app/test: octeontx flow 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:07 -0000 Add flow based two stage pipeline test with all combination of schedule types. Signed-off-by: Jerin Jacob --- app/test/test_eventdev_octeontx.c | 170 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) diff --git a/app/test/test_eventdev_octeontx.c b/app/test/test_eventdev_octeontx.c index ed761ef..e17bc82 100644 --- a/app/test/test_eventdev_octeontx.c +++ b/app/test/test_eventdev_octeontx.c @@ -800,6 +800,158 @@ test_queue_to_port_multi_link(void) return TEST_SUCCESS; } +static int +worker_flow_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 */ + if (ev.sub_event_type == 0) { + /* Move to atomic flow to maintain the ordering */ + ev.flow_id = 0x2; + ev.event_type = RTE_EVENT_TYPE_CPU; + ev.sub_event_type = 1; /* stage 1 */ + ev.sched_type = new_sched_type; + ev.op = RTE_EVENT_OP_FORWARD; + rte_event_enqueue_burst(evdev, port, &ev, 1); + } else if (ev.sub_event_type == 1) { /* Events from stage 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.sub_event_type = %d\n", + ev.sub_event_type); + return TEST_FAILED; + } + } + return 0; +} + +static int +test_multiport_flow_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 (!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; + } + + /* 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_flow_based_pipeline, + worker_flow_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; +} + + +/* Multi port ordered to atomic transaction */ +static int +test_multi_port_flow_ordered_to_atomic(void) +{ + /* Ingress event order test */ + return test_multiport_flow_sched_type_test(RTE_SCHED_TYPE_ORDERED, + RTE_SCHED_TYPE_ATOMIC); +} + +static int +test_multi_port_flow_ordered_to_ordered(void) +{ + return test_multiport_flow_sched_type_test(RTE_SCHED_TYPE_ORDERED, + RTE_SCHED_TYPE_ORDERED); +} + +static int +test_multi_port_flow_ordered_to_parallel(void) +{ + return test_multiport_flow_sched_type_test(RTE_SCHED_TYPE_ORDERED, + RTE_SCHED_TYPE_PARALLEL); +} + +static int +test_multi_port_flow_atomic_to_atomic(void) +{ + /* Ingress event order test */ + return test_multiport_flow_sched_type_test(RTE_SCHED_TYPE_ATOMIC, + RTE_SCHED_TYPE_ATOMIC); +} + +static int +test_multi_port_flow_atomic_to_ordered(void) +{ + return test_multiport_flow_sched_type_test(RTE_SCHED_TYPE_ATOMIC, + RTE_SCHED_TYPE_ORDERED); +} + +static int +test_multi_port_flow_atomic_to_parallel(void) +{ + return test_multiport_flow_sched_type_test(RTE_SCHED_TYPE_ATOMIC, + RTE_SCHED_TYPE_PARALLEL); +} + +static int +test_multi_port_flow_parallel_to_atomic(void) +{ + return test_multiport_flow_sched_type_test(RTE_SCHED_TYPE_PARALLEL, + RTE_SCHED_TYPE_ATOMIC); +} + +static int +test_multi_port_flow_parallel_to_ordered(void) +{ + return test_multiport_flow_sched_type_test(RTE_SCHED_TYPE_PARALLEL, + RTE_SCHED_TYPE_ORDERED); +} + +static int +test_multi_port_flow_parallel_to_parallel(void) +{ + return test_multiport_flow_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, @@ -821,6 +973,24 @@ static struct unit_test_suite eventdev_octeontx_testsuite = { test_queue_to_port_single_link), TEST_CASE_ST(eventdev_setup, eventdev_teardown, test_queue_to_port_multi_link), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_flow_ordered_to_atomic), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_flow_ordered_to_ordered), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_flow_ordered_to_parallel), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_flow_atomic_to_atomic), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_flow_atomic_to_ordered), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_flow_atomic_to_parallel), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_flow_parallel_to_atomic), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_flow_parallel_to_ordered), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_port_flow_parallel_to_parallel), TEST_CASES_END() /**< NULL terminate unit test array */ } }; -- 2.5.5