From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0078.outbound.protection.outlook.com [104.47.37.78]) by dpdk.org (Postfix) with ESMTP id E11952BA1 for ; Fri, 9 Jun 2017 10:38:01 +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=iz+4yXZaAZXntWmCx/N0xGBwUUD5qbsOIbAtfOdsKUw=; b=a3C8fMLRp5jo7Au66sEM1B8Ha7VNe2/zZ7YbMIfu/h53EFRubjpe34TSpUFQhDGMqGmd5oLAHFyvDGTtu6UeIjgIuayOWGGjSe8kInga92xNGmEgc1z4P9pjLdrjCECBdUTCBn0AVwrtU44y7omXFouVAZyOQEGLNSBKHVwZrJw= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from jerin.caveonetworks.com (111.93.218.67) by BLUPR0701MB1713.namprd07.prod.outlook.com (10.163.85.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Fri, 9 Jun 2017 08:37:58 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: bruce.richardson@intel.com, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, gage.eads@intel.com, nipun.gupta@nxp.com, gaetan.rivet@6wind.com, Jerin Jacob Date: Fri, 9 Jun 2017 14:07:27 +0530 Message-Id: <20170609083729.10586-3-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170609083729.10586-1-jerin.jacob@caviumnetworks.com> References: <20170607084333.6338-2-jerin.jacob@caviumnetworks.com> <20170609083729.10586-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR01CA0113.INDPRD01.PROD.OUTLOOK.COM (10.174.144.29) To BLUPR0701MB1713.namprd07.prod.outlook.com (10.163.85.14) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLUPR0701MB1713: X-MS-Office365-Filtering-Correlation-Id: 69e458f1-78f9-48a7-fad8-08d4af12d646 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BLUPR0701MB1713; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 3:8cCUDTVcKraP69KoDwWRyKsEsfgAHiR2dg24ShTaLgOYI+HZliigzIpBKZwvkAPQjdoAihjQRcC7MQ02qWU0QJe7zqDP2aU6vnnab+8hNG2T4bs0Bzz8XEeEyqzAuFzC6v5k6mtXMrWZNkqxnlpFOguUjVXbFeHxWHnTItOSsPBVUpgmD5gHDsu4Q4hM+HojAvwKYu5HRdSxLSAR02jYOz19caPG/NwRxLlcNwgWEzAEng30nectfoICCfggB7sT1FiGUsciY6DLvE86bvtREeyyA0w0sR4yNWS9+nNuO7fmBISFwWCdlw9XX9OBH0Fmx+fs4yx2udkD0uYczvk3qw==; 25:ww9Q3ZF8IZBgAzrP9y3pWUzWfflHWxeqqmZWFbhHoG9Ntj3Kc8HVm/47GI7zKOb5PcAUzeM8yKvseZmRu5Di7xoB+LOSfoJQEvsVQDYuKKvtz9Lq9dGqpZz/Au1igWDoRYXhXrVYSkgCCHhFBTU4xb5dxxA8qn/Y14O+a88voYYh5MBKFcVThABD1H1Et2/+d2WHal2ZZ7i07bS0+XQG7WK4QB9o7maqUUsDdYZJGAaadnD0smwvz3eTvCcrJRcBiClA2l/FkWFQQ4uHFF0hqZ1B7HOItVCwrssarm1VY0So6hTJOruMeoPbnXypVCPyfzP5bwbm5Hk6gikKWr3ngVYjNDitMfdC0SIfNJ2hIobmySOaP2vCLgoEt1k/RWVF3k4BB5F2jL6/5NMuf0LgmjIRWh/K/kBrB8IIrycXZs1QwM+RoZG1kJtbDAj/Pp7IownG8Z4juasPmCJRW9OfKUSRrSnumcyn2OJh1worVuo= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 31:z1FH3vnoZ57HXcY4z5n3wZHWRTtvE2+4Tg9TYlP6rqBxkdX+dziIXVUlkdytrj1Ty1HiVNez4g6ysR1qKzuoV2oDkvF3NIWHS4FdssCY1fWy16RzOXM7sfqX5cVGnni3l625n4VyOwt3zY524HyFBeTFV39DvhpkWuQLT8nV4IeMq1k4jKmBt+21HR411Ad+8mDjOmguLTYvKkpzO0Ji/Q5yQ0oYYLdKW6A//wV4Fak=; 20:3LTCXoVzoBAcZVVOWD34w6/GM0mxv+ZJid6lDBjXOOjK6SfsyMTrWuNP2+uSXoUhyK+Uj08oqlr37devf6Y7cfabgwQQrLKpgsGswCRRzTCuj8g38G06fyMmazY34tsK+UKjPse8QX/DQPYKOri+lu7ewUACNZkugantdTdNd4N+tzazACEkUfoQudbxMppGfb41SIJ1a4DXV7Hn0I0zOV55isKNXJoaL6EeK/hD1eMig08CMm0AphpD4I6CpdVF1WF0pskloFw9y6ldVfkpVYsS6t4Nuc8ElRtdU+Q9PQP9k3ukr8boE6T9zFValmgC/bgG+tcVW4hgIOkKGcdxSr3374m1HttKAUjzpwKa3AG1ea0Q8TpQgVSuACm5z0HgWX1PwcI7AKPDGRWFWScFThfLWukL7yv96jIfQj9/3OSv3/rk5tzy47i+e0ua5yXKx5bH90HX8auqdIUWQW8R5LnSkp2sftqsNrcBDqzJX6bkZgJFgTkGJ6JXV6qsPVhloQAoCNuIPvpOd5mqw9NBgBlRy5T5QieVqbZNE29eYR2FoLiO06ydBRa+KzuoIusUvkcF1/pANcHwu4IPZSay0Dh8T9T3iyA1aQDEWUOy3tk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(3002001)(100000703101)(100105400095)(10201501046)(6041248)(20161123555025)(20161123558100)(20161123562025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR0701MB1713; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR0701MB1713; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1713; 4:ZgyTyvVUvRj4gpALRYCJr+rLs9ZYd+MVu9yCcszu?= =?us-ascii?Q?A+GvdfdP68W9zDCkiFhDver3dbSDzAZRN5h2flbvwNGxaDV4gchzBx7SB9X2?= =?us-ascii?Q?SLnPywXzf2a1aDS3qVJOpnAReS3+VV3tD01mOK1dxpB/bl/v/VesMSzZXXzk?= =?us-ascii?Q?DbEMRAtlg/TUVyIMz7KP+dMFWEbAPQhDy0lrg/xt3FcOGdG5n08DFlgSi+wm?= =?us-ascii?Q?PVLm+gscSwUg0QCbW5lqPgJGt27m3sOJv810lt8inKf+4Pz6vgi1w/naKMsX?= =?us-ascii?Q?mbWSyMsDs3aikolKSvtUhpTynr7BHdZ0c0co3l2bBQhxrr5j95aW/JhCYQ+Z?= =?us-ascii?Q?WkjwWDr6e4clwokPohEYfQXfJ/4AysWTgNzem5qJkV4BsB+jIz3OOB4qFC6M?= =?us-ascii?Q?ByF4fnBUgUTz2shp+Q/HGeYhoof3hRCWzvir0JYCXRBFMIJxFNGQxR8BLEAg?= =?us-ascii?Q?3wJzbWBLjauXaXmP++41FJY2KLUMnEsUfMQeQsA0Gw0lOGEOwHIYQdIqV8th?= =?us-ascii?Q?nYrZRAcWnmy6aAd/9ab2ajH52SR9HvniCN04iBOt74ekA/dZ1HX6GP+LjVQG?= =?us-ascii?Q?nD0JuVVUwFx18HbDsrVwI6qYSUBf+d2f1wA2iXUyeSZLX94i0pA68N6GUduS?= =?us-ascii?Q?+ubD8P87lBZsop5XZNNKQ0fxgjM88OyVZudPfuilqTg91yYQoSDV33GJK4qS?= =?us-ascii?Q?rkaZsoLR12xUqHaDff8k1sFMcHxUhem9QoQ1HvyxHfCIa7cKbf1SZCZOx0VC?= =?us-ascii?Q?Kdz067Qn3mKKLuSRk27j7WKpt8T47rqGGfDDZkXPjaB1cvQ9J/o0OEMTOe+e?= =?us-ascii?Q?fX13aWUEqOMeHubqUCsWlVZhb26RIve/sBOqMq6bHRNql1boxMxnSmnPqQcf?= =?us-ascii?Q?ZnlZk3B/QLdgZrEgTNmQfT0kUAKUsu45ZTZvjTDjXGpSBgb4n1K9Shw9tC2k?= =?us-ascii?Q?lTiiyLDhA2tCt+l01x9jFAuyBtV2eb3enrE2dVKRTqgnv2q975Np463U9OPz?= =?us-ascii?Q?ZROaRgGlsSbixQItsM7WngHF/3SEEHGotYwCJIKJ1kscra3DVIc2IemJzJJ6?= =?us-ascii?Q?oPvtXAcUruuvYTeifFE7etaJVBAvOyBzV3CfHFej5gEAck9iRZydS3DS3n5O?= =?us-ascii?Q?YEy5Uy4uFF8=3D?= X-Forefront-PRVS: 03333C607F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39400400002)(39450400003)(39850400002)(39840400002)(39410400002)(48376002)(47776003)(76176999)(8656002)(66066001)(6512007)(5890100001)(2950100002)(25786009)(4326008)(53936002)(6916009)(5009440100003)(3846002)(1076002)(6666003)(478600001)(42882006)(6506006)(36756003)(6486002)(50986999)(110136004)(2906002)(33646002)(305945005)(2361001)(50226002)(81166006)(7736002)(8676002)(53416004)(107886003)(42186005)(38730400002)(72206003)(5003940100001)(2351001)(5660300001)(189998001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1713; H:jerin.caveonetworks.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-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KjaHt7Nd03pJA27vI50k3Qu3c9UKEGmKxhmWpc+foee9WGIfNzsxSisDR7SblzeCXHTfdKAnL9/Kv6JBze+bValfblefO76Lr2w+G+Rh5+Vc2VoghJwZYGqF6ZkN8mtGTWPAJHh38uuxjUVLcSFyPOM2TS6k2I73tP7ToEy86ZncR9EFqbpnD8aF0Tom6XM86kmNt3PgsuuxXHKbqJlrUr6ntrYzHgHlWlM5hExTSZAnOIGJvinwBbyKZAD1gjAGQ5qnGZnjx3x2uEJp20Rzr83JDYgbbQzFOmIDlTeoLCXVxSTLksQRDGda4/FaLItPvA58mBaZI3bMSGEvv36cSDFbwm1rAShBuLZ1ISGyz+WHKzbEkYuG43w/76E5HM8EbsqdCSZbCx18h6snKRjBtb9mtuIG0wfZ3d4tNFVAM8x2VdHp5MwaMf1+cScPqvhY9m4MFUzCeGrzDnL/t981Ecx; 24:lqbYu3Os3oWwwc0ZgUisxaI1/1aPc2uHFCNzAsVTlES6w+CWPU6xFUy5bFNjjHIo8X0XXy+AYQRP+jpqa5Pehs76fRm0YhV903dTUIk7bcw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 7:5dCyFjzOp5TKgljouaNd0viT/OgAGHRTM3V4027SkyBo0jqXJHjApRIEKqroTyCUkNEzppDqqZHIqnX6AClFrX7Rvz6k+WuepthFnXCoIxovDYqRLSkU9I+a89/A1khLNS/1mfaUjFWKhOPLaw7GIPQI9FIhLBlE+DEXHgyeoA3+406I4HU1Z034Y6uCrNp553iThtmJIQMtQshBqlZUVOCLpUgXV30DI+Ikgi7ifuH1EOHhW2rDJJEX3wdEDnaYve798rxFjMx/7O1Y6/JtFvruspP3Rd/s+9vviX83fDRlq3/oQlXcLW+pC9fUdlm9Jib8at7JbEh2rr1APHVstA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2017 08:37:58.2910 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1713 Subject: [dpdk-dev] [PATCH v4 2/4] eventdev: restructure event PMD release function 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, 09 Jun 2017 08:38:02 -0000 Remove rte_event_dev_close() from rte_event_pmd_release() function so that rte_event_pmd_release() can be used in stateless way. This will enable rte_event_pmd_vdev_uninit() function to avoid using eventdev_globals global variable and the need for exposing the a global variable to PMD. Signed-off-by: Jerin Jacob --- lib/librte_eventdev/rte_eventdev.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c index fd0406747..74a2614c4 100644 --- a/lib/librte_eventdev/rte_eventdev.c +++ b/lib/librte_eventdev/rte_eventdev.c @@ -1171,10 +1171,6 @@ rte_event_pmd_release(struct rte_eventdev *eventdev) if (eventdev == NULL) return -EINVAL; - ret = rte_event_dev_close(eventdev->data->dev_id); - if (ret < 0) - return ret; - eventdev->attached = RTE_EVENTDEV_DETACHED; eventdev_globals.nb_devs--; @@ -1230,6 +1226,7 @@ rte_event_pmd_vdev_init(const char *name, size_t dev_private_size, int rte_event_pmd_vdev_uninit(const char *name) { + int ret; struct rte_eventdev *eventdev; if (name == NULL) @@ -1239,6 +1236,10 @@ rte_event_pmd_vdev_uninit(const char *name) if (eventdev == NULL) return -ENODEV; + ret = rte_event_dev_close(eventdev->data->dev_id); + if (ret < 0) + return ret; + /* Free the event device */ rte_event_pmd_release(eventdev); @@ -1293,11 +1294,7 @@ rte_event_pmd_pci_probe(struct rte_pci_driver *pci_drv, (unsigned int) pci_dev->id.vendor_id, (unsigned int) pci_dev->id.device_id); - if (rte_eal_process_type() == RTE_PROC_PRIMARY) - rte_free(eventdev->data->dev_private); - - eventdev->attached = RTE_EVENTDEV_DETACHED; - eventdev_globals.nb_devs--; + rte_event_pmd_release(eventdev); return -ENXIO; } @@ -1320,6 +1317,10 @@ rte_event_pmd_pci_remove(struct rte_pci_device *pci_dev, if (eventdev == NULL) return -ENODEV; + ret = rte_event_dev_close(eventdev->data->dev_id); + if (ret < 0) + return ret; + /* Invoke PMD device un-init function */ if (devuninit) ret = devuninit(eventdev); -- 2.13.1