From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0060.outbound.protection.outlook.com [104.47.32.60]) by dpdk.org (Postfix) with ESMTP id C84B3FA34 for ; Fri, 3 Mar 2017 18:31:03 +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=6rvoSgSNiVulLnSkyS7iulSHlvWOGx7znluvHcgnhuQ=; b=XMBJNK5umoWFDjAVaQQRIPb9IzmEAHOlrY7872BcP6e6ltQTy0P5bjyfExIbbuxSsQHt3QWAVlY0sPUUfQsVip2LzBzjT3rAFOpPMLSLIUDJso6NEoeOdzjbcgc627j8LZaClz9s2/cZ9T0d7nQeY61LIZ7heWlr4OlPKZHtyYY= 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:58 +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:13 +0530 Message-Id: <1488562101-6658-32-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: fb0ed6a7-60ac-4aaa-c091-08d4625b100c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:/HqI1Lc+cLjAviJ8v0qjJTAnybMv0jMNUIHuC1njtyu5MmVz2eWmCYGh3qLpmoXVI7cbD0S20ijGS/HXqgLN6Xa3wCMbvtxEbLmksXlGSghO1kHFKlSOVeorJQfc16VzsEptaf4Uixnmx7K0ClzSfMZ5kiOtoWmsIkRyFyqmY2g5s5rlcW2xZN5hQBEmCGt/NbYPJ3RqKP4dWvgiku4c5JuHDj2n6+S/YEGDlEkSwh97L/ISkyGSuW8qcPXppHuHohzMjCiHdrEQAn7vn5FI2w==; 25:BNU05atYrW9J30tdRYr5tRKvRlsI7FJLjYCYj9QoSEIwQsyR5eB4/FSGCIlebJ6UcjB5gjA/NNxF/dgCOSfbWmV1swTiDx5DLJINsdynp1cyfoUmDiv7NDBZHdbcukfPN7P7s3onYnVVbSsnDJ9i4T3XJzYJ6cOeBVgjCRjvmnl8/OwgIIGhkaDCCnIJFixtQLdY3R6tZed6GNrGvilqebwQU7ixRWYLFhacHLPzc1K0taVMdqk6Ypk6RgEJtanpk+30YXzUZS0W/kOlyAzdndFPKyQMyKuYy2MPaJnL8r0a9Cr89MaVA+DB4nRlB7/5RPvJexFhdntLj8UEYAfOtRuXNTJcUhOX66sKAlciyFMGp8tYrCoW0+lloJ9F4bf8jq9d/W7uBQ2Y/eJAvmpvXdesMDJ5CRaLlJos2MBBmKQGrvDmUQvGHnInp1Gw+e7qzyVz+6fKUCgD6gHLVJ8uBQ== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:p5RQ6pBc/YJbRlpwngS9VEAGyLqnnBn2hZPcaDCSfxuUKQbEdRRLrzXxZlX2PbjTrxyJa9u0NnHOovhALNP//NhWnzHJCSS8FDXHWjvfe1DlO71v9zeCyDUPpHqQnGTseLfmtY3VziQyfOSijG0nEfYYFB3KwlbDgrfi0B+b3jfuxm3f3Wt8srCYAM2I72iG9z80JEWiTR+LtPWzvqMsVD/pMUxiD8Ay3uL3xj7dzlw=; 20:d1NxyzCEoqGiRXSCZwaoFSe9oFVdIiokXLNr9w42hQq+9H+zjlDfqVtgRhDjymI8QvztJDiFYde/Fjs+GY4E/SP8hbJWtUoI1tgxxPg3Uap6BXp1oRo4T2bqWuQVQouuZACU6/HHYq3mkZw76ybwfgo3/J1NgSHybK5NvSnIJafL8+BVsW1oVC77l80vPlIlxzhDFCfWAjrAtWxEYnMBjRfZmhFt7IrKjoJjHqS9jJl55gWh8lhUauOlhNwHcCezCL7I74yqLakCmuCaSP9zDgIZRCM6t72zOOsXnq9MKlrJoUL1bFEI1idV2Ejz6QEMF2uhdMZs/+zCp7U2p9VKJmzr2ZJMjpbZkSIFWNnwBjmR+jQnyMHQDcNCTRUeIiPhDr7JpWg7Ynuzby0aDFyp2YbEZWmNduro+QW4aUW6E63nni5wO8YZKA/hqfKtKW7bM4woTwJuouy1ay71FIJapmVcghNEsd1cyHTEHZbmirlxSPPkOCFPL5xpFKSwGVo7E0Jsxrzs58glL45T3eD4iikY+ofo9JO7h5ya/cF8TvzDzVlzs0AUtyOcD4jOn8BN3G4QS6u89imArcpi0dyNqbS9IWe6Ji0SHeXls2GmejQ= 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:X7iOGqBzntsje+li+FldTrvjXXszg1rJCPwP54JXTjCiUH4VGYyC1VX3z7ihYygaUDuL5WyMw7d1bNcWjhw0JoGsODUavwHFgQlvwHb+DyRnCNb+mfivlA2DrrME89qUN2bbmOhM4KlgOeZaICSXDiFO7I583o/yP/+NVupy7ZMaEi8tL5ItBfOjxOR68fRATxrmMZdx+XSec13q/05vzoscYJnjDDcklju05EIQnGN54vCPrdsSQ6AsM5DuyG1bqOUgLjWZaam+PPP8OXSbnaq4BmEPiNpXrhqXrEhTpIEjO0bss/16neXGGPsheK63hmFwzlrjZ8I3MAp3Nt/kaRQ9ZX90/PEgjp0xFLaUBkXKSa4Kf7vA6QBifPFgdrbpkTuySlqeYwJOH2b4jZAb5txb/SHVbb2e1OaSG8TMcK34+QjGBVGA2qUSFbne10ltSd+5v9nN3Br7a+PBq5GcNDa/Y1d+Z34BC9e4FHCWMDuEcdOYpKS3EBYCFrzXkKR3D2scjyntgt3+VNpkvS9caDZlvyN9V3EAKI/oo/BLRQ+SGMQiPZGLT3YOuCrgqtFWFsI3qTyNgS0RN+tlBSG9OPU6E7GZiJA/LlW/uQb1xOY= 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:iNjZcwJzxk6tVaZyjWcQgY/804wOHWHOzuOJo4X?= =?us-ascii?Q?1SUQZdX56Fb3qdZfWD1HZq3w5mOCE9mesOoCtYPPfP4/iy3pbiVkjvCZR8qW?= =?us-ascii?Q?m1aP6/ZZUlHnEwJG0siRu/XZK9ngamiKohV79nUVysEj1YkFFNhXoyCPBEDI?= =?us-ascii?Q?qANtYPdst6ngg3MvnS691ebNg41BRukEf75fCYASQUbnm2/N+GExJeMQ7zCX?= =?us-ascii?Q?AjdC1XhhcSWcKA8WSHvGQzI9pMFwhkE8KLSx1AC7JPJNHr3qpmRx8/tU3H/2?= =?us-ascii?Q?2jB8sLyanNSqp7TEL4fc5393oeNTRfzaaj0pRurb2Gi4CD5VHVVUhqtifCZ2?= =?us-ascii?Q?oI+jkKjy0uUiItPcl71VR8eJUV1JdNVHOTuvHVHvMoloPkK0xZGSXaNQjaVK?= =?us-ascii?Q?CPyKz7ozzT/UO8f9RlS5Y/25sAOGxNq756K3N3tjhXxCAWn/3VPoD9WkN4gB?= =?us-ascii?Q?NSL7x4FmVMEM1tBn0xgxbNrhqq1KpykK937gbD+O3O47BrBHRLNb5aD+ba3o?= =?us-ascii?Q?TSgiCG/E9MMGZPmYar84bLPkTDDkLwgpUL8PPQOpvk1NNCyq4GnyEF2LDU0X?= =?us-ascii?Q?2MKLYZiAzSZU5zWD2/LsWO9uaBvSXDU+Utsnx+tvxLAzPA8OzltrThWJYC5Z?= =?us-ascii?Q?UlhGbhin7gJX664vMYFqUWGODoE3w7vfBHLJiGNDIlakpglSF/YZCL4tkRMI?= =?us-ascii?Q?Y5yUQdltOsiWQraGNHaWj/MO54WeEgjR7kkdil553fA21x614WZT69QwTsa1?= =?us-ascii?Q?LamSS98YtezHBi8CINEddBXT0jsV/PCI5xegfd2ZMbZQZBzexCMYKC5Ijw/h?= =?us-ascii?Q?s5AFHf7YMBSRLtvrm1r6H4979pro2sUScrpglA0qSjgu0ms7Ww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 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:PwLbLdak8HKF58CqH/vPz4voBSO6ftAm25cPQuzTdQ4wJz+3gRvqhrQ5X79Fhs1WmrOJ2grqkDLwKgmSZWz8zFgWl+dY0CNmpu6oQTal3B/YNj94vf2QXYZkJfWRbh3yFpwLY6pTkjh2u3KZmhsNbEp/Q3aM8k15Jo12owi0UvcV/Tahbc5fX9Whd6A5rAbuZa2D+P/m3TtMJQtXTbsQB4YeNULnQaVKsgWz2gdMe9qHMirxw8pvdptf45E4AoSVvgEjW1724y3Us80LIGPoeKnye/5ytajxEPmLbklXe/LfNorZPNDQKZrxHGzIw1Ei1sRI7/0YGcpkdebb1ojJzA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 17:30:58.1273 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 31/39] app/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, 03 Mar 2017 17:31:04 -0000 Add unit test case to verify queue to port multi link establishment operation. Signed-off-by: Jerin Jacob --- app/test/test_eventdev_octeontx.c | 77 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/app/test/test_eventdev_octeontx.c b/app/test/test_eventdev_octeontx.c index 26a21cb..ed761ef 100644 --- a/app/test/test_eventdev_octeontx.c +++ b/app/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