From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: [RFC] eal: simplify parameters of hotplug functions Date: Sat, 8 Sep 2018 00:27:27 +0200 Message-ID: <20180907222727.20521-1-thomas@monjalon.net> Cc: gaetan.rivet@6wind.com To: dev@dpdk.org Return-path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id CB7C15B12 for ; Sat, 8 Sep 2018 00:27:39 +0200 (CEST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" All informations about a device to probe can be grouped in a common string, which is what we usually call devargs. That's why the bus name and device name can be removed from rte_eal_hotplug_add(). When removing a device, we already know its rte_device handle which can be directly passed as parameter of rte_eal_hotplug_remove(). If the rte_device is not known, it can be retrieved from the devargs, thanks to RTE_DEV_FOREACH(). Signed-off-by: Thomas Monjalon --- This patch contains only the change in the API as RFC. This idea was presented at Dublin during the "hotplug talk". --- lib/librte_eal/common/include/rte_dev.h | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h index b80a80598..2f4212d01 100644 --- a/lib/librte_eal/common/include/rte_dev.h +++ b/lib/librte_eal/common/include/rte_dev.h @@ -194,18 +194,12 @@ int rte_eal_dev_detach(struct rte_device *dev); * * Hotplug add a given device to a specific bus. * - * @param busname - * The bus name the device is added to. - * @param devname - * The device name. Based on this device name, eal will identify a driver - * capable of handling it and pass it to the driver probing function. * @param devargs - * Device arguments to be passed to the driver. + * Device arguments including bus, class and driver properties * @return * 0 on success, negative on error. */ -int __rte_experimental rte_eal_hotplug_add(const char *busname, const char *devname, - const char *devargs); +int __rte_experimental rte_eal_hotplug_add(const char *devargs); /** * @warning @@ -213,15 +207,12 @@ int __rte_experimental rte_eal_hotplug_add(const char *busname, const char *devn * * Hotplug remove a given device from a specific bus. * - * @param busname - * The bus name the device is removed from. - * @param devname - * The device name being removed. + * @param dev + * Data structure of the device to remove * @return * 0 on success, negative on error. */ -int __rte_experimental rte_eal_hotplug_remove(const char *busname, - const char *devname); +int __rte_experimental rte_eal_hotplug_remove(struct rte_device *dev); /** * Device comparison function. -- 2.18.0