DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tetsuya Mukawa <mukawa@igel.co.jp>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 8/8] eal: Enable Port Hotplug as default in Linux and BSD
Date: Tue, 19 May 2015 15:21:53 +0900	[thread overview]
Message-ID: <1432016513-8456-9-git-send-email-mukawa@igel.co.jp> (raw)
In-Reply-To: <1432016513-8456-1-git-send-email-mukawa@igel.co.jp>

This patch removes CONFIG_RTE_LIBRTE_EAL_HOTPLUG option, and enables it
as default in both Linux and BSD.
Also, to support port hotplug, rte_eal_pci_scan() and below missing
symbols should be exported to ethdev library.
 - rte_eal_parse_devargs_str()
 - rte_eal_pci_close_one()
 - rte_eal_pci_probe_one()
 - rte_eal_pci_scan()
 - rte_eal_vdev_init()
 - rte_eal_vdev_uninit()

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
---
 config/common_bsdapp                          |  6 ------
 config/common_linuxapp                        |  5 -----
 lib/librte_eal/bsdapp/eal/eal_pci.c           |  6 +++---
 lib/librte_eal/bsdapp/eal/rte_eal_version.map |  6 ++++++
 lib/librte_eal/common/eal_common_dev.c        |  2 --
 lib/librte_eal/common/eal_common_pci.c        |  8 --------
 lib/librte_eal/common/eal_common_pci_uio.c    |  2 --
 lib/librte_eal/common/include/rte_pci.h       |  2 --
 lib/librte_ether/rte_ethdev.c                 | 21 ---------------------
 9 files changed, 9 insertions(+), 49 deletions(-)

diff --git a/config/common_bsdapp b/config/common_bsdapp
index c2374c0..a53bd7b 100644
--- a/config/common_bsdapp
+++ b/config/common_bsdapp
@@ -116,12 +116,6 @@ CONFIG_RTE_LIBRTE_EAL_BSDAPP=y
 CONFIG_RTE_LIBRTE_EAL_LINUXAPP=n
 
 #
-# Compile Environment Abstraction Layer to support hotplug
-# So far, Hotplug functions only support linux
-#
-CONFIG_RTE_LIBRTE_EAL_HOTPLUG=n
-
-#
 # Compile Environment Abstraction Layer to support Vmware TSC map
 #
 CONFIG_RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT=y
diff --git a/config/common_linuxapp b/config/common_linuxapp
index 0078dc9..b670a34 100644
--- a/config/common_linuxapp
+++ b/config/common_linuxapp
@@ -114,11 +114,6 @@ CONFIG_RTE_PCI_MAX_READ_REQUEST_SIZE=0
 CONFIG_RTE_LIBRTE_EAL_LINUXAPP=y
 
 #
-# Compile Environment Abstraction Layer to support hotplug
-#
-CONFIG_RTE_LIBRTE_EAL_HOTPLUG=y
-
-#
 # Compile Environment Abstraction Layer to support Vmware TSC map
 #
 CONFIG_RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT=y
diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c
index 0103e2b..163e008 100644
--- a/lib/librte_eal/bsdapp/eal/eal_pci.c
+++ b/lib/librte_eal/bsdapp/eal/eal_pci.c
@@ -309,8 +309,8 @@ skipdev:
  * Scan the content of the PCI bus, and add the devices in the devices
  * list. Call pci_scan_one() for each pci entry found.
  */
