All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: gaetan.rivet@6wind.com, ophirmu@mellanox.com,
	wisamm@mellanox.com, ferruh.yigit@intel.com,
	arybchenko@solarflare.com, bernard.iremonger@intel.com
Subject: [PATCH v6 6/7] eal: remove deprecated attach/detach functions
Date: Mon, 22 Oct 2018 14:31:09 +0200	[thread overview]
Message-ID: <20181022123110.5733-7-thomas@monjalon.net> (raw)
In-Reply-To: <20181022123110.5733-1-thomas@monjalon.net>

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>
---
 doc/guides/rel_notes/deprecation.rst    |  5 ---
 doc/guides/rel_notes/release_18_11.rst  |  6 +++
 lib/librte_eal/common/eal_common_dev.c  | 53 -------------------------
 lib/librte_eal/common/include/rte_dev.h | 27 -------------
 lib/librte_eal/rte_eal_version.map      |  2 -
 5 files changed, 6 insertions(+), 87 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 6b51c9d28..34b28234c 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -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.
 
diff --git a/doc/guides/rel_notes/release_18_11.rst b/doc/guides/rel_notes/release_18_11.rst
index e7e676a05..36c00dbcc 100644
--- a/doc/guides/rel_notes/release_18_11.rst
+++ b/doc/guides/rel_notes/release_18_11.rst
@@ -233,6 +233,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
diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c
index 6ac3ee859..62e9ed477 100644
--- a/lib/librte_eal/common/eal_common_dev.c
+++ b/lib/librte_eal/common/eal_common_dev.c
@@ -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,
diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
index 4e549e802..cd6c187cc 100644
--- a/lib/librte_eal/common/include/rte_dev.h
+++ b/lib/librte_eal/common/include/rte_dev.h
@@ -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.
  *
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 08e3bc268..32fe2ba40 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -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;
 
