From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0082.outbound.protection.outlook.com [104.47.33.82]) by dpdk.org (Postfix) with ESMTP id 9B828FB13 for ; Fri, 3 Mar 2017 18:30:46 +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=K/5FcHWn31qWt/l+hzwNYgexsss2YuaIfxPqRU0gjLY=; b=KNttE8OZeg7T0ZBMhNyIyIvdgLP0aqGWNXQRtPcDmZBRF3xlXhnT+FoDqznmY6Vwvn2CoEAsEl4S6NeUuuq/kN8ZM+jDBndAMR6XVwkXBmpsERDrpgzeG8moSQwlBkPQjjvnZf5oH0L9gBSBn4r3ObOttm2YbKl9rJ5HOjdQSlI= 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:42 +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:09 +0530 Message-Id: <1488562101-6658-28-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: 77723022-aa58-43b7-e6e7-08d4625b0661 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:eMl9/65PoNieDGOsTytnKH2MP5lRrhS4ex4OpvmEYeEguttZ0UC1rmHUFSbmeeeHACM0jsmBuJSgG2e6v2zNg44lITUBXqfMkPUkoNxT9Cx0/jp1Ad3Ftf6syhHB0TC/G+wTPTR0C1bauqtqsFsqJXQwujTRy+EVgBEWPek7SB96S88bREVsusNj09UMwli1CyJo09/BMp9aK5+HxLY++1xhrxBdwk36RAS41AKDF6PVO0UmSbYd4JBdu+13d1fchcA6ZvkYpUeM9U8AitwGtQ==; 25:zb9kDdb8hgZHKSVCCb/02yCgtLagyqwnGMQB+i4EayyuIDhft7MjN2w1gef5gWCssAHWz242tDEaHBgHilVbB3uZUqlzL8cnB3hUIoJ6YYWizT9lOE1HHjhVRzNP4+SFQKhVm33sSmWCDvc3JLF+7AiBVBMnhbArxrHFZP7QnC++nhlh52NayYd1L7t9Pg8dwdTqH8EcLNWmPNu6A9AJ5+MsJCwEnVKsBp5IlSaW+MXlqwL/HPoLApdzDG4ayeRV6VYkAsVxGymHC35uMG/w6bCvlXUnQYSPJVeTpmHwDWzV7pb2ZCXbWdCDKUlZuJfwbQBTHMmWgwB+kmS36GxAEKd7xx2NQV9Ty39qhEN9pQUoLrKpjLKZRAgYydQ4MEwqQSjcVrg38eIPhCjoDWl8ehjnbK4rDRsXAnRNLA3h+ILti377uCl8OzSy7HF0hmKRHQ5Gsb/SV/RpIYXpXRkN3g== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:qrWCny6mU7y0Qlqija6it8ukuL67GuaJ+KzbR/yOad3SxofXDiAOg1D/LakFmXSegufiCaqpggClNv2ydfA7KMUDmj17nVbaCLHP+ryrpGTeceDAqfvzEsG89nvhE6fU8pPMDwIwM7MnghYwcFj2QgiTO7322b7CboKGqUwHznZ/KxTO9sQXZ2SZZsot6Rl/HffXyc2x8wnq1tqgbOrlUE8ter0cPBNUBfOJa0l6MRo5MMxjfH7yN4wv6QvRC8dw; 20:4UFUqUVcV9XZ0SRDStcwxP0ocobgvb/yUCDmVQmYQX6YNa1hEFIhNNrjsekt2iT9rEppXUSJjl9kXGBUBsJaWEqPthfei62jjugeKXscEfYykd5ypQgHLdBkFkweJKFFOv7nlxvWiv4/3NlIb3ZRTUxYqCSAdDlIZedWP7dZm+I1Xzf1yptBPOMDgSDwbaLK/bVEzfLpWBjZEwR0ueDuWXN81ASwayC8PuOB2IABCnTLDhmKeU70TaevCEG5rhB88xQdqyCEO0Q92Bh38K2muL1tdwbbtvorDatUSaCgKke2v3f6B8PzLlvG7yqMF4jbBIYANcrFTkb2YKQ3bT5XVMroxVBrR7y3BVNmkU8zaevcjXuhrdtrMRzPPn9/JbMFiwR/9U8kK9pPoGSbDntJmlIa1EQ5np+4xvhytcuYbu0fAQRGtmwGC+cBfAVwurrddr0jY/mQw7aexPB4xEMWXPQ+OaTHxRZn4M8bcJEpV1BxzRy+qpsEUYUie0tBPfk0c7K9Y/pbA99VhOYKn8SphJ7wFZ1bahk2bQ6LDdnqFsSLrRyfkz18f7Ve14bVXEKqM1SqncMTx1ajcPh4ZnDQtn3iUpVFZ5q1wqPCDhPcYT0= 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:v6hGayH439/9LVyza4Owz0us5pUxTiCGlS6fewBtoIJCCiCHGFxGpgqFI5xLtVbGfrgitNWbIs/Ll37/5EQ4ZP6vCKYACW9dwmc9FAToaUYQlZ5NXZiQa8o3PcU5Gwybgr85ltvz6z3OBSWU2QPcZNtSRsU1GtWcJmZOJ3eS1W9PoQABfz6qw95RXz5iiIk8wRNm6IiRD/wz5iufEqIdMw7CZyF9c2mnlOGBP+nhDAfI2g/pzNITEPF1LVwNEs9g8eXXddJ99toHunMTrQ+Uaviwlg4hggi6UbcG6P1+yKIbHyafbNWsZr3FoAoBrpdkddpF+ki57LiMN+Z9pNSKCu1pqzvwgYMsR9yPoAk4k+RbcUscfPBtaBBRY+n7WgtsTB5Xhxst0BNe0Ep3B4ABbIKyz0DfF7DeMFhst0dXLhPY5QcwCTCjNXdxHRYzshCK6/ERehWR6JPcOVesNaY305a3X7HZxsupiQQOccelZuKNjG1L41sCt6njg7IyrYzRamjqLVt8DzHmUWGqFB4+LbhdQBDLeYMYEflv1tPrpfkllNnrtmBwKKlj9otezQvmp9C2QDzyse04rerUywuRoiMipRflWrbYCUAsV3bW1nE= 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-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0701MB1719; 23:kvpcXyOXcowPlekh43vQ3SFx7De8xquQsiMNb4f?= =?us-ascii?Q?pstjqQMGWfd6OFY2WIYafepax9uKkvbA32byvA39p5i1LX6HqGV4EM+5FMix?= =?us-ascii?Q?HpFVJjXfbTsGU5mm0lTyfEcPgg8EbIVNf27VVqZ6FMH7IpaMp8ATP8Sdft9F?= =?us-ascii?Q?D2mhP0f+WuyI5S8pc8Dur/t0qrTofpy9+M6cGR4WMw0UFsHGji373s9wgcwk?= =?us-ascii?Q?Il8/nksMVNThguE9nj4z+UMzD1Z7Jj6glsIBpnb955ffZfLqs95pZYizxHj7?= =?us-ascii?Q?YI61n0tTic5NktC8BGEcsQd8sgZuATtiPW56RNg2MbnS28Ixme9gdkh3WiMC?= =?us-ascii?Q?DdpSYm3gx7tuvJhHon/5idj1JnLp/XhZwGadaJc1ZmjU4yrVIhx++XjKTbaL?= =?us-ascii?Q?hajUYKgvyxW+jixQ/sCUhh5GiC1z0r96nwBmpNSiN7vhLyE8B9l1yN9nDr68?= =?us-ascii?Q?XXIkPQJu+xEi3ED1WGP1K4k9bk0fjObgDWOJfINIyTEdIWX8HwSWKEgrB4TL?= =?us-ascii?Q?KZYy8cmd6ZLPdIAWzBjWfMKFksR66GnG/yIzd1daRlz2PQ+tzxYLGFWVxBEy?= =?us-ascii?Q?2/5kiXsVV4clDQJvZQglZNJf3OX03hv5Ie0QKF02FjggnVVYAl7zZUHGLjgq?= =?us-ascii?Q?GNwq2DjnM9SInqcCltU9zFJOmqb990eZm3qp+TX0j1gaJoLEC89A0gf0z3HE?= =?us-ascii?Q?q4zOMCthiKMzoGBC8Fk6Ik9RvIR2YgfD2ugsiA58INjfUsr7tJXdNzv7zn2K?= =?us-ascii?Q?CftgdA0AOKx+TBlQ/xaVlwxbSx6ISdIizZ/J0vnHFj04zn9xCSD1s1cLA8hx?= =?us-ascii?Q?LbaNfPqEI6XVnDboxmyjLRWZ26h0IibYoe7DIvSJO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sNCB2c= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:AJ9VnIXOPrPmWspUTrVpGnX+4hMsYDoJU7qhGpqxlbsIEfXdTgrXBtFhlW9It8u6oK2hYCLQbWAKq49bg9HPjPFbjddpoenDiiCqll5ufVgtLtPhAXo8lDe5JviCe+pKmYyCM+S6BQvo/Flf9Z9UUEYPOOmelTEPdVn6xlZQmrQAac2UMlgOTb9/suVsyQZuYUSjZbf3UJ7nEJ/ZY2Q7g6sW9FYHjehs9ZV5ANxrvZKcnJXL4Aq3AkZZXIp+McQ6rZMcXBoxpsmUwPKjkxIoM1xSZjkiHfTW55O+ZfB3/5xvO9wp7gGE47UORqkY/igjeY/W+q+T7i0XXdCbhzWnkw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 17:30:42.2675 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 27/39] app/test: octeontx eventdev priority 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:30:47 -0000 Added unit test case to verify the priority associated with each event queue available in the device. Signed-off-by: Jerin Jacob --- app/test/test_eventdev_octeontx.c | 59 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/app/test/test_eventdev_octeontx.c b/app/test/test_eventdev_octeontx.c index 5a6e8f6..4a63d15 100644 --- a/app/test/test_eventdev_octeontx.c +++ b/app/test/test_eventdev_octeontx.c @@ -469,6 +469,63 @@ test_multi_queue_enq_single_port_deq(void) return consume_events(0 /* port */, MAX_EVENTS, NULL); } +/* + * Inject 0..MAX_EVENTS events over 0..rte_event_queue_count() with modulus + * operation + * + * For example, Inject 32 events over 0..7 queues + * enqueue events 0, 8, 16, 24 in queue 0 + * enqueue events 1, 9, 17, 25 in queue 1 + * .. + * .. + * enqueue events 7, 15, 23, 31 in queue 7 + * + * On dequeue, Validate the events comes in 0,8,16,24,1,9,17,25..,7,15,23,31 + * order from queue0(highest priority) to queue7(lowest_priority) + */ +static int +validate_queue_priority(uint32_t index, uint8_t port, struct rte_event *ev) +{ + uint32_t range = MAX_EVENTS / rte_event_queue_count(evdev); + uint32_t expected_val = (index % range) * rte_event_queue_count(evdev); + + expected_val += ev->queue_id; + RTE_SET_USED(port); + TEST_ASSERT_EQUAL(ev->mbuf->seqn, expected_val, + "seqn=%d index=%d expected=%d range=%d nb_queues=%d max_event=%d", + ev->mbuf->seqn, index, expected_val, range, + rte_event_queue_count(evdev), MAX_EVENTS); + return 0; +} + +static int +test_multi_queue_priority(void) +{ + uint8_t queue; + struct rte_mbuf *m; + int i, max_evts_roundoff; + + /* See validate_queue_priority() comments for priority validate logic */ + max_evts_roundoff = MAX_EVENTS / rte_event_queue_count(evdev); + max_evts_roundoff *= rte_event_queue_count(evdev); + + for (i = 0; i < max_evts_roundoff; i++) { + struct rte_event ev = {0}; + + m = rte_pktmbuf_alloc(eventdev_test_mempool); + TEST_ASSERT_NOT_NULL(m, "mempool alloc failed"); + + m->seqn = i; + queue = i % rte_event_queue_count(evdev); + update_event_and_validation_attr(m, &ev, 0, RTE_EVENT_TYPE_CPU, + 0, RTE_SCHED_TYPE_PARALLEL, queue, 0); + rte_event_enqueue_burst(evdev, 0, &ev, 1); + } + + return consume_events(0, max_evts_roundoff, validate_queue_priority); +} + + static struct unit_test_suite eventdev_octeontx_testsuite = { .suite_name = "eventdev octeontx unit test suite", .setup = testsuite_setup, @@ -482,6 +539,8 @@ static struct unit_test_suite eventdev_octeontx_testsuite = { test_simple_enqdeq_parallel), TEST_CASE_ST(eventdev_setup, eventdev_teardown, test_multi_queue_enq_single_port_deq), + TEST_CASE_ST(eventdev_setup_priority, eventdev_teardown, + test_multi_queue_priority), TEST_CASES_END() /**< NULL terminate unit test array */ } }; -- 2.5.5