From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0046.outbound.protection.outlook.com [104.47.40.46]) by dpdk.org (Postfix) with ESMTP id E65C42BB4 for ; Fri, 31 Mar 2017 21:37:31 +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=fW3JVW8HqNk7udM4fFlOHjBYK0mSusC6DyZxcreRtdo=; b=oMJJNBAKHFmdlLvZfRr32GUZcNbYR8MlE4oBp4hWzuHWg+G5AzVJhrg7BnPXRBW0OcqW7fNHJBZyR+Z/rUtHpOyN6os1xB/8aGiUaAwaAgXsObPdg9kXdkiCQybDQJ14/ZGMDsNQ5t9Qq/OqovA8Y1JQa1auQ7nbJMbN1XliWJg= 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:26 +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:55 +0530 Message-Id: <1490988905-12584-29-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: 185b39d0-caf7-41db-70f7-08d4786d5ed6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 3:E7LrdykOYjlrrrGUciZ6fe0fNudYrrAbXnIZJF0i0xt8YKV0/nBCIFjEllJxtxV2Q0huLffJN1nUeqq0Z+2gbfY9MpHw891jE0R1AKsy1qRe2Iftj1O/RvudOgQkDix4X/m1WSjSDDESjTkSpIpR6cQgWh3x8dgHGxhQu2XrVHHuMF3ZtFxT9wSBrLlXNqg5MVVHTfUuP8RW9b+fH0Bv7KwI8v63JWUtguEV/6rAwEnRR6VLWtTtKCRxYtit1aPBWfE7ZpMP1PsWgCIKhmlGsnJvr/mih/wLxFrU3figB/yWPhHcJGL1X33qU3oVHx05r3tiZXcVuBCjrX3Z/Ob5IA==; 25:pzbw1Y1N69TJ2iFpEyErFjt1C1hjtLRUgn2rZvBNSBllIkk0UwlB9TyFnDjZFSGk4XXpyuX5a9E63YAr/ZZ9Pcf+3jLpl+xZY/VCv+Oa4X/jNv+fiW4n+UnWrh7gg/sk06KbWR4NRGbtLsaZPf0MTqU7Z095sMqAJ7cKCSkXp2UB0XWhUU4ZSkMrgyJ+S3uozCbB6GByVDJzefxMeO+3JXsO4s35YHG4SGD+4CmXPZKkjAvj6k9s5bffxh2rhBo/XjVeMrf7dOcKsjBcOtTE+Hgzl/LTVc9o6CMJ0TQBzGz0hkaYzYfa20HpqE9h1MVWkK3OiDwxBFNuVqpHYrfYjeBdY5L8nsB83hR9A4CBcudl+ENdDZ5ECLMRii3hA+gd4X3ocSRpIQkp2UmTXL9Vq9oRi/BjWxl9Z84Q3m+VkfG2v82JC1MOhrT0NFXQEbaU X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 31:EKw0Yu1wyoWAehVG24IVfIOJS9UE8rDbsLaJqMCR+XmBxVwDoU4ZYAUXCqFrxXBVdPT5JaFSsrz4mG2Po86c018yGge2cx48iOTxFlBXCZ5yVkx6ZDOS9ElHU8lCqnDooDfrPTicTwW/hXLWgDLMhDWeMRjRBzKTN5QeTQBCp93Qvon93pBN8QAKUYDxFJ0Hf/SMsczLaiWGSvqEtQj6ygKqpLTp1FvfkK8HY5sexARlopkYIvIrgRib/ixluOsT; 20:hv5iWKipJ5oiYv2ZNBwRKAAZ42V3MMriAFJzZzCRLT9neX0IGGdfmskhPKSItGSuh8VFZ8o34zb4W2sDJQ5ts43zrW3BRwyPS/RJ1uZ2mwtIFvD5bN0oieWaUvXvz+c46SE+izXUB29nWfWwj8XU10dId3RvhRIBt+MeoDne4yfXDObtiGvhQ/dqTWlf6cpvO+P9opOD/c+8gmSBSDylzXLAH8vC4OFBPkPUefdSojs5SVET38UD6IpvuWaPoNkXCKhaaljlJIrMgneOEY5M44gPwiU8ZUnU/ulqAeEJ34wHvxuTjIvjnSfWE0Vf7NyHDItqN6hceTdteQvwoN0fLw9c/wt4NZi27NuM8EJVjGWjjHK16eqQll2XkRxA3F2SZw5oeO4WGx/NGsKgNCzJB537DDCt8iDa5Vs3kSSnSs7vfTf2sEB+1aNn9AjJyyTyxJGqRCVogEIS+JGBIS4/ncH+QSxrL82gjK3vIaJwM59KQvg8g9Px1+hQtTe5BoHXQrYy5cjDq4vfaBAosBCFivVvjj266Y8svTjmj1VkaQ17ChVqyjdB0gHxAeMRjiKswI69siDsTXPm4PEoHI5kDi9SAG5NNt9eTRgQHBNex2s= 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:uhEGjTZ18OsTCy0k51CHvir9bKQPhqrm6FpViDIaB1ueZelDu0pbuiUlU74RHbw5q0DbNOH18WX5ShEx6vXbRXSB887TJ/qC0ryPX/I2cj6FEge3v0maIwtb/ilUAr8zD9jcr8snlz985gD9Jh9WaLdeoZRBSZb/NFdTNyWpOD0ciPBYn6mnP2ZQhkTUaENZ3KEIQhg+VNyVHQIU+MXywFc/IS3KA+oxjJtFOnhDE7lLhgNOxeRcGOT31impskl55QHlS/ZWocZDUE1rjZ6prM4ozGpds4Zns9z3mrjqHQPY/sA2oxHnwLYBQ+cnWNgXGAnJB+cUMuJD/UBIIegyBcb7PNsVVDctQSLvKFxRUodNEJ1KpSc8wKB95rK0J0wAt0I7ykaeChQTBasZ0PmhnD9kvz3DyRWr8+22OabgL43WQ692HhTEXya73eRQbrPf8UIjxc956t+DqPcPOtAdG5VGMjL7ei9ro/MeOLiWee1/gORFQEGI9DifV/HHxEHu0ETDNtL2UATWHrU4/TKL80RxmJee9S2pgjFQzWKmO0bnf7bo1Ne3KKb59Ohg2dFr8H8KcwfvaNdGtfdjsrjCblOUjnqsW/nABP/mTufNPG/+o/+qto3XDeWMMEHYRTVcFIJjpDFXD6DV2/V2Vu9RblK5JQm/AOeSxHJ1u0n6BmbOJvBNDr4x6C7gcsx6DfDiaMnG4lCrknloEEf/X+mv8b5DZ5peE+37faTHYTfNTJY= 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:ZZk310I6D3LGeqq78k4mbORtk+HLu/rths5gejV?= =?us-ascii?Q?H/+2M69qOlCiQkMzjdQVjcTWFRUCPC6Ej+V9Hy/LyaZIZzSTRiompIok/FsH?= =?us-ascii?Q?B/EpXMm1EEKH5wkRfVXXZVqKlYQyIx8DctkpvfVA7Apqwec90LKkRFyAMuR7?= =?us-ascii?Q?d4wRylURit08OCg9mYYZNv1xfv4r7dJTqK0Q3C+6e7kOKUxpVs55ChYNC004?= =?us-ascii?Q?3futRD2eZTCUqD4ExIMjKAHyr35JH+FvclGXR5I2jLSlFKvtnaJCG2gXu3Hw?= =?us-ascii?Q?fQBJWTLwVQsEjkfCaq7TNFhIkk2WMe66DOBTv2YVARz9YIg9HVnbGCrbjlsb?= =?us-ascii?Q?6j5rHJnhUQ9orXTLf+/IkzKcaOX57PStIh79+rFw5UR8weTNALsqVVAb456M?= =?us-ascii?Q?ReOP0UBi1t1SQj0kGXiRU8RZneGQsJ1+O+hJg44h5ZSyOg3k/5iFromVi7SL?= =?us-ascii?Q?iA9wGh2KDhBQy3XnzX5S3upXTtmHzpGQnSxIGKVnptCcsPbJM5jnQuC1AwQ9?= =?us-ascii?Q?MYY+VibX3gcdcFODlbJmPlUu72UIjyq/olSmRRSo1zoNhgVmbIWW5bNE59zg?= =?us-ascii?Q?2jamB06ttADYoXNM6s80WdKaIFJPhwUH+qSHkO1tGiRffyE18wPfOhgkT4mm?= =?us-ascii?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xHlSfKvP5r9gWdpvMRzUiaXANXhfH+Sgrbbid8wWgAyntWatYmBos/vPHXsG3A==; 5:y/JtlHA1ry+FDZQggmhkK4U/R1/9N15l6NvDnM1R3v48OGcXFyX8QmmztLwLXJzeo7AACFmBC58cP5CgkC2f6mYEYk9pKDNqzPFEW6b2fB72XW0PLgIuoZOoUhBF4ubpzL1Gyc1bH/2I1zesQkpXF1pl+gl4HVpwsk/CHTr0kew=; 24:zeToJP50g6JUr67rJ23pfeNh19ewjsJ2vMCLZCaksGUE43Nz26D6wi1CsTQpSN5wgKj4If5Z+4L3z+x3ZBcgdQxOuGy08/6BHA7xKyU5uJw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 7:hDefS9ychGuCoe9LcSxDVKY1w3sUsiTF/sY1Kq4JeEMf4f/d7NpY68uED90PKIdz7R1KvE3z9OClaKygl2eWhsGCoOLcxt8o91BLTFMp6NUC0ntaOeBxRXeZr1CMftthTj78SaNg66wFKekOavQmJnky8B2BcLVVilGq1KkzAeQBkETDSJaj9xSoxspOP6REc/GBn45qoHUoycXYr1sFYWGdwk3BMKB/w0nwKhqWJbB/PFqEi/I/ZGqCBJ1a8/OPcSrSeQKbS6BQm7tN/+Waq9Z5Wc0Nm53RPuK6QfSu4Y639AfETl5E2WAFvfn1jZmssG9izYmdO/zRUHL1aKqPyw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2017 19:37:26.9451 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: [dpdk-dev] [PATCH v2 28/38] test/test: octeontx multi 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, 31 Mar 2017 19:37:32 -0000 Add unit test case to verify queue to port multi link establishment operation. Signed-off-by: Jerin Jacob Acked-by: Harry van Haaren --- test/test/test_eventdev_octeontx.c | 77 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/test/test/test_eventdev_octeontx.c b/test/test/test_eventdev_octeontx.c index 4b1471f..059257a 100644 --- a/test/test/test_eventdev_octeontx.c +++ b/test/test/test_eventdev_octeontx.c @@ -725,6 +725,81 @@ test_queue_to_port_single_link(void) return TEST_SUCCESS; } +static int +validate_queue_to_port_multi_link(uint32_t index, uint8_t port, + struct rte_event *ev) +{ + RTE_SET_USED(index); + TEST_ASSERT_EQUAL(port, (ev->queue_id & 0x1), + "queue mismatch enq=%d deq =%d", + port, ev->queue_id); + return 0; +} + +/* + * Link all even number of queues to port 0 and all odd number of queues to + * port 1 and verify the link connection on dequeue + */ +static int +test_queue_to_port_multi_link(void) +{ + int ret, port0_events = 0, port1_events = 0; + uint8_t nr_queues, nr_ports, queue, port; + + nr_queues = rte_event_queue_count(evdev); + nr_ports = rte_event_port_count(evdev); + + if (nr_ports < 2) { + printf("%s: Not enough ports to test ports=%d\n", + __func__, nr_ports); + return TEST_SUCCESS; + } + + /* Unlink all connections that created in eventdev_setup */ + for (port = 0; port < nr_ports; port++) { + ret = rte_event_port_unlink(evdev, port, NULL, 0); + TEST_ASSERT(ret >= 0, "Failed to unlink all queues port=%d", + port); + } + + const unsigned int total_events = MAX_EVENTS / nr_queues; + + /* Link all even number of queues to port0 and odd numbers to port 1*/ + for (queue = 0; queue < nr_queues; queue++) { + port = queue & 0x1; + ret = rte_event_port_link(evdev, port, &queue, NULL, 1); + TEST_ASSERT(ret == 1, "Failed to link queue=%d to port=%d", + queue, port); + + 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 */, + port /* port */, + total_events /* events */); + if (ret) + return TEST_FAILED; + + if (port == 0) + port0_events += total_events; + else + port1_events += total_events; + } + + ret = consume_events(0 /* port */, port0_events, + validate_queue_to_port_multi_link); + if (ret) + return TEST_FAILED; + ret = consume_events(1 /* port */, port1_events, + validate_queue_to_port_multi_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, @@ -744,6 +819,8 @@ static struct unit_test_suite eventdev_octeontx_testsuite = { test_multi_queue_enq_multi_port_deq), TEST_CASE_ST(eventdev_setup, eventdev_teardown, test_queue_to_port_single_link), + TEST_CASE_ST(eventdev_setup, eventdev_teardown, + test_queue_to_port_multi_link), TEST_CASES_END() /**< NULL terminate unit test array */ } }; -- 2.5.5