-- 
2.19.0

  parent reply	other threads:[~2018-10-22 12:31 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-07 22:25 [PATCH 0/5] replace attach/detach functions Thomas Monjalon
2018-10-07 22:25 ` [PATCH 1/5] bus/vdev: add iteration filter on name Thomas Monjalon
2018-10-08  6:46   ` Andrew Rybchenko
2018-10-08  7:47     ` Thomas Monjalon
2018-10-07 22:25 ` [PATCH 2/5] ethdev: add an iterator to match some devargs input Thomas Monjalon
2018-10-08  7:06   ` Andrew Rybchenko
2018-10-08  7:58     ` Thomas Monjalon
2018-10-07 22:25 ` [PATCH 3/5] ethdev: allow iterating with only class filter Thomas Monjalon
2018-10-08  7:20   ` Andrew Rybchenko
2018-10-08  8:07     ` Thomas Monjalon
2018-10-08  9:13       ` Andrew Rybchenko
2018-10-07 22:25 ` [PATCH 4/5] ethdev: remove deprecated attach/detach functions Thomas Monjalon
2018-10-08  7:28   ` Andrew Rybchenko
2018-10-08  8:09     ` Thomas Monjalon
2018-10-07 22:25 ` [PATCH 5/5] eal: " Thomas Monjalon
2018-10-09  0:16 ` [PATCH v2 0/6] replace " Thomas Monjalon
2018-10-09  0:16   ` [PATCH v2 1/6] bus/vdev: add iteration filter on name Thomas Monjalon
2018-10-09  9:17     ` Andrew Rybchenko
2018-10-09  0:16   ` [PATCH v2 2/6] ethdev: add iterator to match devargs input Thomas Monjalon
2018-10-09  9:31     ` Andrew Rybchenko
2018-10-09  9:49       ` Thomas Monjalon
2018-10-09  0:16   ` [PATCH v2 3/6] ethdev: allow iterating with pure class filter Thomas Monjalon
2018-10-09  9:40     ` Andrew Rybchenko
2018-10-09  0:16   ` [PATCH v2 4/6] doc: replace doxygen example in contribution guide Thomas Monjalon
2018-10-09  9:41     ` Andrew Rybchenko
2018-10-09  0:16   ` [PATCH v2 5/6] ethdev: remove deprecated attach/detach functions Thomas Monjalon
2018-10-09  9:43     ` Andrew Rybchenko
2018-10-09  0:16   ` [PATCH v2 6/6] eal: " Thomas Monjalon
2018-10-09  9:44     ` Andrew Rybchenko
2018-10-09 13:34 ` [PATCH v3 0/6] replace " Thomas Monjalon
2018-10-09 13:34   ` [PATCH v3 1/6] bus/vdev: add iteration filter on name Thomas Monjalon
2018-10-09 13:34   ` [PATCH v3 2/6] ethdev: add iterator to match devargs input Thomas Monjalon
2018-10-09 14:17     ` Thomas Monjalon
2018-10-09 13:34   ` [PATCH v3 3/6] ethdev: allow iterating with pure class filter Thomas Monjalon
2018-10-09 13:34   ` [PATCH v3 4/6] doc: replace doxygen example in contribution guide Thomas Monjalon
2018-10-09 13:34   ` [PATCH v3 5/6] ethdev: remove deprecated attach/detach functions Thomas Monjalon
2018-10-09 13:34   ` [PATCH v3 6/6] eal: " Thomas Monjalon
2018-10-09 22:33 ` [PATCH v4 0/6] replace " Thomas Monjalon
2018-10-09 22:33   ` [PATCH v4 1/6] bus/vdev: add iteration filter on name Thomas Monjalon
2018-10-09 22:33   ` [PATCH v4 2/6] ethdev: add iterator to match devargs input Thomas Monjalon
2018-10-16 10:58     ` Ferruh Yigit
2018-10-16 12:06       ` Thomas Monjalon
2018-10-09 22:33   ` [PATCH v4 3/6] ethdev: allow iterating with pure class filter Thomas Monjalon
2018-10-09 22:33   ` [PATCH v4 4/6] doc: replace doxygen example in contribution guide Thomas Monjalon
2018-10-09 22:33   ` [PATCH v4 5/6] ethdev: remove deprecated attach/detach functions Thomas Monjalon
2018-10-16 11:03     ` Ferruh Yigit
2018-10-16 12:12       ` Thomas Monjalon
2018-10-09 22:33   ` [PATCH v4 6/6] eal: " Thomas Monjalon
2018-10-18  1:35 ` [PATCH v5 0/7] replace " Thomas Monjalon
2018-10-18  1:35   ` [PATCH v5 1/7] bus/vdev: add iteration filter on name Thomas Monjalon
2018-10-18  1:35   ` [PATCH v5 2/7] ethdev: add iterator to match devargs input Thomas Monjalon
2018-10-18  1:35   ` [PATCH v5 3/7] ethdev: allow iterating with pure class filter Thomas Monjalon
2018-10-18  1:35   ` [PATCH v5 4/7] doc: replace doxygen example in contribution guide Thomas Monjalon
2018-10-18  1:35   ` [PATCH v5 5/7] ethdev: remove deprecated attach/detach functions Thomas Monjalon
2018-10-18  1:35   ` [PATCH v5 6/7] eal: " Thomas Monjalon
2018-10-18  1:35   ` [PATCH v5 7/7] app/testpmd: check not detaching device twice Thomas Monjalon
2018-10-18  1:45     ` Thomas Monjalon
2018-10-22 12:31 ` [PATCH v6 0/7] replace attach/detach functions Thomas Monjalon
2018-10-22 12:31   ` [PATCH v6 1/7] bus/vdev: add iteration filter on name Thomas Monjalon
2018-10-22 12:31   ` [PATCH v6 2/7] ethdev: add iterator to match devargs input Thomas Monjalon
2018-10-22 12:31   ` [PATCH v6 3/7] ethdev: allow iterating with pure class filter Thomas Monjalon
2018-10-22 12:31   ` [PATCH v6 4/7] doc: replace doxygen example in contribution guide Thomas Monjalon
2018-10-22 12:31   ` [PATCH v6 5/7] ethdev: remove deprecated attach/detach functions Thomas Monjalon
2018-10-22 12:31   ` Thomas Monjalon [this message]
2018-10-22 12:31   ` [PATCH v6 7/7] app/testpmd: check not detaching device twice Thomas Monjalon
2018-10-22 15:11   ` [PATCH v6 0/7] replace attach/detach functions Iremonger, Bernard
2018-10-22 15:38     ` Thomas Monjalon
2018-10-23  8:28 ` [PATCH v7 " Thomas Monjalon
2018-10-23  8:28   ` [PATCH v7 1/7] bus/vdev: add iteration filter on name Thomas Monjalon
2018-10-23  8:28   ` [PATCH v7 2/7] ethdev: add iterator to match devargs input Thomas Monjalon
2018-10-23  8:28   ` [PATCH v7 3/7] ethdev: allow iterating with pure class filter Thomas Monjalon
2018-10-23  8:28   ` [PATCH v7 4/7] doc: replace doxygen example in contribution guide Thomas Monjalon
2018-10-23  8:28   ` [PATCH v7 5/7] ethdev: remove deprecated attach/detach functions Thomas Monjalon
2018-10-23  8:28   ` [PATCH v7 6/7] eal: " Thomas Monjalon
2018-10-23  8:28   ` [PATCH v7 7/7] app/testpmd: check not detaching device twice Thomas Monjalon
2018-10-23 10:01     ` Iremonger, Bernard
2018-10-23 12:03       ` Thomas Monjalon
2018-10-23 12:13         ` Thomas Monjalon
2018-10-23 12:37           ` Thomas Monjalon
2018-10-23 14:06             ` Ferruh Yigit
2018-10-23 12:39           ` Iremonger, Bernard
2018-10-23 14:06   ` [PATCH v7 0/7] replace attach/detach functions Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181022123110.5733-7-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=arybchenko@solarflare.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=gaetan.rivet@6wind.com \
    --cc=ophirmu@mellanox.com \
    --cc=wisamm@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.