-static int
-pci_scan(void)
+int
+rte_eal_pci_scan(void)
 {
 	int fd;
 	unsigned dev_count = 0;
@@ -366,7 +366,7 @@ rte_eal_pci_init(void)
 	if (internal_config.no_pci)
 		return 0;
 
-	if (pci_scan() < 0) {
+	if (rte_eal_pci_scan() < 0) {
 		RTE_LOG(ERR, EAL, "%s(): Cannot scan PCI bus\n", __func__);
 		return -1;
 	}
diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map
index 67b6a6c..7e850a9 100644
--- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map
+++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map
@@ -37,14 +37,20 @@ DPDK_2.0 {
 	rte_eal_lcore_role;
 	rte_eal_mp_remote_launch;
 	rte_eal_mp_wait_lcore;
+	rte_eal_parse_devargs_str;
+	rte_eal_pci_close_one;
 	rte_eal_pci_dump;
 	rte_eal_pci_probe;
+	rte_eal_pci_probe_one;
 	rte_eal_pci_register;
+	rte_eal_pci_scan;
 	rte_eal_pci_unregister;
 	rte_eal_process_type;
 	rte_eal_remote_launch;
 	rte_eal_tailq_lookup;
 	rte_eal_tailq_register;
+	rte_eal_vdev_init;
+	rte_eal_vdev_uninit;
 	rte_eal_wait_lcore;
 	rte_exit;
 	rte_get_hpet_cycles;
diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c
index 92a5a94..4089d66 100644
--- a/lib/librte_eal/common/eal_common_dev.c
+++ b/lib/librte_eal/common/eal_common_dev.c
@@ -125,7 +125,6 @@ rte_eal_dev_init(void)
 	return 0;
 }
 
-#ifdef RTE_LIBRTE_EAL_HOTPLUG
 int
 rte_eal_vdev_uninit(const char *name)
 {
@@ -151,4 +150,3 @@ rte_eal_vdev_uninit(const char *name)
 	RTE_LOG(ERR, EAL, "no driver found for %s\n", name);
 	return -EINVAL;
 }
-#endif /* RTE_LIBRTE_EAL_HOTPLUG */
diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c
index 30ece44..c55112b 100644
--- a/lib/librte_eal/common/eal_common_pci.c
+++ b/lib/librte_eal/common/eal_common_pci.c
@@ -121,7 +121,6 @@ pci_map_resource(void *requested_addr, int fd, off_t offset, size_t size,
 	return mapaddr;
 }
 
-#ifdef RTE_LIBRTE_EAL_HOTPLUG
 /* unmap a particular resource */
 void
 pci_unmap_resource(void *requested_addr, size_t size)
@@ -138,7 +137,6 @@ pci_unmap_resource(void *requested_addr, size_t size)
 		RTE_LOG(DEBUG, EAL, "  PCI memory unmapped at %p\n",
 				requested_addr);
 }
-#endif /* RTE_LIBRTE_EAL_HOTPLUG */
 
 /* Map pci device */
 static int
@@ -170,7 +168,6 @@ pci_map_device(struct rte_pci_device *dev)
 	return ret;
 }
 
-#ifdef RTE_LIBRTE_EAL_HOTPLUG
 /* Unmap pci device */
 static void
 pci_unmap_device(struct rte_pci_device *dev)
@@ -195,7 +192,6 @@ pci_unmap_device(struct rte_pci_device *dev)
 		break;
 	}
 }
-#endif /* RTE_LIBRTE_EAL_HOTPLUG */
 
 /*
  * If vendor/device ID match, call the devinit() function of the
@@ -268,7 +264,6 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d
 	return 1;
 }
 
-#ifdef RTE_LIBRTE_EAL_HOTPLUG
 /*
  * If vendor/device ID match, call the devuninit() function of the
  * driver.
@@ -324,7 +319,6 @@ rte_eal_pci_close_one_driver(struct rte_pci_driver *dr,
 	/* return positive value if driver is not found */
 	return 1;
 }
-#endif /* RTE_LIBRTE_EAL_HOTPLUG */
 
 /*
  * If vendor/device ID match, call the devinit() function of all
@@ -353,7 +347,6 @@ pci_probe_all_drivers(struct rte_pci_device *dev)
 	return 1;
 }
 
-#ifdef RTE_LIBRTE_EAL_HOTPLUG
 /*
  * If vendor/device ID match, call the devuninit() function of all
  * registered driver for the given device. Return -1 if initialization
@@ -444,7 +437,6 @@ err_return:
 			dev->addr.devid, dev->addr.function);
 	return -1;
 }
-#endif /* RTE_LIBRTE_EAL_HOTPLUG */
 
 /*
  * Scan the content of the PCI bus, and call the devinit() function for
diff --git a/lib/librte_eal/common/eal_common_pci_uio.c b/lib/librte_eal/common/eal_common_pci_uio.c
index 32d3f57..06470f0 100644
--- a/lib/librte_eal/common/eal_common_pci_uio.c
+++ b/lib/librte_eal/common/eal_common_pci_uio.c
@@ -159,7 +159,6 @@ free_uio_res:
 	return -1;
 }
 
-#ifdef RTE_LIBRTE_EAL_HOTPLUG
 static void
 pci_uio_unmap(struct mapped_pci_resource *uio_res)
 {
@@ -232,4 +231,3 @@ pci_uio_unmap_resource(struct rte_pci_device *dev)
 	dev->intr_handle.fd = -1;
 	dev->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN;
 }
-#endif /* RTE_LIBRTE_EAL_HOTPLUG */
diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h
index 2ad3452..a999d3e 100644
--- a/lib/librte_eal/common/include/rte_pci.h
+++ b/lib/librte_eal/common/include/rte_pci.h
@@ -370,7 +370,6 @@ int rte_eal_pci_probe(void);
 void *pci_map_resource(void *requested_addr, int fd, off_t offset,
 		size_t size, int additional_flags);
 
