eal: remove deprecated attach/detach functions
These hotplug functions were deprecated and have some new replacements. As announced earlier, the oldest ones are now removed. Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
This commit is contained in:
parent
c9cce42876
commit
01e5b16c57
@ -49,11 +49,6 @@ Deprecation Notices
|
||||
Target release for removal of the legacy API will be defined once most
|
||||
PMDs have switched to rte_flow.
|
||||
|
||||
* eal: In v18.11 ``rte_eal_dev_attach()`` and ``rte_eal_dev_detach()``
|
||||
will be removed.
|
||||
Hotplug functions ``rte_eal_hotplug_add()`` and ``rte_eal_hotplug_remove()``
|
||||
should be used directly.
|
||||
|
||||
* pdump: As we changed to use generic IPC, some changes in APIs and structure
|
||||
are expected in subsequent release.
|
||||
|
||||
|
@ -300,6 +300,12 @@ API Changes
|
||||
* eal: The parameters of the function ``rte_devargs_remove()`` have changed
|
||||
from bus and device names to ``struct rte_devargs``.
|
||||
|
||||
* eal: The deprecated functions attach/detach were removed in 18.11.
|
||||
``rte_eal_dev_attach`` can be replaced by
|
||||
``rte_dev_probe`` or ``rte_eal_hotplug_add``.
|
||||
``rte_eal_dev_detach`` can be replaced by
|
||||
``rte_dev_remove`` or ``rte_eal_hotplug_remove``.
|
||||
|
||||
* eal: The scope of ``rte_eal_hotplug_add()``/``rte_dev_probe()``
|
||||
and ``rte_eal_hotplug_remove()``/``rte_dev_remove()`` is extended.
|
||||
In multi-process model, they will guarantee that the device is
|
||||
|
@ -83,59 +83,6 @@ rte_dev_is_probed(const struct rte_device *dev)
|
||||
return dev->driver != NULL;
|
||||
}
|
||||
|
||||
int rte_eal_dev_attach(const char *name, const char *devargs)
|
||||
{
|
||||
struct rte_bus *bus;
|
||||
|
||||
if (name == NULL || devargs == NULL) {
|
||||
RTE_LOG(ERR, EAL, "Invalid device or arguments provided\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
bus = rte_bus_find_by_device_name(name);
|
||||
if (bus == NULL) {
|
||||
RTE_LOG(ERR, EAL, "Unable to find a bus for the device '%s'\n",
|
||||
name);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (strcmp(bus->name, "pci") == 0 || strcmp(bus->name, "vdev") == 0)
|
||||
return rte_eal_hotplug_add(bus->name, name, devargs);
|
||||
|
||||
RTE_LOG(ERR, EAL,
|
||||
"Device attach is only supported for PCI and vdev devices.\n");
|
||||
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
int rte_eal_dev_detach(struct rte_device *dev)
|
||||
{
|
||||
struct rte_bus *bus;
|
||||
int ret;
|
||||
|
||||
if (dev == NULL) {
|
||||
RTE_LOG(ERR, EAL, "Invalid device provided.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
bus = rte_bus_find_by_device(dev);
|
||||
if (bus == NULL) {
|
||||
RTE_LOG(ERR, EAL, "Cannot find bus for device (%s)\n",
|
||||
dev->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (bus->unplug == NULL) {
|
||||
RTE_LOG(ERR, EAL, "Bus function not supported\n");
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
ret = bus->unplug(dev);
|
||||
if (ret)
|
||||
RTE_LOG(ERR, EAL, "Driver cannot detach the device (%s)\n",
|
||||
dev->name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* helper function to build devargs, caller should free the memory */
|
||||
static int
|
||||
build_devargs(const char *busname, const char *devname,
|
||||
|
@ -176,33 +176,6 @@ struct rte_device {
|
||||
__rte_experimental
|
||||
int rte_dev_is_probed(const struct rte_device *dev);
|
||||
|
||||
/**
|
||||
* Attach a device to a registered driver.
|
||||
*
|
||||
* @param name
|
||||
* The device name, that refers to a pci device (or some private
|
||||
* way of designating a vdev device). 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.
|
||||
* @return
|
||||
* 0 on success, negative on error.
|
||||
*/
|
||||
__rte_deprecated
|
||||
int rte_eal_dev_attach(const char *name, const char *devargs);
|
||||
|
||||
/**
|
||||
* Detach a device from its driver.
|
||||
*
|
||||
* @param dev
|
||||
* A pointer to a rte_device structure.
|
||||
* @return
|
||||
* 0 on success, negative on error.
|
||||
*/
|
||||
__rte_deprecated
|
||||
int rte_eal_dev_detach(struct rte_device *dev);
|
||||
|
||||
/**
|
||||
* Hotplug add a given device to a specific bus.
|
||||
*
|
||||
|
@ -130,8 +130,6 @@ DPDK_16.11 {
|
||||
|
||||
rte_delay_us_block;
|
||||
rte_delay_us_callback_register;
|
||||
rte_eal_dev_attach;
|
||||
rte_eal_dev_detach;
|
||||
|
||||
} DPDK_16.07;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user