From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0068.outbound.protection.outlook.com [104.47.40.68]) by dpdk.org (Postfix) with ESMTP id A61252B94 for ; Fri, 31 Mar 2017 21:37:40 +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=VIx72keofOHPFVfQCQhRLAFtzBLXkMKQ91LN5aXbGb4=; b=K6PLi8Q80KHCsVfifxwSNcxy6i4GuiH7XYnEowajiHnf2Uzd/I7kSJgwo68n5sh0tkpTrqdMbx5Tcf5vpVNOIkBKOVdZ4oouOz+oBX4OVZ2P5at27pVWm4NulrAEHrRvEEpH118mURKzfwAsFAtMiDXF6VOG3Vh9vCSL/stwYSI= 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:34 +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:57 +0530 Message-Id: <1490988905-12584-31-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: dbf238e5-a90d-4d6d-9f92-08d4786d63c7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 3:GFac/SF1S7qteGXqOpGenYMsoi2j6i90Yz8KFXlqS/OI3gv0L6z4OqfWMHCdiW/93o+6iPytK/cmWpMBOJcL6j5bkK4zKujfgpqkZ6Qe+Bl88ID7Ejr4D+lTPT4wtWlIHu2tR5ZlS5v7+pKassJBPy4KU1ERoUVw8hR+zETQb4jDzW5sNSYzXjMJxwcVADQ1y+tQuezgMymEEY/dYltLiEP2aJjbrV6FjL0LY2y2VkQ9p2J4Y6qayOBFDCMM/ZiOVP820Gxi5wkDVjhGZCrtH6TeZ3CVRJL09rR4F/9Ly73aqmGxQhtnMnowBDRBfGKtf7Cys6DYE33S9ubR7z0wzg==; 25:0C1muyIbB1zP/9o2P0Hv9mHd1TBdyQYnjbCc8cGeTQxLRwBl/vfUI/aWDTnit2DaVMNC/8xZcMawTYYlaNE01t3d0pLYzdMdhftv+3LGSWxYPTqkWB/JokVWoqJVimDavf+F3PhC5k2gc6KAI4J7vH9E6VP9jG2hlsRKa2aKPmzWmcbslkIkPSLu/We92jIINt50i48KG0xDuAyEb8OO2ktNwYOyqoRO8CJHBipGYuj3QN0Y//BYyIJAc/HSUU/HL7rYFfJmZqaprCxlXE0StpQGEk6VICD7607EZ7mJtFzCzTVjoyeFBBArltcfRDM4Ib1v1GPpNWW28BqeLJBt3ARUih+kcVimg+Pb1CmRz9AOzbrmArBzl920E7Jf70NfnUQqDI6cIsMhY4QRTGA9oeHuvyjiOM0/pkBoKIo/bngI9jWkT1Rm0wFmVpXccGB+1ckyuosdvqWVTfMLpTt89A== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 31:QjOQQF3vS5UKUVbkkTRxRi/RTejV50qDMh58JLqlw7kCNmEI7ShMER9xskgF40BLHLlynoZhbsbL4RNEAq2DvY9IRteh/43LKg72Qsof50usWrnzn4zEonsu8KiQMJZcOnHcnyiGQSPWBn8sDnTx0cCzfJGREWpL/Nc8mNp+yjCbpLbA7FRBjgI+i+j/yXdLnzt+uU9KUNChdBeHQxrIKHQ8SaNPKASQH6t52Qh2RBk=; 20:3SY8rKMsuD0RLfU3d0sVaEz6n9l2Uqpwei5Jfb9Kgx1YsqwppVa0FjSY2R3a163pc1d+ndDqTo/0HK+3/VlO79bw9z+EpB2zIa5vSmGx8qtMlLQdIVnnIXiV4gblozRuCLmN4IvvKlev8n8JBAu+YCdqBE51i+FM8sH8lRXP+BgVsCjFl+N12ACrXes4JsHz4+3rABzZDA+rW305mBbSbJN+0B0UUe5CrjARnPNiS0Ci1SBx1fOrpUm4PpC8P+OtB7uCXieoeTXvl8+DfBatcMhvHO1ewK/UKrODmE3X7TuYXKtJqlMg1WBY45WxYjbyMPrmLiFOrOi9c/PVjyevsRO3hNQf2Ryll1N7BuWTNI80kq0Tr9QVYek++uxIUW74Na3df80oTdNnU7MMvWGPMQNVh7dDwaKq6IbGK9z6dcgFo9V9oTcDlLSBdVy52/EXr8m5xI761VWMP9Ef12Jq7AXursXxPeoSloKkFC7/EhlmpcUkO5r0doxMp3B4jPwezsQd/JO/mMx+8HaCNJn5q/oOIwqW39LZUdJYNVUS+VdkGh36L0c/IB3LKfdd787E5+LaQcqcAy7loxsdHj696KhYTY6XHP+TMfx1UOFJDSs= 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:xJbMde9WhnG/ZgzMO+wCJiHH1VV9NwRPivPREchnKqUK1xbZXoHNCtX8UwUuz22A5b4y22piUCSRxky7nmAk4JwQhVNvxavdMQXZrxcwW2+SQJNRzv5JtM0bIPxfp2DMpxnfHZY4lSqP6OFAQEe0p11mO/tjUgAsNPeIi6oBYr/+gwTK2Obf8Uy1oYLpnD7+T45vMCWnBFepm/Zlm5gVTmR1W/0yh9yap9VaTVdCUYwTw2IIQacPD9QIi283zjbBrLXanq6WGUdpZJBRjxzM8ukitoCQbSmpxb3vVkYHa51nQDyVlxxG+uFA+40dXPqdeuI6nbS9z9iKm41LyKSSjsYB+Em5pF+aLhq4+YhKoQHhKlBMFChtWFa5m/rxEvIJAWjnzT83s42U89Ih9WSkfHL3Sb8pILvQErA9E3t9/Dkp4J8Z0SisX3K49hlu9no/eCZzc3k5twgnIIoipkUnU6ergXXBi/b76fBTNkHMRo8ZhTlLSXTzE5F4Q9PxfhsMi5l2sPQ21yH7U9qCSo4mNC+W4BpAsmFMTCY1D85SGT8qbJNFZ+2rZ1Sd8XT+1E6XCVlEg+x7sV7v6Y9ZnG+Kvu22YFCopqvVubzgGHLqoqP+7AUvXCuv6+TnPISd4j9vgazk7PfGSYhCT6DzoZFlLBCByw9L38hN74xy7PI+IM3XQRdv63o82FNpPPAZ7bG+Is7MUfITOMNavzy9ATTu5biAnDv3whhnB6NyYWrJhqWSaNd1DkukPQMo6ze1N7vt 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:t4ZueLiCCwg2CmPt4pHn7DZs08UYxfmurCDEjM+?= =?us-ascii?Q?qJm9FFDtU6LhmRP7f+DSKO8X7e2DZlVaVXKrLPab6zDsyZ2qLh+HMDhcNXkv?= =?us-ascii?Q?0fUDmAlJcTnihOeSsnB2D/cfe8IOGW79LjmlvvtDQJQVJQNggyLdetPNI3o0?= =?us-ascii?Q?SVY0ATbMgVO+n8uznJmp6htjLVtxwe1AUafM2IJEndLYSV1OBYGJ86CprXbJ?= =?us-ascii?Q?wZ57Q8bfG0pEcpXZH5oWruZcVmTqoDvvaRb+S7xivoOvAynF3DChhOUcU4kY?= =?us-ascii?Q?YObhlh1T0KKZrFXrx9Mimf95fnzJ6Xl7LgPrVant/MyCVkOhb1t6UVdXBycW?= =?us-ascii?Q?PwqQaFcx0eMuHLnTK5erVLsj9luK5BEbiJszomvxtwmc2NBwgTd3edNFt191?= =?us-ascii?Q?iCNuXInNI9gLMZQefIhn1QSQ/+m1ns3jd96eQXvmH0erh3YlTtkDMeP8fdC+?= =?us-ascii?Q?+ORZHtx514yc9bkCICeJW3dlT+t5PL6bkp2wob2dIxhpzkklUwjatOb277Lr?= =?us-ascii?Q?4byGpSct8NW2nTzKeFgVmqReMxLS8xK6qO19PXEBU3X++rQN51zPOd47NkYt?= =?us-ascii?Q?RLXqdysEs3tHw6E0bHxV0HXe1LlN+o1Raphkl92PvXv6AllCChcQfYeZamj0?= =?us-ascii?Q?43ZCSqhua4eWoDsezUsADamE/NTiEiuF3TkpRcQCIplfeyRC2oFadrCf49jR?= =?us-ascii?Q?fGXMuCdEJIzlN7eWd+aEPz+3j/B5IsVXI3lAETrhyF08VrzM10dOEwRx1CzV?= =?us-ascii?Q?1dW3Cf841B9cyytGWUsSoycHwj1Q3IgXif5Ad87vrmqthcxESTzN/afe3zC+?= =?us-ascii?Q?th0DMxcAfmemO/yyRhd4KhQKw1WMf04ZL0dG7ZsuZygMIAgl8B0keg5npJPW?= =?us-ascii?Q?2pcFWktgQUFgT1+7nX5V7xm8OiC9574kSjR0IQdXfSPlerTyzelteFtsm/zM?= =?us-ascii?Q?klVAwJjUG+EqIIf8Rf0178LHirYZAAbfv6MmlixhoTY/lDLmeC3jHIeuxmdK?= =?us-ascii?Q?Q7V63AGZj4LHcYCSberDszI6C33l6GPU8eFH59B7SZFBAIuPCbZT3uXDqITC?= =?us-ascii?Q?moxSMdK/GSAn7KRk+TPS9/SDku4CXsKxbjmfOGP+a0bY4SiAQHHne5ZLfQzc?= =?us-ascii?Q?vv/smpMhscR6AMKdcgGMM9uEMVSNohhX0e3gaBWO6rvx7vvqq/q2eR5yO193?= =?us-ascii?Q?tF+nmx3COe7vO1D4=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 6:AM3Gmqu+qw9W7IHcQVK1wfTdWzVMO5OozjB3QW1Z+8rsQdmfxYLBZkl5fn2UAGJDlZQaYpHo0fplEtGSJ77vQLmqJ33x2a0r00T/HsLaEzT3LANYzYlVE81kch5UpvOJjzELj9Fuwimy7Rzi/EkooxmqfLnndU1T9AxWdTh2LA/0boKmGxJwHZd9NnUcb0l/oHaOSLEnAMBOCckgb4KKrdlhZIamJfuCRNEAuY0NwrfCWGGTL6g2wfFRDr8YYKvpjczhXpA/pX0Od1odiulQ1yb3bdRORgcbOWjLautwv9DAnlyj1Q7AR/qvYXmUdO+l/rKg9ixFWBz0HqTGQNSsoaYGYN5iu/LFliOxCzBKL+9rtEGuS6DzT/XyD7h7H/vOx999FT5CvjQVFgJfCbxXLA==; 5:BrR49LCf0rWVQxnTR+1aO/+Orb7Vs6SfZQNrFVos0E0/lMFZTMkgtWFl3VboHa5LpADy/cATIiHblcWmCUrQsIpXzHuIxxcnaM/ZN1PEZC75bh/oOjP/eNYGZrvAzCVxiO7tr8ALrlv9q1ZNM+LlnSAiosTkklRQe6MZs2yQJkk=; 24:Q6k+Pl66Bxro+ZJ+ockeSGxRrvW6eiKKWjL7VmyAJgNBJnuFOdDmS8cSHOlIJUJGscIZJ0+LtlnAOSsHAl9lHs0MGAHLco0HRSrgrAyfztk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 7:MT1NWDh6OLqEy1MQ2s1oE0F4J6abY12VQRQ2LZ9XJ+BRnks38e0z+Ez4JJpwBArlnbfUq5y17FKIkVHHPSYMoTYYZPiyYOtbpYR6Xh88SmSvh/O35qzYVFoiIm9V9yack9rBe2tEm/ouDwpwtK8GdU7kgm3qLUtm6X/gETn7GnXq9mR02a1o+4QugJF/SNqHaI+xG+qHnH9jtBvi8kiQvdtZW6tFaDlTgFME3Fg5k5gkH5WK8yr2PrmmRyLQTPRNAnBoWZ6rWRXl0Bzga50sWSOKSLRcbzFl2UadJyj6jX9SlXlNhJbhlyJGIY9MmSJdmtnSSTYron7Z/bleIhHWog== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2017 19:37:34.9644 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: [dpdk-dev] [PATCH v2 30/38] test/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, 31 Mar 2017 19:37:41 -0000 Add queue based two stage pipeline test with all combination of schedule types. Signed-off-by: Jerin Jacob Acked-by: Harry van Haaren --- test/test/test_eventdev_octeontx.c | 169 +++++++++++++++++++++++++++++++++++++ 1 file changed, 169 insertions(+) diff --git a/test/test/test_eventdev_octeontx.c b/test/test/test_eventdev_octeontx.c index d19d351..06ac409 100644 --- a/test/test/test_eventdev_octeontx.c +++ b/test/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