-#ifdef RTE_LIBRTE_EAL_HOTPLUG
 /**
  * Map pci resouce.
  */
@@ -405,7 +404,6 @@ int rte_eal_pci_probe_one(const struct rte_pci_addr *addr);
  *   - Negative on error.
  */
 int rte_eal_pci_close_one(const struct rte_pci_addr *addr);
-#endif /* RTE_LIBRTE_EAL_HOTPLUG */
 
 /**
  * Dump the content of the PCI bus.
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 3c38d09..31c738f 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -425,9 +425,6 @@ rte_eth_dev_count(void)
 	return nb_ports;
 }
 
-/* So far, DPDK hotplug function only supports linux */
-#ifdef RTE_LIBRTE_EAL_HOTPLUG
-
 static enum rte_eth_dev_type
 rte_eth_dev_get_device_type(uint8_t port_id)
 {
@@ -708,24 +705,6 @@ rte_eth_dev_detach(uint8_t port_id, char *name)
 	} else
 		return rte_eth_dev_detach_vdev(port_id, name);
 }
-#else /* RTE_LIBRTE_EAL_HOTPLUG */
-int
-rte_eth_dev_attach(const char *devargs __rte_unused,
-			uint8_t *port_id __rte_unused)
-{
-	RTE_LOG(ERR, EAL, "Hotplug support isn't enabled\n");
-	return -1;
-}
-
-/* detach the device, then store the name of the device */
-int
-rte_eth_dev_detach(uint8_t port_id __rte_unused,
-			char *name __rte_unused)
-{
-	RTE_LOG(ERR, EAL, "Hotplug support isn't enabled\n");
-	return -1;
-}
-#endif /* RTE_LIBRTE_EAL_HOTPLUG */
 
 static int
 rte_eth_dev_rx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues)
