From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0074.outbound.protection.outlook.com [104.47.33.74]) by dpdk.org (Postfix) with ESMTP id A076CFAED for ; Fri, 3 Mar 2017 18:30:58 +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=hywl30PmhNoPMk1QekuDQONiHdpD5KBH4E9Td0jP47g=; b=Hj/q/N39Wi0/2712WzEOpWiYyeaDcP2+pevUQ22K6VRFSmgV5aGYeUUYsUrCYA8Z0y9S05VMSwtuo8UgbSb3s3cPzXfVNwRyLbTARcbye+kUmlSMIBY6z97H4uhPMamJDNIYXdTtEjg9A9ZKS2WixFLjzWjocDMnuRDV/towsCg= 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:54 +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:12 +0530 Message-Id: <1488562101-6658-31-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: 10db288f-7a95-4688-63a9-08d4625b0d8b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:HCFvJZhE4tTVZo/7g0Rm9EfX1F7beb69VuRLumV95IPkBb5NNfXQA316WU+OCuP3zvKKsg1jml9KRy7QDTz1xyGMWIkL0a4RHOwBnzaK6bioZkAv8J1q2kKzpc02f/pO4HomMiw2VmnX/hVt+Y+KGhlBYXL2uj3LQGMlzBdNV2RpKf/gu4zJ833WoxvDIheLVxJvuW2PoeRxaVtUqPrCTB1+Bx2fZc6Qi8yU08BeNLsBu5KbHzBG8oZDWOk4uqearopZ/dcRmpEogUtl91YoeQ==; 25:xS6g6mhsHIEZ0a5rh/dZowIzTIhHv3571ggHc3kCftyrZcKozjhSsi2AuBsU3k2WgJv40PPaisnzYkKgYSTY1rHLXSBf2S3bx7P5NsCO9CQ6hxNSu4Wld/md/sXDMz+b/runTtwfJ5k28L7z65v/XrBPp5ZNPfnG6Bg+8izos18mBJ28LQ14mDr7U5GQsSaTjJTs//Tfnx/PSW9v+EH8m3Zd80X/llLwQBKYX97HKKAMerhK/kkcz96JmAvAF3MyOOZtVbylkFludSoRWltqxPMtY4BEmD33/2y9d/mqVW9OrmRRVvAGAbR7AlYSKNI7MMptH9j/bk75al2TACdnjPvfpyUClpwU+BRO5ZMp2488bWMDYdUPQtvr4CMUdC6V3pWxU8LM8e5l9OAoijGy4HacaOseBFOzqdyP9c+I0dCODClYvDN8m7lRO0y9sK+W X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:ztyEiacE1NCD/fhYN77inmZOTwrD05KIKL/FJO1ZFm97bjQGI/ZLkHC8AtzX17W/HH94r3i9RbLtm0KxB2gBFW1P4ouTK1Awnx581VY1DJsMFL6wfD6coGDX/D7HFJZWJvBpFnmTPSby4DsjsAD9oDVupbjkGjLLwt0Jzr/m/40kp/G8+tPqq0tW4y6umZTWIL/hCg44YEp1UOg3UjgP9Pbq3l2u/WHzpQfFKXMTuws=; 20:fhxB1wFpV295MDQ+VT2tc+4pPe/7lbaCIEDOGRyP1Dw6TWWyhvSkj/DaoGI44KeViTXCm7Zb8SyXkT0VIZsW974qrukOLrogAyjd3AVbOtbBQH0OHxxqPLBLAtYoFsz7uidnVHoJ71wfpIVBpj5u9aqCe3gSf9m3PSjG8u4KaEbxsQvJ2u7WVYvC4JQkwC9GKpUCm2jftE9GmtBHDmI3oKTLO+sK82oJmxZTyRXBNo7r3vY/YphYNnwfElmllaEM7F26c8SD/rZus3o55y8F4nA/Qjme137InMexMsKB4RBCvoix93mUq8+taptycidd8/PMyaGrma07RmRnTGfHNtgtfjXhyY8WN56UPprZCFiNZOYY5+bC/vCToQ7V8O9oFOi0bW7k6MwbrfcllqIpmlh+r1kCdGbeeRF5Vk1jtfTH4FPRf71qYbcElIx8HGf+PlYr8YIQXjDjvFo0edf305kTTx6fXvQaI51DzC/QCYpBT/H8OSq2dfXPeYWXgtKZRaZMy+ZPDWBeClRbhAalfdYWY4nM/SR24qriNl4hsk5EN+3AzPEi+SB22Sp6+kU+LDMbw7HN5sF6plQGI4UAGuM2tRdCPAJZA/3mPTVYdQA= 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:L6YzE/gshLbvXjuBOamHps+CcaItH7MtIhQujo5dDH1ZRSf3QIoYcxYmdXwtZ47zGQYjRSA0RzEHMzz5jHPrF4P1H9gJ2XVAp4az2fItC2Luoc4Xp6KgZAoZ4Lzft5xOunPCio7UI6eFFiEiwundtpGtEkQieQesr33HXagIBpjYegBxCwCjEG8sz4Q+wXHIWuXFGyfk2JvyT1Bg8kLxUyYwkF+g+gpBy/WdyhasrxBv2KSfTVZU4+2VRssQ7p2adehxiipTQ8dUMBfV67Gh/gw5IagmLE51HZREP1inDmH1KPbYvwN7+sZ5dUcy8tdrwfzgHcc8CCwFMWd95gfg+WvlMGGAcTFp9rfVRStGf7YnDve/ZyXaR1tZJLrwQtM3rEHGVwcJm7AC2Whz3gBc0tEhN4Zoye8l0BAoBk818vpgadRYiDcH/nsOUhJ1OXWXiHA5Wwyz75/pn+wJeJ2o4AriFM4DPm1U0PQtdh2uOnNFmaWEX7RibhY4m3Tio0QDur8SJMzstGwpGHl4DAK/8lb7PMKhUbohjWqewKQyDAhhUM39hWR8LvZFhNvqLCCM2Bw9DP3jGLjsadxFbHHyngmWQkTYIm74g2JHbSzV2gc= 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:t26D6Fpc9gsP0qCieiPVVhOAix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ticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:ILjMPwMpJXTnpdRFl2pNV1c/NlXW1WTRXVDVIep4PkU9U7TZViHXNsA8T1rUhZ+FOnI/xSKfrj0mB37vQg30ueXheFNJBBJwfmln6n8zc5FvIp4HNrC92h9YX9Eo9/BIKfNrZYqd+83xYC94WI2FbRbSLOU3LLWqVxAGIXaA7ZrIE/COcjIAsuHybW92O/8lU6myndZ6KWsNTupMTRyPvi49Hs7UXIf4QVdH0uw3UionX0LEaeb1q5A2wXHUw3y6dznV5zHca5PCeu3uqrY0rJ7UgRqpENkSMy/PLXuKrSyAC0ezo9VoBoacr5EE7quStAalkbXlBRaNFQertgj5cQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 17:30:54.0491 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 30/39] app/test: octeontx single link establishment 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:59 -0000 Add test case to verify queue to port single link establishment operation. Signed-off-by: Jerin Jacob --- app/test/test_eventdev_octeontx.c | 62 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/app/test/test_eventdev_octeontx.c b/app/test/test_eventdev_octeontx.c index 0d18de7..26a21cb 100644 --- a/app/test/test_eventdev_octeontx.c +++ b/app/test/test_eventdev_octeontx.c @@ -665,6 +665,66 @@ test_multi_queue_enq_multi_port_deq(void) nr_ports, 0xff /* invalid */); } +static int +validate_queue_to_port_single_link(uint32_t index, uint8_t port, + struct rte_event *ev) +{ + RTE_SET_USED(index); + TEST_ASSERT_EQUAL(port, ev->queue_id, + "queue mismatch enq=%d deq =%d", + port, ev->queue_id); + return 0; +} + +/* + * Link queue x to port x and check correctness of link by checking + * queue_id == x on dequeue on the specific port x + */ +static int +test_queue_to_port_single_link(void) +{ + int i, nr_links, ret; + + /* Unlink all connections that created in eventdev_setup */ + for (i = 0; i < rte_event_port_count(evdev); i++) { + ret = rte_event_port_unlink(evdev, i, NULL, 0); + TEST_ASSERT(ret >= 0, "Failed to unlink all queues port=%d", i); + } + + nr_links = RTE_MIN(rte_event_port_count(evdev), + rte_event_queue_count(evdev)); + const unsigned int total_events = MAX_EVENTS / nr_links; + + /* Link queue x to port x and inject events to queue x through port x */ + for (i = 0; i < nr_links; i++) { + uint8_t queue = (uint8_t)i; + + ret = rte_event_port_link(evdev, i, &queue, NULL, 1); + TEST_ASSERT(ret == 1, "Failed to link queue to port %d", i); + + ret = inject_events( + 0x100 /*flow_id */, + rte_rand() % (RTE_EVENT_TYPE_CPU + 1) /* event_type */, + rte_rand() % 256 /* sub_event_type */, + rte_rand() % (RTE_SCHED_TYPE_PARALLEL + 1), + queue /* queue */, + i /* port */, + total_events /* events */); + if (ret) + return TEST_FAILED; + } + + /* Verify the events generated from correct queue */ + for (i = 0; i < nr_links; i++) { + ret = consume_events(i /* port */, total_events, + validate_queue_to_port_single_link); + if (ret) + return TEST_FAILED; + } + + return TEST_SUCCESS; +} + static struct unit_test_suite eventdev_octeontx_testsuite = { .suite_name = "eventdev octeontx unit test suite", .setup = testsuite_setup, @@ -682,6 +742,8 @@ static struct unit_test_suite eventdev_octeontx_testsuite = { test_multi_queue_priority), TEST_CASE_ST(eventdev_setup, eventdev_teardown, test_multi_queue_enq_multi_port_deq), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_queue_to_port_single_link), TEST_CASES_END() /**< NULL terminate unit test array */ } }; -- 2.5.5