From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0053.outbound.protection.outlook.com [104.47.38.53]) by dpdk.org (Postfix) with ESMTP id 75C3F2BCD for ; Fri, 31 Mar 2017 21:37:15 +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=eyypB3p+/CeyJF5/FCa1UypBrrc+/5HBkX9M3JT4GH8=; b=a+HiHgiiYdc/5gCe+/hw7iQ+Qh7BdTFXgkHkVyFNZNZ9oB5clb29Q50U4sL1d68tcVQPiRS4GQg4JOIYWuwKvbL0gdZBBBndTqdtFnpeeEsD/cmlhG1fcMVow5f7dFBGqPx86NFEVagDdTH9wpIeLq57vENVN3qgeaCwXSgGfSQ= 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:10 +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:51 +0530 Message-Id: <1490988905-12584-25-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: f7b3be3b-4434-4425-c588-08d4786d551d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 3:WIhgfGvRKn4+M93cv+4dvK69sPaZgUvVCWTwPdrf1svKWlPWh0iG2livTzHS7ghMeGpeEiyVyJKb12gr+PkF2vzTz8dS15uoZ1UGlgVnwabwFFFB5bQJ42UpFHH843AhDuFwKICOswOJkp+oSMw5xUhIwtVtwoe2s6xJynqxeMuwAb7NgwgI3/J+PzMyqvki3lu3lKp1PJHPjEkdAeaIcqVjU++QOxIKyYiPF5zfGm6EIrxjh3I2dEmJieOW/lKdvh+x1IWL2LBaw90jpbr2B5j11CA0L0EKI8rpgqkHeWJmAhXogVR3hrUaKJFrMNH3TOkEwG8ry8Y1iaetehdEaQ==; 25:pQD3yf+35X74q3hM3S71CU7Dh2TEzlaPW5Yk5QqEoLx+Pdqviz9ZoOzNoxqB7ianoeAqHV50K6SRlrtlyyKWlK2lhWCUj8PHEgStTE5a2NEl7TriczH+ALyHSjkzO7UJNofowXHLLEcGlgKGwAj0tfz2dJkKtW2vD1Qt0jitYE3QZFCrbdULoeCTNTTBjo3kH/lDAgWl7UgTGisad+AZgSax1BJ0MSxnz/U1NLKfckbE9c8dh/MfiQVHXDVK37AhDAsYTWqVRPSbd4ahu7t/t81emwa1bHW32bTuj+Bh0S7fGUMLOBBZW8cgGwUIkRS78re0lPF3/VGIq6FmYxc9cbMuAqFpdybVTn8lEehk2nGNHJXBVei3S2jAhjdKXj9do9IadtA05LpSKSxqNe42A0EvPypJ+ttxQqEzuoJGyUeyf6sUWnxesnirAHUA3M0HvCzkby9FaaQQzFAuEupDBg== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 31:5M8qIU0IblW28EwMrTss+336+WBbXjtatyNJ60KlzZBctLgy8KZw8uUZyc61NI7EmZt9EjFGOfo1tMggHdnS1Pq6hxQrWxLBRGCWol615yvtgGG7qfNteXcswVSWdXBFX7lSUN0h6suTiDp4LDWpRGGnCfKM2sWVrm8UvwvUGAMdo2iGl1MYFl88P5A5U5x5rTUcB2UuvPVS3/qQ8UQBDZIcqmU75qbQUehSDpAh07RbtI2Lbe0jIMgJNuH3qMzq; 20:crmS29G+EOHWeBVVC7XcG98+vbYr2pAunvoBKcXdkvZFupzTC6xWdJ4zj6yAaHEp3WIN/l5y4KLUvVoeD5A0k1GTAWfYokSIxM038xHzxZrLeDD/xat30Ri1Q+kqKGyl2QiXHJirFVMK2WaGHB0Yz5e6siC7d06/02DViGZAvEdI562KEChcwHAC+2YBTCLCSOOSTiEvYrKqsC6JqDZ46DAuCPkAWo6E1grXEVXMJPdEQFlJYSgWvCVngwHqFgqvj8ylHWOhxwWK3aIZIDIMuL2tg/GqI0gK5HYC2eyoe2aCDFGpJ7FQj9CyPV0dX1dUhlzsUatxZsF9X4yZkQ0kSsSt7Dh2Kj64juXhcfXVsaOymzbKue5K1y+kxjI8G1EqOhvAFVhUfG+PI+XxXpBrh98yxukFJf2oMPU03lFTWKhFuQi0Sk7i7iHSxXUeWX0UKd92WEUmQJaHC/pae+8lFxz6YXujvt6SHg8yiHskjn9fEI6PDKySDbzfApzjMr8RqSulKpYTxZIeUpSUsiHTed+1UMZQ1X3CXHPEVVi7aI4etzPUDk9PG/oJLnMvTiseH0WvzNBn/OCVtISRlDn4cyBmGvsYpBMHQnybhV6E2PA= 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:OA2qjoOEm1RJuf+LADg86AHFQywuJ9YPOnvhBZ7n8x7kpHssKmhLMwQaIdIIH03KkB8eDdGxxzNsEOr7abejTunmpg+nKhBAhmI14Bb7EQqOaORUDzJApb8/dKoCRt96gDCQfBSwH0mC6uel76Lp4QuGFkcddmIeJLyk6fzvpmdI1qrblovbaXx52BvAs/iJG8R8haBO/bOWGcLdyoBTKCBuA6sopSOYh/hDRtkdgBwz4bhiUu5dX2J6Qwaxjz/Vnaxca1osWEQBx3XqJ/Hto2VKY109PpBwVs3cxDVEP7GdNQYg6tiG1duitv51WnHO8r1DQYJ/6h/XktC7ALOUMhNFE63HVM+mBrz4VEfvCuoyxNZW2WKecjJ8h9euE5t1ErPir8h8LpdrsybAydShsEp/8IL/gaEalcsNimDi0Mvk9Xg1hiGbiV5x+kTjxyoIrHFplrdSgEsalHYfJXIZQpBLdjdHz+c/B2AE/FW+qMcUUzOTcsG1tbj/STYPDtVLnMg0YNFMQmhWn6PI275xEw1m4qeBwOUcg25wJRJ9AyMmZpA9+Lc/hcicgtQ5i5nw69MiE7726H2VqtO9rBJTdZLplHsm7rDBbY58IZqN3o+DXE4ojINuGeXLSO6uQAQ5QcZMO9I4RH7uuWpoFqkZzZD9ifdSN3zT/TEgD1Vaarc120/J0wpBRoJipT38Z3v8NdfIYh5ngvnJsvqLBh/CFaWIF6uDItCjMvDxPF1++B9RpL7+cksqm9Fd2ZsIipBF 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:+/v9/Ale0vauZp6PzxcF5Wi75itaJ4Mufv3nyM9?= =?us-ascii?Q?RSkZWfPiX/R6tohiYUXW+WOuJImYg0DCg4wKpQ/OQieJPSfJPCKOo7Y20CVY?= =?us-ascii?Q?XOWtwgMcOIZt6Gh9xRjhOr0waEyQMFtsqH9PkHIGSnFWWnHgNqymCgFPL/OW?= =?us-ascii?Q?3CUZhitP40ASD0iprhDITNYRaBzhWBRv15fekB23tw8jnAFyrro3lpHLA2Qe?= =?us-ascii?Q?jw2XsFkKEi10KpQvtrWdyOzRrrmL2JUgtAHfuyl8HKNN1DrWVfwd6T7ghI+W?= =?us-ascii?Q?11RB6SHq5voGVeGXYmTgDVvKFFh4XlBUe/DzaU5pwGtGu2Ab0gPzOFuQAT5K?= =?us-ascii?Q?6uxlsTob+ce0D5i6zK7YP037mjJAeMxHKw869uOeu95dfY0Kn0Z1sM6Ew84X?= =?us-ascii?Q?ZI4zVzvqLJ0EfrcCbm1V6mre7FeQmCh8tXhccQSbPw8v+3hrBPTDpWKvb5YP?= =?us-ascii?Q?u51wh6WgQDL/eG89hsJ7Rk+wfnaI3f6cz4gPdIT7jHZBEdZIu3wcS78rFMQv?= =?us-ascii?Q?74Z4wRCSez9w+MH4Ot1VGRb8RNaDBILovUbfKbDHS3fzxVXyIinPXiF6xsqG?= =?us-ascii?Q?77BUez+uXwhVzbYmc1p7X08mIGQTnaFZ7huqzHWu2wzf6Bj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BBUIlvxn1yZwPPUBUDQprIGc5yBmLkPVmu0JmQJBaPkEfI8OAfLkVagyzvFNe9T4HuwFjuhXUxp2Vc6g==; 5:dla+EryOl8hd43cZ1hoDpP6m+t2t33CKbLqMiDS2TdQ0h22ru+yVjLmzCEZnfKWG7WgvHRFYcenkDP4IrTSPALNNhfDabFkzuYI+szRqrSlEdXOhyv81iS5Ng5OJXciXKJFppPEfDw9BqskhVEpqT4rX1HzElarCVoOJ+BwGYnM=; 24:CFeuE+EyLWKjzRKbmPupSo+4akts9w+ZmQrWMXRRFo0k0e3oAVI46yaTcwZZ+0hjkKppubeY8C8dyQiSEDf76sZZXnVJ4ENMZtacHhBG6qM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 7:MekaWz7nOW/SkvVMFQER5QT4FIYFhjpcG+tfPgUbocneOldMJpvL/JWlLzpcCk5CymuL1hbAebjbyZz2CjkiyAoTAXgnoKXbVj3CQ81VHXGTf7U6tIZNmtppiNVfT2Nd0t57GnbqfFTRWxnonZVyKYkjpTgo0TYwIBKd5wTJ8+zg7FXEvLqR4EC+9C0LtHZv0Y5aSTj//8EclF7tAnmFwX5gNXcPrVJKbl4dVMbKVPGOwKz+qVHC36BBUnDDQLgKrXRIEnH925WF+se9HmsoG/eBL83nTcnz0qqatsRA1oG/blBME5nvRUH4Ar+PgjzJWrs+aKfiI5L8vi/MPcp8Jg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2017 19:37:10.3251 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: [dpdk-dev] [PATCH v2 24/38] test/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, 31 Mar 2017 19:37:16 -0000 Added unit test case to verify the priority associated with each event queue available in the device. Signed-off-by: Jerin Jacob Acked-by: Harry van Haaren --- test/test/test_eventdev_octeontx.c | 59 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/test/test/test_eventdev_octeontx.c b/test/test/test_eventdev_octeontx.c index 62dc28a..4e50b65 100644 --- a/test/test/test_eventdev_octeontx.c +++ b/test/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 = {}; + + 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