-- 
2.1.4

  parent reply	other threads:[~2015-05-19  6:22 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-19  6:21 [dpdk-dev] [PATCH 0/8] Add Port Hotplug support to BSD Tetsuya Mukawa
2015-05-19  6:21 ` [dpdk-dev] [PATCH 1/8] eal: Add pci_uio_alloc_uio_resource() Tetsuya Mukawa
2015-05-19  6:21 ` [dpdk-dev] [PATCH 2/8] eal: Add pci_uio_map_uio_resource_by_index() Tetsuya Mukawa
2015-05-19  6:21 ` [dpdk-dev] [PATCH 3/8] eal: Consolidate pci_map and mapped_pci_resource of linuxapp and bsdapp Tetsuya Mukawa
2015-05-19  6:21 ` [dpdk-dev] [PATCH 4/8] eal: Consolidate rte_eal_pci_probe/close_one_driver() " Tetsuya Mukawa
2015-06-26  8:21   ` [dpdk-dev] [PATCH v2 0/8] Add Port Hotplug support to BSD Tetsuya Mukawa
2015-06-26  8:21     ` [dpdk-dev] [PATCH v2 1/8] eal: Add pci_uio_alloc_uio_resource() Tetsuya Mukawa
2015-06-26  8:21     ` [dpdk-dev] [PATCH v2 2/8] eal: Add pci_uio_map_uio_resource_by_index() Tetsuya Mukawa
2015-06-26  8:21     ` [dpdk-dev] [PATCH v2 3/8] eal: Consolidate pci_map and mapped_pci_resource of linuxapp and bsdapp Tetsuya Mukawa
2015-06-26  8:21     ` [dpdk-dev] [PATCH v2 4/8] eal: Consolidate rte_eal_pci_probe/close_one_driver() " Tetsuya Mukawa
2015-06-26  8:21     ` [dpdk-dev] [PATCH v2 5/8] eal: Consolidate pci_map/unmap_device() " Tetsuya Mukawa
2015-06-26  8:21     ` [dpdk-dev] [PATCH v2 6/8] eal: Consolidate pci_map/unmap_resource() " Tetsuya Mukawa
2015-06-26  8:21     ` [dpdk-dev] [PATCH v2 7/8] eal: Consolidate pci uio functions " Tetsuya Mukawa
2015-06-26  8:21     ` [dpdk-dev] [PATCH v2 8/8] eal: Enable Port Hotplug as default in Linux and BSD Tetsuya Mukawa
2015-06-29  2:56   ` [dpdk-dev] [PATCH v3 0/8] Add Port Hotplug support to BSD Tetsuya Mukawa
2015-06-29  2:56     ` [dpdk-dev] [PATCH v3 1/8] eal: Add pci_uio_alloc_uio_resource() Tetsuya Mukawa
2015-06-29 13:24       ` Iremonger, Bernard
2015-06-30  2:31         ` Tetsuya Mukawa
2015-06-29  2:56     ` [dpdk-dev] [PATCH v3 2/8] eal: Add pci_uio_map_uio_resource_by_index() Tetsuya Mukawa
2015-06-29 13:36       ` Iremonger, Bernard
2015-06-30  2:34         ` Tetsuya Mukawa
2015-06-29  2:56     ` [dpdk-dev] [PATCH v3 3/8] eal: Consolidate pci_map and mapped_pci_resource of linuxapp and bsdapp Tetsuya Mukawa
2015-06-29  2:56     ` [dpdk-dev] [PATCH v3 4/8] eal: Consolidate rte_eal_pci_probe/close_one_driver() " Tetsuya Mukawa
2015-06-29 15:28       ` Bruce Richardson
2015-06-30  8:08         ` Tetsuya Mukawa
2015-06-30 12:50           ` Bruce Richardson
2015-06-29  2:56     ` [dpdk-dev] [PATCH v3 5/8] eal: Consolidate pci_map/unmap_device() " Tetsuya Mukawa
2015-06-29  2:56     ` [dpdk-dev] [PATCH v3 6/8] eal: Consolidate pci_map/unmap_resource() " Tetsuya Mukawa
2015-06-29  2:56     ` [dpdk-dev] [PATCH v3 7/8] eal: Consolidate pci uio functions " Tetsuya Mukawa
2015-06-29 14:03       ` Iremonger, Bernard
2015-06-30  2:43         ` Tetsuya Mukawa
2015-06-30  8:28           ` Tetsuya Mukawa
2015-06-29  2:56     ` [dpdk-dev] [PATCH v3 8/8] eal: Enable Port Hotplug as default in Linux and BSD Tetsuya Mukawa
2015-06-30  8:26       ` [dpdk-dev] [PATCH v4] Add Port Hotplug support to BSD Tetsuya Mukawa
2015-06-30  8:26         ` [dpdk-dev] [PATCH v4] eal: Enable Port Hotplug as default in Linux and BSD Tetsuya Mukawa
2015-06-30 15:08           ` Iremonger, Bernard
2015-06-30 15:40             ` Bruce Richardson
2015-07-01  6:37               ` Tetsuya Mukawa
2015-07-08 22:15           ` Thomas Monjalon
2015-06-29 15:30     ` [dpdk-dev] [PATCH v3 0/8] Add Port Hotplug support to BSD Bruce Richardson
2015-06-30  8:08       ` Tetsuya Mukawa
2015-05-19  6:21 ` [dpdk-dev] [PATCH 5/8] eal: Consolidate pci_map/unmap_device() of linuxapp and bsdapp Tetsuya Mukawa
2015-05-19  6:21 ` [dpdk-dev] [PATCH 6/8] eal: Consolidate pci_map/unmap_resource() " Tetsuya Mukawa
2015-05-19  6:21 ` [dpdk-dev] [PATCH 7/8] eal: Consolidate pci uio functions " Tetsuya Mukawa
2015-05-19  6:21 ` Tetsuya Mukawa [this message]
2015-05-19 16:03 ` [dpdk-dev] [PATCH 0/8] Add Port Hotplug support to BSD Stephen Hemminger

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=1432016513-8456-9-git-send-email-mukawa@igel.co.jp \
    --to=mukawa@igel.co.jp \
    --cc=dev@dpdk.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).