From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0088.outbound.protection.outlook.com [104.47.37.88]) by dpdk.org (Postfix) with ESMTP id 867374A65 for ; Wed, 8 Feb 2017 15:39:25 +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=KB4p2cSF6BgUT/ii5drOtG9pwxCdjTWnabHAajIPMBI=; b=Z/UXh/xjkO6UxcDOMOoXF4WAzhhxnWRmBBIipI9U/VYN3IScrk93Mp//0nG/MrjG3TNbAfkdClTc6xVboNUJyd6U8BOYtRKGssvLwakPpwq9uANTzSgPyydTOfR+WM5aHlEtd2te6Qpc5tD0KoVqLyUiMYTcCpBxVFAqhxjQHkU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain (122.167.145.188) by CY1PR0701MB1728.namprd07.prod.outlook.com (10.163.21.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Wed, 8 Feb 2017 14:39:21 +0000 Date: Wed, 8 Feb 2017 20:09:07 +0530 From: Jerin Jacob To: "Van Haaren, Harry" CC: "dev@dpdk.org" , "Richardson, Bruce" , "hemant.agrawal@nxp.com" , "Eads, Gage" Message-ID: <20170208143905.GC22978@localhost.localdomain> References: <1486358620-4075-1-git-send-email-jerin.jacob@caviumnetworks.com> <1486358620-4075-3-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-Originating-IP: [122.167.145.188] X-ClientProxiedBy: MAXPR01CA0002.INDPRD01.PROD.OUTLOOK.COM (10.164.147.9) To CY1PR0701MB1728.namprd07.prod.outlook.com (10.163.21.142) X-MS-Office365-Filtering-Correlation-Id: 0696836d-efb8-4189-71ba-08d450304665 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0701MB1728; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1728; 3:nrOG8QxHh7AoRHZOdrU/bOzQThKmgitfbbjeWOxKez0vGrKG3Hy0I2PY2yR1UZCPJ7TB83r37Yu0wru4Qr4uLLuamofJ1+5m9Fnyyg4rup1iNXY2yEVXo1LfPVjqYQqEA0yQeQ8TDBRINbLcKe6kawzQbceli7wMd7AQ5PN0W5uX7qI1PYVEe6ZVPgRTeZ7+xSvqYWgezXv6D6bldpl0vIhTudz8Hcj5mPSANdIEhK6fcQjwypT8DJ5yQRujh3BHOku/TjJNQIxrqs3gxL4MNQ==; 25:/gOtSicoF0L0WUaupRg+pYIBwCzhohKC/efVDyqXsqHGGoRV70AE27Z9W1GGAAzo+d5MyWDxslhucdOweB7YSCOvwi0bxr2uFJ7mYvALzTKX2dwZcgrwouWeqOLL2kXl+CSGwVLJu43fqMxaHGt+Xa5x+9UMFt4tYrk+b0Nup5TOF0yedPN9zA766KWryd2pdEBh8xIY2F+ZfERCegzrv6mvuEeHU3QiJOUi2pC7PM3M4S7nIGT8rfp7aoFTE/h7MOWU1/KMr/szUIk+/2rycsBO0VbC8mJun5FoIoqyg5eYnJHfSfsn/lAMHaZzrJCw7LeVo+nI6SOsWdxUdB19SITEShodKsJvWlIUcC+gCrXUQsad8mM6dxzwz4Zgh1BoxGk3HU8vOGM42d5687o0FlX63/450zuUQF16S046A34qqjmJkHedlj8eUEBZiA8vga4rXhBSFrAD+jBt5i7Itw== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1728; 31:4hzgzEo3xft5FXP9Isd2C8UPWqwT5HYEVboYpqzTLVEp/XCgIgWlUsWjtvIhoTeB+Y9+LMf7xhl6hKPsF0j/ejU91Pj9GetXolO3nhRIuCGKTeEfVKBK3xyWeAYhVwe+P07XStY28INb197XfioYiny2q+NXvUq6Z5MaZAbD3suzO4/rv8p0t34NBDHIsShlQWOn18CYbuiuvGDjk10dIhVFK0KvVjztc2gkd0PRSNcUINgpnVbD9hMHH4N3h3DpfVc9JQXg43iVwIOEPXp/Aw==; 20:fAsQfh+V9uJQKkmIE0zjtafuGV7AaHw0UaE0gstFaKYf6AoB2ZprmW6YbFARxJOPVwJUNXyvt/Zl+VmDVYi/0dSEStH8zWOpOkX01iBmjy6qe0fzMWOFIoUz6mCPb4Pf+feVqGwmxSNgAHuOOFilEXWBqp8TuaIQJPauK342VHEGgeF1q9vAcv+9pZxvJybZ6JNeJc43I8eO1rhHq6EcakzeoH7JLdFwaVJD0wKJx9KPguaS05IGdkGZFdRDgnIg6GgWF0iPAnXk8af+5E4UjORwhvhQw//QEe0N+ibSme2QxJSLwk0K5RmfHRRBW3ez3cmY52XBAYBePgMKWBIRQT+hkgnyqCIdhUgii2zUDhZ9s2LUFrj89aqUsMx40BqQrOyjYBsguRF/NuEF2OeBn2II0rt1mk4MdIJbuLSWML81nC7xBY+DQLkW6IEQtYp1D7wJyYM0K9ypnkTKVwXbXxCY9sgz6qHJgIOxl+uy25YcmYhZfoQ1gbDpp2S9qiFGlbGv8H3aWQBqywkF1Gc8bu8yR/zNK3St25zyx/pMhPQtAZDLlOSAt4ydORWZBspHU351v1UWETLfAU3tbOlU6fB67s9hDzhJns3wFMfLGzY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(2017020702029)(8121501046)(20170203043)(5005006)(3002001)(10201501046)(6041248)(20161123564025)(20161123560025)(20161123562025)(20161123558025)(20161123555025)(6072148); SRVR:CY1PR0701MB1728; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1728; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1728; 4:oGD8yvuN+Hb6Le59ekncjB2osbOZGJJCrUWmzQPT+iW3C+6TbIg7By05CN7MYSvb26mYFSqY/s6Q7wHa7FIqM/iyBBjDbJ8SbiYYmzTdqKNHnvyJaeuNeTEf5BrCnNQcGxdS9EfuHHVtomvbAOlDdVulDMMWxBfVN/e3Ks56nDu5Q6D+V/TlEzl4uPqLIzAt7MA8qWhc0ejJFJk2Z3rs7dG5Gp1u0yKs5vSVmfipWIt50nAmZ6S1mwqvTu0ULJu468zzwOOcuV2mEuEYTME7mA0vkWz4gObVRuSJandRnddihvNht2Z8UZ8BNUV7yyIxFSQplZCvhYVenyEc5Q8zVFdISZorSxTwCr8hpDCjrVaIpm3lh6s3h5h1JAHsozBnM4woSXRKx1HWKb4ybGFNuCRLU6IiyBoIFpiI1JCmwfb19B646MOu9CKr3BNnd2W7oVOlh3Ru2YE4F4USlOJRZ0uYhl7i/RRBruR2B1hrahGkmRPFY7LLgf4JMtWC1JUBIOsSiC/GNr6jGBD5Tzpq9+ZVBDoZV7TU7SQi3qySHTq3hkg8iG97UfOAqSy4OXje7OWYnGF9XLTYVqTtVp3ixofMM5FgkyCo1/0TU5JzX64yTEDTUJ8GW9rjvveh3Mr9TMNKflowNfZlm6y0lIBUfoyovKXkpCBgZUIwJRZooAH7SSIoQvAIkWYofOqgy2ybQKDO4Ai6FdDWMB98tEFavLW3hEIGm1awMEP8Ky07WxvS+kOuA2Tdz0LrYK8dhwdI X-Forefront-PRVS: 0212BDE3BE X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(13464003)(377454003)(24454002)(189002)(199003)(83506001)(42882006)(4326007)(6916009)(33656002)(23726003)(66066001)(97756001)(7736002)(305945005)(6246003)(53936002)(97736004)(2906002)(105586002)(101416001)(81166006)(8676002)(54906002)(81156014)(2950100002)(9686003)(106356001)(6506006)(6666003)(42186005)(6116002)(25786008)(50466002)(55016002)(50986999)(76176999)(54356999)(110136004)(38730400002)(46406003)(3846002)(5660300001)(68736007)(5890100001)(189998001)(8656002)(61506002)(1076002)(92566002)(4001350100001)(229853002)(47776003)(7099028)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1728; H:localhost.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; CY1PR0701MB1728; 23:t4y8A/bHyBK1tLnrBfCT4pHERqZ4gNv4RVNBUqq?= =?us-ascii?Q?Vy5MumNOmTeqSF1p6/yl6KRx0c+suuHicylekjC1TPY68UdycLi3qr+ZLlp1?= =?us-ascii?Q?ipe2QdHJ3wCu40b77XdfFVDaxhxBd2WtDyhX+4VV6j0aJ/OZRyN0RRTL6yRa?= =?us-ascii?Q?pLdvXDoANTqE7muADHy6oR3vSte12xsMaaRkxU3enm/q1lBAukZCAoVY8S7o?= =?us-ascii?Q?VkvkBbQ6ak1b3aOIDEbm6ZQGYi2YmdYHdGm+h4gQDq+5p63uilButeIoenci?= =?us-ascii?Q?6Y69suojADp9nE7krZlOyksifptvz7x1gsJ1jR4OJq1u5xC5sD2qe6mvxVeR?= =?us-ascii?Q?vho10PdvgYxCr6N4KWSW1YDyJS3sy/AEodSbHsetgFbtVbnEbTTS0I/dRa41?= =?us-ascii?Q?FF3aopKBC9oFHKbgKSM8E5OnZShostyfoOChi1slusXg+zXzvKOhkKI5b5pA?= =?us-ascii?Q?AIttoXxRAc5sJ72VI8gMZj+cgRGPS5prmhuk7I4NB5KLODT0KGSHAe5bI9ze?= =?us-ascii?Q?STJiZpPz6iA1zlVDISieiJuMd0Gh2TGtl+jxUXnBC8D+7AvW+/L6C+us2eGF?= =?us-ascii?Q?i8Ihwu5crneOdTDc+gtVAXsh5xLojyYOJkf1VEm3nmkdt/z6GzSd/7cWLsBW?= =?us-ascii?Q?NFxa5h+eXCQEgb8ZgrdUs2pTbXDyUjEs9IX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5a1BVzRUyudwW4ap7/m6FLKMuoUka6BdNvwor0lzcIqW17yppSmSTOKPpqXDjjryu/x2V8kjJsbI8KQ9yIdDmuJpMII7h6wLgPqUx3TlfBbb3uPetzHx8wWg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2017 14:39:21.2193 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1728 Subject: Re: [dpdk-dev] [PATCH 2/4] evendev: 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: Wed, 08 Feb 2017 14:39:26 -0000 On Tue, Feb 07, 2017 at 03:11:01PM +0000, Van Haaren, Harry wrote: > > -----Original Message----- > > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > > Sent: Monday, February 6, 2017 5:24 AM > > To: dev@dpdk.org > > Cc: Richardson, Bruce ; hemant.agrawal@nxp.com; Eads, Gage > > ; Van Haaren, Harry ; Jerin Jacob > > > > Subject: [dpdk-dev] [PATCH 2/4] evendev: add vdev uninit support > > > > Added eventdev vdev uninit support to release the resources > > allocated in eventdev vdev init. > > > > Signed-off-by: Jerin Jacob > > --- > > One comment below to update version.map 17.05, but once that's fixed Fixed it. > > Acked-by: Harry van Haaren Applied to dpdk-next-eventdev/master. Thanks. > > > > lib/librte_eventdev/rte_eventdev.c | 43 +++++++++++++++++++++++++--- > > lib/librte_eventdev/rte_eventdev_pmd.h | 12 +++++++- > > lib/librte_eventdev/rte_eventdev_version.map | 1 + > > 3 files changed, 51 insertions(+), 5 deletions(-) > > > > diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c > > index 2b39fb2..09fc274 100644 > > --- a/lib/librte_eventdev/rte_eventdev.c > > +++ b/lib/librte_eventdev/rte_eventdev.c > > @@ -1143,6 +1143,8 @@ int > > rte_event_pmd_release(struct rte_eventdev *eventdev) > > { > > int ret; > > + char mz_name[RTE_EVENTDEV_NAME_MAX_LEN]; > > + const struct rte_memzone *mz; > > > > if (eventdev == NULL) > > return -EINVAL; > > @@ -1153,8 +1155,26 @@ rte_event_pmd_release(struct rte_eventdev *eventdev) > > > > eventdev->attached = RTE_EVENTDEV_DETACHED; > > eventdev_globals.nb_devs--; > > + > > + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { > > + rte_free(eventdev->data->dev_private); > > + > > + /* Generate memzone name */ > > + ret = snprintf(mz_name, sizeof(mz_name), "rte_eventdev_data_%u", > > + eventdev->data->dev_id); > > + if (ret >= (int)sizeof(mz_name)) > > + return -EINVAL; > > + > > + mz = rte_memzone_lookup(mz_name); > > + if (mz == NULL) > > + return -ENOMEM; > > + > > + ret = rte_memzone_free(mz); > > + if (ret) > > + return ret; > > + } > > + > > eventdev->data = NULL; > > - > > return 0; > > } > > > > @@ -1186,6 +1206,24 @@ rte_event_pmd_vdev_init(const char *name, size_t dev_private_size, > > } > > > > int > > +rte_event_pmd_vdev_uninit(const char *name) > > +{ > > + struct rte_eventdev *eventdev; > > + > > + if (name == NULL) > > + return -EINVAL; > > + > > + eventdev = rte_event_pmd_get_named_dev(name); > > + if (eventdev == NULL) > > + return -ENODEV; > > + > > + /* Free the event device */ > > + rte_event_pmd_release(eventdev); > > + > > + return 0; > > +} > > + > > +int > > rte_event_pmd_pci_probe(struct rte_pci_driver *pci_drv, > > struct rte_pci_device *pci_dev) > > { > > @@ -1275,9 +1313,6 @@ rte_event_pmd_pci_remove(struct rte_pci_device *pci_dev) > > /* Free event device */ > > rte_event_pmd_release(eventdev); > > > > - if (rte_eal_process_type() == RTE_PROC_PRIMARY) > > - rte_free(eventdev->data->dev_private); > > > > > eventdev->pci_dev = NULL; > > eventdev->driver = NULL; > > > > diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h > > index 4eea618..be5c784 100644 > > --- a/lib/librte_eventdev/rte_eventdev_pmd.h > > +++ b/lib/librte_eventdev/rte_eventdev_pmd.h > > @@ -198,7 +198,7 @@ rte_event_pmd_is_valid_dev(uint8_t dev_id) > > { > > struct rte_eventdev *dev; > > > > - if (dev_id >= rte_eventdev_globals->nb_devs) > > + if (dev_id >= RTE_EVENT_MAX_DEVS) > > return 0; > > > > dev = &rte_eventdevs[dev_id]; > > @@ -552,6 +552,16 @@ struct rte_eventdev * > > rte_event_pmd_vdev_init(const char *name, size_t dev_private_size, > > int socket_id); > > > > +/** > > + * Destroy the given virtual event device > > + * > > + * @param name > > + * PMD type name > > + * @return > > + * - 0 on success, negative on error > > + */ > > +int > > +rte_event_pmd_vdev_uninit(const char *name); > > > > /** > > * Wrapper for use by pci drivers as a .probe function to attach to a event > > diff --git a/lib/librte_eventdev/rte_eventdev_version.map > > b/lib/librte_eventdev/rte_eventdev_version.map > > index b138eb3..c572c4d 100644 > > --- a/lib/librte_eventdev/rte_eventdev_version.map > > +++ b/lib/librte_eventdev/rte_eventdev_version.map > > @@ -35,6 +35,7 @@ DPDK_17.02 { > > > Version to 17.05 I think? > > > > rte_event_pmd_allocate; > > rte_event_pmd_release; > > rte_event_pmd_vdev_init; > > + rte_event_pmd_vdev_uninit; > > rte_event_pmd_pci_probe; > > rte_event_pmd_pci_remove; > > > > -- > > 2.5.5 >