From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0083.outbound.protection.outlook.com [104.47.38.83]) by dpdk.org (Postfix) with ESMTP id 9E77AFE5 for ; Fri, 31 Mar 2017 21:37:27 +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=t0u/1sk5j3rlXbjjF3MBnX9RfbEw86CV4v+z7HPPm6Y=; b=f6xP3ib68U5Y9w2fOcmIIZRA9wdoeDyuQgTEkPasvTO7Cl+c8r4q66cu+aBZsGLXZXn3tfdQyyf+zD0eIe6k1P4BJB3OWJNh3185Qfp2ovIj4HDzGfu49o3jpck7/XDVXFnOyJQ5BkhpDfgPYve1Q0/0LidZctFwhQAQEdRZ2tI= 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:22 +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:54 +0530 Message-Id: <1490988905-12584-28-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: 2ec065e1-b847-4995-b913-08d4786d5c64 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 3:1Pf544dhcPG4y9N8ifd5iNBcIQBlm/r0UzHevBheA4ivdrBv8X5TIDHDEl1LmslusvcFZxHs4ALhnATrHp1k2gqWBcal4GALhcuVPwyFVW3oANFEJPfehCu5qfx1dkQS9rL7BHGJviSg6WDPZ+T0xqzMLDQxtpP4J0donRJV6Rfh6cw9rolnvoHhcbXmYRJ0gin7LTL8diXyQPqQKUdWX0gofdZrrlc6JdYjQ0YAjhzItVVq6RDRU3oBqBbIJx6zkc/AGpwAiZYwSGQCTbjFTh0dy2XWdR3ZJ1dRxRhVu5ICnGWFjoflIT1cuq0Yfo68UCwjj61EfIkh9MSQVeM4hQ==; 25:rqTbFBvvIFl2zOjGR7Tnexii4s/dZ6uyYuzoCHmIeTetbiReeI89a1znDHYgEPJ/4BF2atmjfvqHDs5NH7i1+Ix3LtZSBok53MayDmm/IwPqdxM0yZY2ZRY8B12qE+b9qHmN/YBMQNLX4lX/2w9jNca9k6mSj111soaXQkroLaP+Z9nN8p1CoRwwLP98FlrlzyIIOHEw4xsfVwJhaRIgaXvM2EaoEnhY+cWANXthhx/afwpt7AUybTxdDcckxaL7+dUx29udSC8TbQIKdCDTWh+tH60Sw1VEpReDUW2Wct3zXpQMYun2cjQJ4upXaMHihEQ9Lb54FqzdGTCn/JXaKn03dTkGB8iYhJFzES/TH4P10FJB0x8vAVp9Ua0xSjlzy9dceJSVYMUC+t79HymcykO36DvxokLhnTOyNpFYGQvKChCwOUrH8I8FZ9cmd7yqMEItQXnY/7J1gBJEk6XCCA== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 31:7DsR6iIxb1F/shDCMvtwCrgp/rxpeikOE+dkaD4S2AXquTh4n4zY2IigtG8N6GppE3OkEJUDXRNAPKS1fcA1PJpfQNsf8kLZJCtdHkiL5d/9tCRjnoSzj802nK5Uz3vt1JLTUTSikXnGtuklM2/luz6xCeHdlEQI16zv17fVe6KaYbI2WDnO8rz3BRhsqgb5+HGG7pLnGfsUrhGDEd678/lVvPnS8JrkRJMPHK9pCZQ=; 20:/+xv45HO4RmV0nhc5m4aFy12S19kJudn2BraL9W1hdDW6lc4rjdczsorl6AJtD/z6UsEXJiJpvTPgU1seIsfSLkPFyHzO6TPfMMhjE5pN/X2woynfVjZ6uliMDcjt7OGBy7/MgUILXrj9gcGQWfOwHR6RMAUnIyToLkU47Qy0EoU2FpoQs9z3zg0j4S16I9GHbF+ouavoguibCzEntTdRlq3a3+XbxVQd/lMPQ6UNuaqlRcG/PBZRVgYhpi7TFzVukP4g4yGwN/A9tq+Hkiytb+2M3kNnFgmoxr1ZtdYCrE8x6XSf5GfXrrzkaOcpu7i7rLT706NGUICifMM+45B+6hh7QJ2g+CjuklQBVBSJ0iBi+IZPficuB9RfvUFom0a9kXsyR5xVwvrVA7GPye/lhYYtgMRHGSO7SVA1pk3LHB0hvsp52EUkYGw0CP1u09vlAoQWL8OwXG6xW32+S0jnSUXfGa7Xxy17EIqJwIIwzg7gnKde8TZoKJmSg3U+9ONl7AmTM9l+BNDsAIeZ1ZwXDgtZUoFwhSaUWGWXBGAipZCh8KvmErqtXJuN6TlFhZnzLDoqk3ZWXmU5xrmSMEyGzg/9zAeumj6JD3aODT4GrE= 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:dB9yZLtjlU1RjooyOEZ2ilnQGZpGu5Tgc816DIix5/airyvUgFELBDEfcZ2bV69oK4F38ySJirt/F9o5ZPPDQCZJWUPs6C8BQzj6ilO3i6CtaIJVTYbWm9qQYwzILY6EcxFr7iuDfPrDSKVcnjk5w/UnWXkjQ732Zhg8UOttx/SeyMCM88r4warojk6RXlLFoPnr53nL9MnAISj0qXOGjKmA/25jsq2/e9FlL702ZR6Rq0CX5IUClg+4zd1KhKQxq27kKsBmnj7mZ9aC9xoaqtUJN157ONPYb6rZoBlA8S7TdUEKNX6AHeTZGOM2spAX9GLCyYtxZ1TS6Pws7dKSC7CtUGzKowmNdVSo3Ax4UWmtBo4cDkG48p1XL1J2k6D55FsA2xFIPZqIPrxkBXYDMme5oJ6nMPSYE2UXp3hNb9tSjrn5/S9l9CWaBHofYl95DG6HyYrQ6YDA/VtKNOlNgGqSrJ0iqyGBWkDO+ZODjGh6okWu8O2zU6FsT2v3bL7ogwGTS3TzQxhA3/qNejX730D+39ZdcX1XESszSGpA/qPzgSUDnb9910Xm4GKz/4Ap/TMfmenHLpZ8MDKK2lAt4s4WxC7yEp5gyIV6Mcupq/hEwtZBHnGsI50zB8hdvjigGzKGme/CvcRR64yoF471k302w81Ow4i5XoE4CDZCcka1ZLHPTmHs5DpQYtVvuuk4Klw+dBL/W7qyYl4yfVZ/Cfbjfw0kK6ngdwxouMU4IeX5vLR+Bvj27ebkZhnUXuj3 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:eC+GOOA7E1tSYM/yYHc5GdDbCLWwpR2VxpD/h3q?= =?us-ascii?Q?WrU5Hj4E/lx/X79DjESQMMa0Xu161K6nRJM7ym6D4K7orYZbqqs8XcYMf3cY?= =?us-ascii?Q?RmFEuM210ilKbyKtlwe6flBSApmjHMd3LDgQv3EaLx1Yp8NWTfeYwK7uiSeK?= =?us-ascii?Q?BZRRCo6IHxyP3biT0LgtnJtHKeFF8S85L7m9709hhn7XNl2l2kZI+tgAq/U0?= =?us-ascii?Q?nEgUe850ZXA9IrwZ2JMWF47B6iItHG0j4htyWL7yzrNYf6O7EenFF8BLZSJY?= =?us-ascii?Q?svOxU47tUEz2SlSwAwG/6FG1iyggBVxDXPR9Uv1espCFpT8VqjXdEWbvmu5q?= =?us-ascii?Q?w7TyhM4DJ7F/zenfOE8cHY71NgcEEgiwAd0Gkxf+4++xecwWGfrIEHm0Ncza?= =?us-ascii?Q?pLgruASbQ3qeP0N3tTb9Ye3ntxLyOxf5by9sF17N0TR1f4uHs6QF1Irsw2xt?= =?us-ascii?Q?eYJAXCFfugea1gqS5nWIwy8wrvv/HnVzaODJ7Z5D5tcxujeXG1IEaHUgdL4+?= =?us-ascii?Q?rTS6zm4MF87NoModJ4i7YdOoH9C+9Iaisns36RHzwBBhzhAx7xzZP99K8pia?= =?us-ascii?Q?DJdXFIo36xhRxj0W74WjgsL0B18fdR3T5XuYTzx7F7Wcds1LIXya17N/g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ht4JzB0F1a6/q3SJkacIuo6hKLSL+1hUFjiQZyKqTVKMNmbJPd2x15RXrlykPW3g==; 5:D+oNeMEzrAAFr/82dmww86kCGh8bMiVmsg76dhlSFEtrUrq+JipMd1+rk2UHtyunySorhcm6TECjJFktXpvCexpciV/mG52scEyuTHFFWONtQsNMAU3IwRooUmrMGqNKz0AvR7DHva0UV8lE/Spo++vU5hveu6DvQMLC89T/xbo=; 24:I8x0Np516WTRBWo6VsLQHD+ONY2ufbjlOSAENFwuoOacIbnPn37KgmlroXKtfCDAzRMLvSyUU22P/Za1ZU35IbLEdLzNCgKcft//yL2TcbM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 7:q8frY3vjwEdWUodQMtb4LbSRuUYEdyXUPrK/g8F2je5Fr/V7SDvONr1naNsho3Fpwyg1wGCRcyktTh4BXRTsA9e1OQwyZWgPByA8cGIrDiqZzOb+BgfiH96ovToBkjHhsgkQBxHppa7wDEaldIrxqVpJ+YY9dPrCdkxzBnhWJB69jbeJ1A9MMrBsnwEBL7Ebn7pHP0nMTPOm+H/ScFKSzOq1OSoSi5D08vxhB9aBxL/mY52WoXBKg7Rtaja/UeEdFSZeeuO3V/43+AnWEhLOTGi+AfCg6lgzc5bHiUxCqI6drQS4BrpoxOJErJ34kOYXr6BPPGTc/avicZtYJOotpA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2017 19:37:22.9235 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: [dpdk-dev] [PATCH v2 27/38] test/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, 31 Mar 2017 19:37:28 -0000 Add test case to verify queue to port single link establishment operation. Signed-off-by: Jerin Jacob Acked-by: Harry van Haaren --- test/test/test_eventdev_octeontx.c | 62 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/test/test/test_eventdev_octeontx.c b/test/test/test_eventdev_octeontx.c index 7ad2076..4b1471f 100644 --- a/test/test/test_eventdev_octeontx.c +++ b/test/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