From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0046.outbound.protection.outlook.com [104.47.32.46]) by dpdk.org (Postfix) with ESMTP id AC8E7FABF for ; Fri, 3 Mar 2017 18:30:54 +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=g4uocWdXSRL4gBjbNOqJ+O+VX+OQZ8upZSLRfURZW3Y=; b=POAlkUJoRbKqXfcWTYwEjKCKe6QFRjWGbaE2feSKBZKwBYUim1R6iQRI86LToLsFeWh3D65yt0yAU6Ck9ZHNaAFSPvZrTBVLFhwc4MEePQdCAadICh5xdvq3no46vFlMgDd4YXNQAYMEOlgHtVfWQMoli6QM2dr4gZfksrwTc20= 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:50 +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:11 +0530 Message-Id: <1488562101-6658-30-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: 23a16da8-3a98-496e-b752-08d4625b0b1a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:Va5QlT6FV3A0REYGPA3gs2U69+pqWfYTWWqnigZkpZ7i/bdYxzYlYg5LaFMyqe3psiyz//oMHfFdrACDbtpeEyl0cSXmR7vlI7JgvDcHBJBPUSzOZ09nVwI5WvYUMDimACOh3CzYFZcGvMXJJSfi1rd0Nv1xmBktbGs25Uy5grf2MGPZ/qIpd4rp4DdZMQ6cLgKeZY+NQXnqzC2o3BhO2Y5lgCnl7/rsN/0CVTs5gEQe18BnSkRlTFqWbJvdqvfo469IRRBbudxEF2yRZDru+A==; 25:h/inrwqpTIihjVkXoEJWe/3L10kNF1il9UY1CNKYuJu04pIp4GyHXOMJu15iTkj9FWnliBqSt6tlo/RbUYNCWGWiPapISTMEWASrO0hYK3d+uO8PuhFCe4SA4Fhbu06zYcaQkZzab1yhGX3MgLIMRYafsZAd7J77b26erRye/JSPi7vOtf7YvI50HkAQOascHfQPsnss5SUenIv63Q1t/sK3aPXHbVm8+qjJqQXaE/Ejgve3sP9zp9ncSFcxRCnyMFYTu5ftkmc67hNGV8DaDGOdV5oEQLAy1njB487H7UVBn5eFNLv3OMW/um0bBrYJKNloXYyjEJi5DHVBfj6Spoyft/c+B5vVwI3+gsGKbUxgWUeeOAAO6/Dk/xxKs6nNkUXtfwzjagfy94DCtkw8PB9j28nTB3fzUQsUm9fvgPCYCSLYHLKj4CUu54O+DmI7puP7J6AuY8mDpvuRqbTkHA== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:CXaM5sRu+l+AKBkAS0KerjtcWL+l3VJJjvnTwHYjReP/IknxIxHEzSz1fUhJTQfs+il7mohb4YqfhO9Sl8tIISWzXQoMHwUwKxdzf6McdmGvf5Z0Qd0UiI2t7UtYi0Jd2Ty/ux/Nde640VhUjgNrs6ciy5foXT99x0fkreIN7ipsI3x3XtEyg9Y1wAI8L6YJvcfUhVO69CNKus2UJlK0uD90Oan7+7skNKdlGShiH8UzyJebp6HwROabFKrMBy/4; 20:kpgqyQPn0XBxr0KTqdIvCu/4F6BKNRWd23SPf8kTTbtR5wmXbNtyJSEnBr106kr24PBva7p6Gie7Fhtih8/VZ95DO8jR04GtpMyCBCGyceVgGAoyJ/65duuE6qAFbFmdxkV2OJaQ8imWMUWp+4Al9rHC29uCfUR/xEJ68fN4UtiiPo0Q58QdfqHVphF9w7iqjdlzDiQKqrRQEOXSSkPGT3+UqWJB5QblCYVJ+3TR9JIrW27WNuULcErieA91pqywEIOJhg6K4b5WkmCzdOARw6WMVHR6zH7xTLEmgs2Ni9Dt4L1WnyZxFURJl8L0Mn80CPItLtjMxwL4gvJlbPH+ztenM6g+UmhgyTaZewTePT933hjADMZjVQHKH770NJlOu1+550S1PiaVMH50opomJJfFqhbKoth9Xc78lxAh+1hYpn6BUr/65/j3y2g5y7PTppSJkUZzI7x+2NkV7+5jJJFzG8G5/6cANa3THGruvnBn/oHybuo9BIrOlDcTdjCEhexcUSBxtlXN4vEKL/3ouPExg2VabYEwPt2PfXZFeiX5IlUOUE0KCGw1H9coZnWyOGCfieEUnsp8uW5ki2dgPTEKzV466n6/fLJxV8vLXRs= 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:CYtKehDE6DRWNb27fvZcfwZCRH1QpmpwJefcgEix0OifaCQw63nSRMe9ITxhfQhJ5mFP7FmGmbpd1Md8aLca8MwVqk5QtOK5FCtfEstO3KKUySbiNmjKgxgnEchwaa8wOMQw9p6lmR/N+sc3KozgGsDSqKNjEyryW3782NlwreEAnTqWotfXTwMnhwOAVYnHwEkc6EN1dGo0vkS1PS4j2azFyZc1cCBMzaYC/ueHF0zNyF8+IdVLccwQoVUlakR9NU1PcFKDgqHi+QQWBqmlg8mtki0XIuvYnynwA7zrKnNeyPBGEiWTLa64zTZ0E/FAYU+e9GWMnQLCuJzUdA3FCrJpGV1HYLJduKR/By0FmCfSyr77wgz2x4ogh44oL9rNFgiFYw1AgyxIues4QK7+28q9rQRFTQKB12LQtMrlmSKnbvzGC1zs2caHZfyBnNJK6HcTHaycNqH+2oSsfv+kTfgjmrvnIL7Jw8C9WZ6Hy68PUK4XNNFMyM1H+FNKA/sXCzgtoyKI36qyOS1IfKUHeDlJD68ndKWLBv+7L23TvjZjPZi4NwJIEC7A7E4QAkh4DxUMgA8r9yP5jdS21X2PFzTckQGoI71rPcBqv7j/tQ0= 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; BN3PR0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DiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:dNdHiXZ/OWTCnjEcZWrgxd9bHFUHUMRdpl3riwZHSzth4TK1y3o4fpL7oza15VGij4s43baS6MFYi0LlY/OcvvW39RwovDuZfGgfyFxW92XMSBmuYH369iy/nWmak0TgzcVsUqU3YfW3NXRDito38tjHEkt/9DTookdNmSkOk3wXqHNayGy+MfqTXvxMK3Q2BzqAi6NYcDJcQPijZ9E7sDqa0Em7efaQd8LRF9L4+BRMmpA8c0PnDw5gvvDPqpVBNJLbYHbT3cROD4gqGYIyqHi+f2hiS3xrn3fZHi5Ag2K4KGNB5uDTTujmxGg3RbsuJoDnhp8DV5YvcHyWd9g5ZA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 17:30:50.0490 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 29/39] app/test: octeontx multi queue and multi core/port tests 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:55 -0000 Add unit test case to verify multi queue enqueue and multi core/port dequeue operation. Signed-off-by: Jerin Jacob --- app/test/test_eventdev_octeontx.c | 53 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/app/test/test_eventdev_octeontx.c b/app/test/test_eventdev_octeontx.c index 1b2a5e1..0d18de7 100644 --- a/app/test/test_eventdev_octeontx.c +++ b/app/test/test_eventdev_octeontx.c @@ -531,6 +531,29 @@ test_multi_queue_priority(void) return consume_events(0, max_evts_roundoff, validate_queue_priority); } +static int +worker_multi_port_fn(void *arg) +{ + struct test_core_param *param = arg; + struct rte_event ev; + uint16_t valid_event; + uint8_t port = param->port; + rte_atomic32_t *total_events = param->total_events; + int ret; + + while (rte_atomic32_read(total_events) > 0) { + valid_event = rte_event_dequeue_burst(evdev, port, &ev, 1, 0); + if (!valid_event) + continue; + + ret = validate_event(&ev); + TEST_ASSERT_SUCCESS(ret, "Failed to validate event"); + rte_pktmbuf_free(ev.mbuf); + rte_atomic32_sub(total_events, 1); + } + return 0; +} + static inline int wait_workers_to_join(int lcore, const rte_atomic32_t *count) { @@ -613,6 +636,34 @@ launch_workers_and_wait(int (*master_worker)(void *), return ret; } +/* + * Generate a prescribed number of events and spread them across available + * queues. Dequeue the events through multiple ports and verify the enqueued + * event attributes + */ +static int +test_multi_queue_enq_multi_port_deq(void) +{ + const unsigned int total_events = MAX_EVENTS; + uint8_t nr_ports; + int ret; + + ret = generate_random_events(total_events); + if (ret) + return TEST_FAILED; + + 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; + } + + return launch_workers_and_wait(worker_multi_port_fn, + worker_multi_port_fn, total_events, + nr_ports, 0xff /* invalid */); +} static struct unit_test_suite eventdev_octeontx_testsuite = { .suite_name = "eventdev octeontx unit test suite", @@ -629,6 +680,8 @@ static struct unit_test_suite eventdev_octeontx_testsuite = { test_multi_queue_enq_single_port_deq), TEST_CASE_ST(eventdev_setup_priority, eventdev_teardown, test_multi_queue_priority), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_multi_queue_enq_multi_port_deq), TEST_CASES_END() /**< NULL terminate unit test array */ } }; -- 2.5.5