From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0077.outbound.protection.outlook.com [104.47.40.77]) by dpdk.org (Postfix) with ESMTP id D6288FFA for ; Mon, 6 Feb 2017 06:24:28 +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=IRZ17dqW15on/EgGOhv8fe1XMuLmcHdXqrPtth/FMJA=; b=MZiLLnf6jbzDeY6JEAgjCPBWYdm+k9FrtJ0LfaJeaTugM3uXf6zQInJYeNk1hBp/yzFoiYdm4Lt1VPgmPTLFg4erLTRCtE5nNNtDhqCyMxXwUrOQXgXQD1f1XKkB1zhjJu7xccaC/qSN1BYh5F9IBgzgetZnUW4Ep2GspZQffSQ= 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:24 +0000 From: Jerin Jacob To: CC: , , , , Jerin Jacob Date: Mon, 6 Feb 2017 10:53:39 +0530 Message-ID: <1486358620-4075-4-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: daeee741-6059-4da4-79ec-08d44e506b5d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 3:ryJAhpiEBVPVPAHQ5zwHiRH74AazvGOflSGliGSNABDQqG0nVmouFKwEN7ZIoh6ZAztNDAOHiZZsyM1DXLB7bY56hRMcgCbIjDthumWgZBw7ETxHP7YF+5toTuNdSWNHJeHYYyx6DZmp/0CqFehmxp0/YPAkcpgfwA0YQq8bVDudUpsdvxEG/nnZ0N4ws94kB61iOS4ApnadAbBo8NX8Bsgmhg/qjS5BboIz9amDwjr+gQITRELx+lzKs1O88yXP8xGobI2NjiGk6vX/q3iPAA==; 25:IrM9iouWYjtCniP86870o8pQEQVbP+R6Pqd7r5scw1s9M67ZeenxQZuYA58tS1V27sjq797EuizGAdxvmVvr9flIQHl1EJcQ4TF/3e8VQG6m7h0vT/WatFHqyH7uyqHK790oY60e1O9MNWDK6y8AI0ZV6va+NXY4PLkAIDMBHbtu815MUmsSRNW+mdWs8Q3R867I9iFGytrjJx3YS4nEKh9qI1lx7eC8LTQXSJdrPOtmej0yWLA0d97ZTBPLsJBg6p36QaTWwUnP0sS9z66YpuqbH66KpfRazGPF+ENLft3t5FnuLAbd8pvqB68WSPUo5jkSnpd0nUgd0yqgQqLmYN0SNRG626UEs1GVbm5kU6XdW7mM79Y78l3LOB10HugJB7F1zPnnv3Li2klSQ9xsjWpTCj7BxffDLD3jAOjWYYMRYrb4mrE2acCtOvflqqp8jGlwQrkXczMKOQWdtriOlQ== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 31:DElUkwfJpJZrMYoTSE0/pwBPleRHY9MC2TTCHbD8JbCDCTV3t0NjRa/rfugZgrmBaGgg9VSopq0BBv7oYccyjD0HQaJCAKuW8inH6XjxR88vcvm99aeskuYEh4X8KQJA7FkQ0d6DQNSPkyRimiRxZZAxQkz3UpAR0C5NWgvq8jMPNzsfOiA8TRBcFa2jUTH5eRW2xtiarz+A51ViQCSMgOBQbReR5AU9o67F6KFwNpt0SjmRH5jsh3uis2jzOJHy3+jn9zOj4seOTwbcPGdEFQ==; 20:flEvTI6TPLI6lOXgt1icw69oXwlQjf1rDI8+1PBcezNZfR+vNVt1EKANPFWy+rF3g8Z9jhjmXm8o11Ac9dAsFxBRTsoFOG99djBW6I7qRTp+AmFGffa5g5deQGmjKFq8STff5V9PXjS6iQ28gS3GvuZOxVMX4WP7ZYjXEdZSXhGqtObnk8CedUa9IqtwPjEtFdSCSUnz5uCVRERb0gHAepBY2VSToI4M9TR5bwOHMR8f8D18m2zTKLOr6KwK9XiOEAuAJlc7qL3e+Spvsi33rt9yYzS0O7+/pEnNoANqEU+Kt25uKspU6q3VglRmDu9ZT5unNOzo5ZRIXIaxxykfUl00YBZXSP3XCtWhXOLKDCfd+0rD4IKIfPCrbi0TIlqQIvQiXlE7f9JbqsJSHMq7X/1UU8GlPVLmN170KENBkATNn/D6mnJKSYd+E/k0WANnswbjwwgvbX/ZBIyS1QsJyfWnYYvV1utWuFoeWpDAS0wrWsNKIPhtkqadOS+Mw5bTnjiyg/HQY7M9vxan6/VPtnKK2/Xu5IxS9KTN8jobek4BiccX1LA7drafemElk/pyK7uByMOj9/nlExRUtYaZwvc6Pj2vg3MbvK+A5cprUco= 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:aR36YqKVw87c8lzjRsq4f/nUfbaDa4N/jIP0N/kaFtlMgUPPccqFGJWdNZTBOnS+y58hnFF/yd8j9CA5WgnaNCblrO1a/0lGk8k2p9pNy2zYmYSsIzPZWE8n2V+3/Eg+48X2drtjildp5g61pVosH4Edq0VluBxaltHdTmPFP7vgiIWC0txNKl3UvzhOk4UgimTJog5BCi2FAx0ynw2RIe7zIRWbeOOdDAJUbhNXz6OC4lmvGr2M36x42NZeSHhIY9V+Z4Kc+9lWpyFU3dbS73nlgCVSF1d512GnsnVlt8rusFxELIWlwlGKZVOQqGemi09TyH0C9Re63rGheQ0eQFK3mTUX8ijctZ5vTAxlo90oVLklXSxtNr5JvacaYOh0CF5tfB3XvqSWUErs6/joj83FZtndSVfvQj3R/eykBKtS47KdmvdlzdM/OnXFIUm4xm9Dyj+ZDSfVy6lFXHAr0R8FV5De9bQjvEvS4G4vcCSZPx6QOBuc+yXWSAm+fQ+iivRfwxQxPTywFAPCWyPcvPVl2lJEF09bvPS3ZKyyWGvkK2XBmME3pw8SoNo1sQMa10URPbpJrjTSQXttWdF6wkYvFSK/TRjoL2GBpHQ+c59IBJ4e1A1wTc68RvPGBweQ 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:K1tojxorEnOaNbO/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RkJQauVGwPEvLBZqSUBIrWnRcQzRl/sxpOoPr4gtDzcEr6WI5y693UgKzb0xp85osT97dk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 7:iki94QvCYYsZIwKfZe2sopIMZsmQw7KpKIKabbokSg0T+s1YgtDefX0VTEm2iWX/KHM8W8n2rW00+3UO8WuNK49yTYaa557FfPfK/xsZjWaO5zodmYh2D2FErwtM5x5wLgu2vLPJOJLUWW1s80qpvRf4vSx52mHAFkoM3E1U2uYrT00eC6BjEMuTz6OoXs1vEvN3qmm0KT4RwsjgtXLbUPXCYKxglJSvGKOTNoB9F7dmVdqi4wt1jrDSQomzLbbAyyfKF7y2mae96YlnWsPCVRY+HUrySyBTtO0JcFvk8duT7nJPx60yuMUKUDSpyZByulolSrT7FFhILx3GCjDwh74UKwmkeJod/VywCZ1q9qBm+vPT4/FQvqchf5QpNns+zPR2HUU18l95OoMFJCbONldXnPYlIrDEiwsLkc0Nk6T/ncUBb4uRKw4t3UwoyHNnv5CPlgQR48W1Sx5ejBzdUNsFSALZZtsdHY6BndVtQoIEH02MizmDq2y6rp0BTOs8RPDBwCo6jG6ic8xbLubFiQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2017 05:24:24.9671 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Subject: [dpdk-dev] [PATCH 3/4] event/skeleton: add vdev uninit support 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:29 -0000 Removed global index based device name generation as vdev uninit needs the exact driver name used vdev init. Signed-off-by: Jerin Jacob --- drivers/event/skeleton/skeleton_eventdev.c | 42 ++++-------------------------- 1 file changed, 5 insertions(+), 37 deletions(-) diff --git a/drivers/event/skeleton/skeleton_eventdev.c b/drivers/event/skeleton/skeleton_eventdev.c index 085cb86..46e75d8 100644 --- a/drivers/event/skeleton/skeleton_eventdev.c +++ b/drivers/event/skeleton/skeleton_eventdev.c @@ -439,44 +439,15 @@ RTE_PMD_REGISTER_PCI_TABLE(event_skeleton_pci, pci_id_skeleton_map); /* VDEV based event device */ -/** - * Global static parameter used to create a unique name for each skeleton - * event device. - */ -static unsigned int skeleton_unique_id; - -static inline int -skeleton_create_unique_device_name(char *name, size_t size) -{ - int ret; - - if (name == NULL) - return -EINVAL; - - ret = snprintf(name, size, "%s_%u", RTE_STR(EVENTDEV_NAME_SKELETON_PMD), - skeleton_unique_id++); - if (ret < 0) - return ret; - return 0; -} - static int -skeleton_eventdev_create(int socket_id) +skeleton_eventdev_create(const char *name, int socket_id) { struct rte_eventdev *eventdev; - char eventdev_name[RTE_EVENTDEV_NAME_MAX_LEN]; - /* Create a unique device name */ - if (skeleton_create_unique_device_name(eventdev_name, - RTE_EVENTDEV_NAME_MAX_LEN) != 0) { - PMD_DRV_ERR("Failed to create unique eventdev name"); - return -EINVAL; - } - - eventdev = rte_event_pmd_vdev_init(eventdev_name, + eventdev = rte_event_pmd_vdev_init(name, sizeof(struct skeleton_eventdev), socket_id); if (eventdev == NULL) { - PMD_DRV_ERR("Failed to create eventdev vdev"); + PMD_DRV_ERR("Failed to create eventdev vdev %s", name); goto fail; } @@ -497,18 +468,15 @@ skeleton_eventdev_probe(const char *name, __rte_unused const char *input_args) { RTE_LOG(INFO, PMD, "Initializing %s on NUMA node %d\n", name, rte_socket_id()); - return skeleton_eventdev_create(rte_socket_id()); + return skeleton_eventdev_create(name, rte_socket_id()); } static int skeleton_eventdev_remove(const char *name) { - if (name == NULL) - return -EINVAL; - PMD_DRV_LOG(INFO, "Closing %s on NUMA node %d", name, rte_socket_id()); - return 0; + return rte_event_pmd_vdev_uninit(name); } static struct rte_vdev_driver vdev_eventdev_skeleton_pmd = { -- 2.5.5