From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0064.outbound.protection.outlook.com [104.47.32.64]) by dpdk.org (Postfix) with ESMTP id E30B42C1A for ; Wed, 7 Jun 2017 10:44:04 +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=tYC45tmpt7dHcrCtLa+AMF3ydJg2qZrhrxznh6Psq8g=; b=YXoET6QcpUy36bVKQo7USIX3wsdO7ENaNDhVBSAjakp5DSjiQXfvEl/VzmSwHNkOwwHUhtN6hQoAfEWISPGrell/KgCZyck9DYDGtW4BIkGyLX7/Gl5w9BEHz3Pjhz4MXKQEJArSQuEoGmaKuCnzMAuf23aDknvbkTB02+GRUxo= 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 BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Wed, 7 Jun 2017 08:44:00 +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, narender.vangati@intel.com, nikhil.rao@intel.com, gaetan.rivet@6wind.com, Jerin Jacob Date: Wed, 7 Jun 2017 14:13:31 +0530 Message-Id: <20170607084333.6338-3-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170607084333.6338-1-jerin.jacob@caviumnetworks.com> References: <20170606141046.32103-1-jerin.jacob@caviumnetworks.com> <20170607084333.6338-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BM1PR01CA0076.INDPRD01.PROD.OUTLOOK.COM (10.174.208.144) To BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLUPR0701MB1714: X-MS-Office365-Filtering-Correlation-Id: 890b8e96-29cd-4f71-7e9d-08d4ad81598c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 3:tYWzb0nfgdg89a8VChJUev/4i9Vb1UlmS+zdARmfxhm/P4nYeYdmE/KCVsxvL8lPJu+WzDxK8+snPcoYAvr17D7j9lpVcHcsOrOgOMspJo8PqH+bYWEgB+DYH2MX4XLdVk4ADkhX2R8Wj7Chbs4uFSyJE52sCxDHdCWYcaSb15p2if1dLf19041K4GB3Yg6/qmv4gWjLC7SaccZN1sDoROgbWNvfTxCzErvO3KoGq2kSC7EigN3eDgJaRBJTY6CC/cROMwEOwCoXHHHyzyKZP6uKCApZ3StFe5xHQdGtAv0V8tqwiqjmfg9dAeCChE3QfyF3eM3oIMtuBE0ZJ1bPiw==; 25:bAfScbXhgpYU9gHHFLFzhv2dX0cI7sKd68DDxANKI62Hyon3GNTac39u31ZSs2DaLzf+3hF/ecxj3WRHl9TLrwD5J5WU/1QWSe/+GTLbfFTzkSfrqr7F1aP4hdrFM5QIGNL8dTdTctZES+RqiWntJQB6exsDRsEe3rDfG/E96kgqujxz/vGSqP8aTaB4BjRXlwC+nAjTAgOXawq1EE+kyMiL5BDfJsykioliH5LO/+9/r/aXkrrOm/uL5fyh1i0kVmOBYVkLP5gUkqnsOQvdq4AvJzUW2hnZPvpNsqQmUZ0vL8LLBc9F0OYCHx3IQ3NbgKDLYVpeCnGZ/Pbsndh8OeZm31diOJixxwp8g7e1slA8DYNjnJc6hJMht8R2pMwdosBfwdb/LE86IKCFBKaIgep2f55Yp9uj5D7nInSrCuNFCjLlOIewHDQhs3wIOYDKCDVU1dwOJChSGD3T1xjMN1cPjjY2ikINDrgO6/BmzQM= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 31:7awUXUCMTC0wlxpSVgdoJGBAdGsdmSbYWRapsiTJ+DCIbotfF1j1LuJ5sKL7zzxGZ02KPch8WpZ+Mq5zQ4JKqJ95eI+/O45OgICzJqvkujQhllr3XbAuwrt5QdOtramKczXi5xq/0SR+BfC2Vblln7w4ae5bOTkLzIQg0Q6FsVAJIY6Ps1EUpnUVzhc3voHJ5a3D3ZAB0Cjsw+j7LU4gu/xvgewzdbybEtWP5jZ4Jn8=; 20:n8ZCZkKm/7Xe8iZaeiDKUJq8+rUniYPYIFHByaRB6Yh7rrBvthJg9OV9NOylznUDxhEVfan//GsJC7qLd8RhqtV/k6xHVa4mjGGEXd78FN4Oo0Acf7gHpaGYVOj0dPwhDW+x7YXPr3Lp2uQMobX2T7TDWnsnXvDWOps3NyeDIiRpwbHq2OIKmPhymiML8TMHpUBANZVNichyOgDO0VzH44q39hv57ylWxi7xnuF0yj+EUNinMLTwUm7JfmITza0fHmOagB3n3gfI34yOZubeqaaaUagUPzWYXAI8Tx0rQWiQOHktv4EiGobwcZLroqk7hBIU/LkmqpAHyYIbaEDMNlE86tAsr1jWNMojpRXlLqEeQ059OP9TpynV7Pk6/B5h4ZqhT5u4OgFgeypZakF12UKWgtcnaOeU2gp4jMTRjmXOtd/vB/OFwGnNQyV3YesGISQETUdnEBgxkC4x5yHGrOYkLZQscs5VkuK2a9IzQ8sVC4NRXVsNo0J48QM68yF1V3G1+jnYunqMab85v4RQ35dvra+7uJi5y0qRrO9Ft1S8VJ0xwGginqVxT0jyQ1JLAKoSdyQ4lmYHQT7OyPF2UKSWwpbz3A4ZiESJIv0JkzQ= 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)(100000703101)(100105400095)(3002001)(93006095)(10201501046)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(20161123560025)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR0701MB1714; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1714; 4:emp5B+gS3Hx2ONUoMOnA0u4ZxV4ljZO61k/Kfwu2?= =?us-ascii?Q?LOodP9H5NMa5W+yffU0jueWhP4OYnTagpKWMdxxOdEcQ7Q9Z8Z5CBJ6mJRPe?= =?us-ascii?Q?c1aVCRyWMSArZhF+ZW1E1CnsLccJxYjqBE0qdJHdCKvFeqLqMiIGbHvC9uj2?= =?us-ascii?Q?mzCLMAUaeP6Vv0q8XGdnrBPHgdM9XEqjBiqPNz8KIWtbvomg4jpMPc2jqEU2?= =?us-ascii?Q?3i04YRNuZUUFaUuVyYgSfW8OurtNpK6rhA3VabNDNKsJHwoSeqeRONi7Vz7O?= =?us-ascii?Q?Ch8bW7UatQNoPkdmKEyQFIZRXaTp1Ll4mgeBPeF6TX51O3wHViH9HYztQfGt?= =?us-ascii?Q?Yy1FuqJM0NPqcnpAT346ZZLdruFnhG7Vzw2964c0Ky3IG1rKMywDDYEOiG7Y?= =?us-ascii?Q?aRGkCVzH75vL1edVNrQVCayuqGFndEXBfMsPqV6+P2Hbj2cn6CjcPQksHKv3?= =?us-ascii?Q?dzy4Yp6pBuELVlW6AVMbMw06Vo5dliUGnWptTHU61KKOsaEu2Ua8y9T69/+Z?= =?us-ascii?Q?LTPxRt+sbMyp8D5+rqbOvXDwAfs18n67rzV+k8TQeZ8Peljn/6nFEj96Xpkl?= =?us-ascii?Q?gbfHVG8mnpD6LfyTkB9boMNJI5VkXdoSokqD5Aak4Kk2YF6xPy2GPw8m6tbO?= =?us-ascii?Q?y0bKkAgeHjtXodpv9zetYswcjZ0QPqj7Gk434SNgtL8B7CpLXGY9ddfDDuJB?= =?us-ascii?Q?/W8T2qG/tONKu5PPaVxUrICKiqkj3Js1DQOMmVz8qLY+EIxi8T4mw+fdPd7h?= =?us-ascii?Q?sueWDDVCoDvfVWOMB9PIWbPTA/RBKpUOxrQAq2PciP5IhzoqQmS6ByFJtkxx?= =?us-ascii?Q?0i0I2C7IP4NO3b1w5K1Gi6tjiMr9Zt7DCSIaZ5zaOfHtFLrn4+0tHtRghh4a?= =?us-ascii?Q?F4JVr9chnZxO4uzTpYCGGPVwHgKv8pKFvyHw/W4tXOmkoz+JwsKHkXgNjTkj?= =?us-ascii?Q?Mxp6pRFPkxtf2D9yXdsx3klFzedPTNXZClA7D5Kg7CLAvqeaV3SJ3C+YNmsM?= =?us-ascii?Q?+YCgEgLuj5hlUPCPLlPCsfwM2Y7fEvfTKcaOxIDXJkJyhGQlcOTtpmP5pzzr?= =?us-ascii?Q?tJuZUbhOrnQjBpQINlYZDz98UlDwonZB+fLKJS+NOhn/RVBsjoxAb0Gjw/zK?= =?us-ascii?Q?zyby76VNy5Q=3D?= X-Forefront-PRVS: 03319F6FEF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(979002)(6009001)(39840400002)(39410400002)(39850400002)(39400400002)(39450400003)(6116002)(47776003)(106356001)(42882006)(42186005)(1076002)(53936002)(110136004)(50226002)(81166006)(8676002)(2906002)(36756003)(189998001)(6916009)(48376002)(72206003)(50466002)(33646002)(5890100001)(6666003)(2950100002)(6486002)(76176999)(4326008)(66066001)(3846002)(6512007)(478600001)(38730400002)(107886003)(25786009)(305945005)(5009440100003)(5660300001)(8656002)(2351001)(2361001)(7736002)(50986999)(53416004)(5003940100001)(6506006)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1714; H:jerin.caveonetworks.com; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1714; 23:Ihs5nav8Zt8WiKWl0iYWQ0SSMxovRL1MjDxGvGS?= =?us-ascii?Q?yBdTu+YcUcDhJiVRanNF4fFGweBKUfZvXSuDRSf9wBQwJ9c88bRtJm45bJaN?= =?us-ascii?Q?ZHderLydoXDIwyWAbbJbK7melSuhUaeY0wEZM661jR4td7UDJl0gI1UrwurL?= =?us-ascii?Q?CiVURTHgRCOA1gzTOlgrqHBNY6dcJSPDbp0a6Tr4evX6xJOKk55Ss62IOCQV?= =?us-ascii?Q?9N3I5UGaefY4x+FCxQ/58jX2+/LFJ1+ty/DRURd1tu1wEY4tL/qR5cu9K5GU?= =?us-ascii?Q?W1+JZZRbaOZKn7u2LXmTp8simjnXJ84EtxhZDE5w0W8PERHvdT7c7JdQWtzm?= =?us-ascii?Q?jUmOs0b+HZWTouBOOXaVEVVxcHSn2XsjQ2FHom41c7DpZmHG7jYx2u9mQNEj?= =?us-ascii?Q?f9njF0+rxJPbkmj8opom/wpKK/fvG40CnqEhzyogoCORTQZCxEp9xcvgYXW8?= =?us-ascii?Q?EL1hFyzNejTBqnS4HsbYyIagMKcX9WPmgq5tdh3e6GTY4HGk0aygc68VquMA?= =?us-ascii?Q?GFKYVUMK89hVeBrYnOU7R/ePxUHoVK0lTnEPNLnc0gSqY8/2pakDsznc32na?= =?us-ascii?Q?Z5HEwzH/BKOPbYh12BtGjEPrrifYz8asIaU+XPhljRJK/e6iJy0YbBNl+qhc?= =?us-ascii?Q?jN/iiSNE2K/J72IhMqpmvQhP9QMu+eNNIUhpTCqzS8MYP8zXyUVxsQ5FuEIn?= =?us-ascii?Q?4cT42vAWC8ijNX3TY9Rx9zQ92cjpmpf6F5mN2jXP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VPyX8o8VtoWUeKf1TrqTRV9laLGlI6F8bIS+lifnOsjEp00EgoqtxkPU318zqFLkv2ZCBDIikP7ZavafT1uYUZCj+1nDouBYNEiIYJjXh5ku1df9Y0kUTmPeZ1JjiOjuzVmZqRCkGgJDoUChhZqeipqGY+lSErgnMsGf8nK1JOVQ2G0CUNrRdOwV3YVhA0RsZm0JBuPqY4QOigX0VhDi5+uMQqkaS8uwu82AValg== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 5:8WWvLqzO16HJxf966ZKBwTFJCC4YCk53l+wXAhz5hRKRtgVew3mLxoeuZgCh7wg9BtbH7rx4jZifAfCai5X8W2JmD7FhFMA3+8kNotUQqJxjT5eFqznbe9Alfr2XmSII3g2uYxklBdYk6jE8rKwe3dXY0ibaW96h6sJZPB2iLwGdYJyJtWdT6ZTrRrOICuQi58ZlzzTuAkxJotYo+Tw/syZOjNts8URQVmL+dQ4vaZzonby9tMn+z14V3IpTEK5wrs8ueNK6aI/zi2K5yYBHDgZsXKWXJectfPKDmPn3x0FDUhz96F4omgtnKgBCD71fu7depR/xx8SMoCu4QnJ1UNHNs5k5L2z1yqboO6TkkgZXEfv6xheYton+ky8yczoLT/kBAbz1SKzf9sCi13rapMQAZvcbqzD3hq7owGi0dfyZEHlKIOI4pABobk1Up+TvQ9y+VLbPw/Z6RfIVlj8TwbfL+xBEJiW1IzlHhzpd8IH8PCDfrirjGRROEZFF6o6m; 24:QmjRmgYo2rOKqCmQBqTTJJK201YUSjG1n0PLETTbNT7MyrPB3RRg5+48rjTRYDHnvqdVXO6Y4yDPiUXX8I24yuCjycQ+75CbdX2rGga8YFg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 7:54kRRgPixmBXhu+AyMlFXBYdiONdBPNX3sTB7MjCCCcy4ZVER5KqrMQkY/WOFK/tb4AMYSYX4JDUu0Jnkw1b0YOXZyKxYwFCNsHcG4vuuP1a0UntxTpBSRykH3dHZgMV5qs0JTYrA2H7eaq/fslnSYOBQIjP4ZoknVnPml+njaXIq3+yOldC3JU89GJVuWFFgDqNMbFLA8/Ag5K9hJxuRBz/e1GSeQgvRokgOGVgDs5hWuCfUMlAmQojcL0tQKitNviuO/15DV0YuNaNYnpLbjq1hTyMuFKK5FMAB66a/br0XktWU+UZ0deFnRyceASpAM6IYbiX1MuCibdE8H+Nkg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2017 08:44:00.2717 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Subject: [dpdk-dev] [PATCH v2 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: Wed, 07 Jun 2017 08:44:06 -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.0