From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0049.outbound.protection.outlook.com [104.47.34.49]) by dpdk.org (Postfix) with ESMTP id 386D1FFA for ; Mon, 6 Feb 2017 06:24:33 +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=+mZsmTr05koR9zAb1RmU26TykeX3k8t7uZvniCRO2lw=; b=mLl/SXUR1+R4/MkXNUy/h0fQVTo/sYQL8ocC0qC1znGmi7voTEEIyI9OrXS/A3BjCQj1MsB3X6RlnbaxULRe4tugz1kgBzm6Wn4HnBepnxHZr2JovFafsggvGjF5fencDhNlZKkeN5VgrIcoVepl5QmvxzJEk9qstgkU1EKCseU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain.localdomain (122.171.53.66) by BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Mon, 6 Feb 2017 05:24:28 +0000 From: Jerin Jacob To: CC: , , , , Jerin Jacob Date: Mon, 6 Feb 2017 10:53:40 +0530 Message-ID: <1486358620-4075-5-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1486358620-4075-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1486358620-4075-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [122.171.53.66] X-ClientProxiedBy: PN1PR01CA0029.INDPRD01.PROD.OUTLOOK.COM (10.164.137.36) To BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) X-MS-Office365-Filtering-Correlation-Id: fef0a78b-5b49-4f75-13e6-08d44e506d61 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 3:T9+ywAVpFSqX/ElpXsICO9ieRq+mz4FIYv5B8ux7KFm6KOmnrITXCOvCUXoOw1ws379qSXQrhFRJuydVZZgXzsjVirrNjes42RgIbiwRsUJraFLEQt3MCuym3pX7TdjDrof6t/4KQRx+8owMohHAJuLQhU8Mx0FLpeXjC7+XKXKfsjOnMyz/3jURl4uyAzEXoABERTnUh8E5hN+ruoJaAQ1QxJWCDNS/8ihRh9GULQQU+vPRidVgim8I7O/qpsm7LPOTzjXtXfFFmvB0zrJ9WA==; 25:Z9n+61A0xyXGooEeG40PZORzkxmFLVy5IqdWCmriQTy8Z5DDRXUT6aG2A+H77R6nQiZAPRnG5NwO35SMJTb2RKjFteHGXrJSjpDDhzDMdw3GA79YC2LvHs3a2/gcr7jPWb3UzLcvUBQYjeaa88UQi8GoKl59dbfS5aGSfHsUsRYQ+oFbPV6SkUF59nEu3FxmnCiHocUMpJzkSK7JGx8pui6Z6RXoLkqW0jP5+7r4ETmTfbhTckMVngOX6HQvlCJls/1vEeDEJLsleEZ0WxetLZ6wVu4x/FLZ1zALRH108K8FTn+v4sM40f2A0PHa3N3vzHS/rcEpukR4fmYHnIdd6bqDOR2/Yn8+oxo1XjWK3KowsFfiqMVawnEXiGlrm7LdPlxsjNA2fofmX/CgiBKoXvi3nMvNgg8eiACTi1DaoYrRPGRx1s79v/hs9tiocGXp/rb6QQEXcmekvfx6xYNRjg== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 31:CII1UDESZkFzXF6lIyPdwfFLeQnctGaUdC1Wj5lvbwSuxMDVlgiLQduZg4hdr/AU+xp3Itjhmg3AMR6s5d3rywP5ja3KWs2k9a4FTEZ1g8YSlkKjkzjU5V/D17DuYWWiJgklnJHFpmNYX9hF3Kzhn5R8NHBzpREHKLyBUholue+QU5u+8IFVP6tn7RreSJ6B8v8OpgQIqPGoFNux1ZnEujYDofsoyzAeGe1+S/3pam3f4fS15uK4DMd3o0VRcU+GsJb08K4wqnLz6HD0vB8qiQ==; 20:UqgzXBAuGvo5TZCcHA9q+BmqTqIRXvbMOx7NY2rVGQULmzUxnfY1e2feIipg19Lwju1IpOAvZc8nBhiSinj7XDYLYiwGwWYDvig5RSK5NAzRPrgTkdLyOnVLZRU65l2rkDhW/q9EvUMwBjGFvYAAg4Zasr4JNrCXpR5NpVUDNK9zo5p2N4qzmDDJx3tRZVLoBUr/escyoeBqNT4oIs4ieVtoQO/spHmLyBIt5lQHjKUZgv+uepGt9GO57AF6qNyXt7g54SgO1URn0jGfPyoJKNUfruhGGADeezjwLO74PVgOzUZZgALZDT98ADn4DHofR12c+rXSKrz5aRIAsCqGH1TOk7EICwZ/JNiZbyiCgHIuITyCwA93oPpRYmSZCZBYkLTrUog8fsjnQOEuWeslomzwKE1UDv5h8gUKlVjCD1Ze8K7AhXXCo/7SJXWlzWVtEN25eKDU1ZCZ7HS7EXwCt9hAMLj8O/pKYBIHAtcFQg3izYV7A7JsCaDmkazfUaNjwtynhU/bR+5/kX+KTEmbFDSGPiuN6xAeU/5BxwjoQGgwircaswa7qV2z9VOrLkRrIBVOPXdReyNoEhpAxMlcgBM3g9zix0oFRllo3rookHQ= 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)(20170203043)(5005006)(3002001)(10201501046)(6041248)(20161123555025)(20161123558025)(20161123564025)(20161123560025)(20161123562025)(6072148); SRVR:BLUPR0701MB1714; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 4:IXxUrpKwZmeM9HbjoIHf53KsQA0cJyoJ3Y1yMTVbF0DMTdmTQQRXvUeuwgRUWt8QKgojFv/iStnUSHQ3y5vUbHuy9tTQFw5L7y4V/gk2A9+yU8a9a0s4J1HaaBmT7uFm7tZgHxsCzDUMGdTFu0pYk+OBcSRaABhjDzALBNNDrOesdaZXR/Edjl+0YiwAe3tul5bIfHt5daBb9dgcv/5WKrGWTfQ+/ijsPHfupKrC/0Y3y2YUAPGTRitjvCmECg3Sn+1fQMQMQVzXEkOiZ3ZARVsbh7ZkqbMZHjusLW7w6pLvQaB5tbDrtvnecauObZRoLtKNcA930ZSETkV3RS4UAIUokWURBQHk0cSPMxcD8H1GP9Cx542j0xXOQ65BgyKgPtTJVS1CZ0GJ7LGdNhGGa63V5QttKhz9XJISVzEkyHzr0vuQFfiolTXcQCC0bdYmjrsvl49rlRVciuKTuM7cuZq2tkogknda6/G1osQsxQUY+lisPHn7+IQGUNMliiFBRAkQttuWFyd2elZpObXPwGuafkRJjOkb7piHGIRXxes7p7M+bgrOC9EsSJNq82PHbvjMYiWIHXe6sUUht3BoAg/+si1CZMY/nV0sQf++NB+SNEWFBiAAWCBEyNyrRhkv X-Forefront-PRVS: 0210479ED8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(189002)(199003)(42186005)(97736004)(50986999)(5003940100001)(76176999)(6666003)(53936002)(47776003)(38730400001)(107886002)(6916009)(2950100002)(42882006)(2351001)(4326007)(36756003)(6486002)(66066001)(110136003)(101416001)(6506006)(3846002)(6116002)(81156014)(2906002)(305945005)(6512007)(50226002)(189998001)(25786008)(54906002)(81166006)(7736002)(8676002)(4001430100002)(92566002)(48376002)(106356001)(105586002)(68736007)(50466002)(33646002)(8656002)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1714; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1714; 23:K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JLkUF3jZyQ7qUR3OyGZOALzeNrGw4rhBMTDJ320YsazQJzjv4cN7fCB1ONYlePoOmvNfprvSw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 7:ZJORZXgwm4Nz1x065rHNunpemakt/Zv1R4PMJSs/bu0qvH98mEWcXWiAa/0ZQLQpWFauusytf16K0FKr3wMCJja7Brv/Oa1NeXiGeCBU1mElUCA0araXVN3lsIbEVuC34zeAG/dyYUx0soebW+N7q1nlMv/quCq0VsrxvBRO1Q6CLwurCW2r0bwJSR4jk6emgaBK19sFZKnbeZ6mvhfbVv8NO+7EW82kA19RCUTryg7hg4p+z688DNGplZJmRtWlAGBfMXWWmdbuVyFhnJgXL51UjthVMpj/5tnlEJ0b/goQaQ7Y8To6/8a5JJygR7sRevU+tWKYUXxCMlEMz+G5lY+u1AG1FIuG0N/x88TwrZti0JqsEBn+M+M9GFYM+NyqlMNBZ5ajTYa2OCrZb58sKUt6ecOe2ygowYgoX1cdPrHI4BerFh1XzNfop7wMgaMlxqYyxGzBqxXh2eqL2LJjucIW8mjoHS4NXS3J8Ier3DTLbVtzaULIEbKcATqS7AN70gMn1yNWNmUOxNgNsU1Apg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2017 05:24:28.1409 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Subject: [dpdk-dev] [PATCH 4/4] app/test: unit test case to exercise eventdev vdev uninit 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: Mon, 06 Feb 2017 05:24:33 -0000 Signed-off-by: Jerin Jacob --- app/test/test_eventdev.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c index 042a446..e817838 100644 --- a/app/test/test_eventdev.c +++ b/app/test/test_eventdev.c @@ -51,7 +51,7 @@ testsuite_setup(void) if (!count) { printf("Failed to find a valid event device," " testing with event_skeleton device\n"); - return rte_eal_vdev_init("event_skeleton", NULL); + return rte_eal_vdev_init("event_skeleton0", NULL); } return TEST_SUCCESS; } @@ -720,6 +720,62 @@ test_eventdev_close(void) return rte_event_dev_close(TEST_DEV_ID); } +#define TEST_EVENTDEV_COUNT 8 + +static int +test_eventdev_create_destroy(void) +{ +#ifdef RTE_LIBRTE_PMD_SKELETON_EVENTDEV + int i, ret; + uint8_t curr_count; + char name[RTE_EVENTDEV_NAME_MAX_LEN]; + + curr_count = rte_event_dev_count(); + + /* Start from one to avoid overlap with active event_skeleton0 dev */ + for (i = 1; i <= TEST_EVENTDEV_COUNT; i++) { + ret = snprintf(name, RTE_EVENTDEV_NAME_MAX_LEN, + "%s%u", "event_skeleton", i); + TEST_ASSERT(ret >= 0, "Expected >0, %d", ret); + ret = rte_eal_vdev_init(name, NULL); + TEST_ASSERT_SUCCESS(ret, "Failed to init event_skeleton dev %s", + name); + } + for (i = 1; i <= TEST_EVENTDEV_COUNT; i++) { + ret = snprintf(name, RTE_EVENTDEV_NAME_MAX_LEN, + "%s%u", "event_skeleton", i); + TEST_ASSERT(ret >= 0, "Expected >0, %d", ret); + ret = rte_eal_vdev_uninit(name); + TEST_ASSERT_SUCCESS(ret, "Failed to uninit skeleton dev %s", + name); + } + TEST_ASSERT(curr_count == rte_event_dev_count(), + "init/uninit pairs count mismatch"); + + /* Test in reverse order */ + for (i = 1; i <= TEST_EVENTDEV_COUNT; i++) { + ret = snprintf(name, RTE_EVENTDEV_NAME_MAX_LEN, + "%s%u", "event_skeleton", i); + TEST_ASSERT(ret >= 0, "Expected >0, %d", ret); + ret = rte_eal_vdev_init(name, NULL); + TEST_ASSERT_SUCCESS(ret, "Failed to init event_skeleton dev %s", + name); + } + for (i = TEST_EVENTDEV_COUNT; i > 0; i--) { + ret = snprintf(name, RTE_EVENTDEV_NAME_MAX_LEN, + "%s%u", "event_skeleton", i); + TEST_ASSERT(ret >= 0, "Expected >0, %d", ret); + ret = rte_eal_vdev_uninit(name); + TEST_ASSERT_SUCCESS(ret, "Failed to uninit skeleton dev %s", + name); + } + TEST_ASSERT(curr_count == rte_event_dev_count(), + "init/uninit pairs count mismatch"); +#else + printf("Skipping eventdev_create_destroy test due to unavailability of event skeleton device\n"); +#endif + return TEST_SUCCESS; +} static struct unit_test_suite eventdev_common_testsuite = { .suite_name = "eventdev common code unit test suite", .setup = testsuite_setup, @@ -765,6 +821,8 @@ static struct unit_test_suite eventdev_common_testsuite = { test_eventdev_link_get), TEST_CASE_ST(eventdev_setup_device, NULL, test_eventdev_close), + TEST_CASE_ST(NULL, NULL, + test_eventdev_create_destroy), TEST_CASES_END() /**< NULL terminate unit test array */ } }; -- 2.5.5