From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 91407C326 for ; Tue, 30 Jun 2015 17:08:42 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 30 Jun 2015 08:08:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,378,1432623600"; d="scan'208";a="516629191" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by FMSMGA003.fm.intel.com with ESMTP; 30 Jun 2015 08:08:38 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.201]) by IRSMSX104.ger.corp.intel.com ([169.254.5.171]) with mapi id 14.03.0224.002; Tue, 30 Jun 2015 16:08:09 +0100 From: "Iremonger, Bernard" To: Tetsuya Mukawa , "dev@dpdk.org" Thread-Topic: [PATCH v4] eal: Enable Port Hotplug as default in Linux and BSD Thread-Index: AQHQsw6eFP7EOU/tDE+EwIikauQBW53FJjCg Date: Tue, 30 Jun 2015 15:08:08 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C204A435E7@IRSMSX108.ger.corp.intel.com> References: <1435546610-4533-9-git-send-email-mukawa@igel.co.jp> <1435652811-3487-1-git-send-email-mukawa@igel.co.jp> <1435652811-3487-2-git-send-email-mukawa@igel.co.jp> In-Reply-To: <1435652811-3487-2-git-send-email-mukawa@igel.co.jp> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4] eal: Enable Port Hotplug as default in Linux and BSD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 15:08:43 -0000 > -----Original Message----- > From: Tetsuya Mukawa [mailto:mukawa@igel.co.jp] > Sent: Tuesday, June 30, 2015 9:27 AM > To: dev@dpdk.org > Cc: Iremonger, Bernard; david.marchand@6wind.com; Richardson, Bruce; > Tetsuya.Mukawa > Subject: [PATCH v4] eal: Enable Port Hotplug as default in Linux and BSD >=20 > From: "Tetsuya.Mukawa" >=20 > 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 symbo= ls > 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() >=20 > Signed-off-by: Tetsuya Mukawa Hi Tetsuya, Would it be cleaner to add this patch to the [PATCH v7 12/12] patch set a= s patch 13 rather than having it as a separate patch? Regards, Bernard. =20 > --- > 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 | 6 ------ > lib/librte_eal/common/eal_common_pci_uio.c | 2 -- > lib/librte_eal/common/eal_private.h | 2 -- > lib/librte_eal/common/include/rte_pci.h | 2 -- > lib/librte_ether/rte_ethdev.c | 21 --------------------- > 10 files changed, 9 insertions(+), 49 deletions(-) >=20 > diff --git a/config/common_bsdapp b/config/common_bsdapp index > 464250b..c6e6e9c 100644 > --- a/config/common_bsdapp > +++ b/config/common_bsdapp > @@ -121,12 +121,6 @@ CONFIG_RTE_LIBRTE_EAL_BSDAPP=3Dy > CONFIG_RTE_LIBRTE_EAL_LINUXAPP=3Dn >=20 > # > -# Compile Environment Abstraction Layer to support hotplug -# So far, > Hotplug functions only support linux -# - > CONFIG_RTE_LIBRTE_EAL_HOTPLUG=3Dn > - > -# > # Compile Environment Abstraction Layer to support Vmware TSC map # > CONFIG_RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT=3Dy > diff --git a/config/common_linuxapp b/config/common_linuxapp index > aae22f4..c33a6fe 100644 > --- a/config/common_linuxapp > +++ b/config/common_linuxapp > @@ -119,11 +119,6 @@ CONFIG_RTE_PCI_MAX_READ_REQUEST_SIZE=3D0 > CONFIG_RTE_LIBRTE_EAL_LINUXAPP=3Dy >=20 > # > -# Compile Environment Abstraction Layer to support hotplug -# - > CONFIG_RTE_LIBRTE_EAL_HOTPLUG=3Dy > - > -# > # Compile Environment Abstraction Layer to support Vmware TSC map # > CONFIG_RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT=3Dy > diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c > b/lib/librte_eal/bsdapp/eal/eal_pci.c > index 508cfa7..0724c45 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 =3D 0; > @@ -366,7 +366,7 @@ rte_eal_pci_init(void) > if (internal_config.no_pci) > return 0; >=20 > - 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; > } >=20 > -#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 8ef8057..3805aed 100644 > --- a/lib/librte_eal/common/eal_common_pci.c > +++ b/lib/librte_eal/common/eal_common_pci.c > @@ -167,7 +167,6 @@ pci_map_device(struct rte_pci_device *dev) > return ret; > } >=20 > -#ifdef RTE_LIBRTE_EAL_HOTPLUG > /* Unmap pci device */ > static void > pci_unmap_device(struct rte_pci_device *dev) @@ -192,7 +191,6 @@ > pci_unmap_device(struct rte_pci_device *dev) > break; > } > } > -#endif /* RTE_LIBRTE_EAL_HOTPLUG */ >=20 > /* > * If vendor/device ID match, call the devinit() function of the @@ -265= ,7 > +263,6 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct > rte_pci_device *d > return 1; > } >=20 > -#ifdef RTE_LIBRTE_EAL_HOTPLUG > /* > * If vendor/device ID match, call the devuninit() function of the > * driver. > @@ -321,7 +318,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 */ >=20 > /* > * If vendor/device ID match, call the devinit() function of all @@ -350= ,7 > +346,6 @@ pci_probe_all_drivers(struct rte_pci_device *dev) > return 1; > } >=20 > -#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 @= @ -441,7 > +436,6 @@ err_return: > dev->addr.devid, dev->addr.function); > return -1; > } > -#endif /* RTE_LIBRTE_EAL_HOTPLUG */ >=20 > /* > * 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 bf29484..bb38498 100644 > --- a/lib/librte_eal/common/eal_common_pci_uio.c > +++ b/lib/librte_eal/common/eal_common_pci_uio.c > @@ -194,7 +194,6 @@ free_uio_res: > return -1; > } >=20 > -#ifdef RTE_LIBRTE_EAL_HOTPLUG > static void > pci_uio_unmap(struct mapped_pci_resource *uio_res) { @@ -267,4 +266,3 > @@ pci_uio_unmap_resource(struct rte_pci_device *dev) > dev->intr_handle.fd =3D -1; > dev->intr_handle.type =3D RTE_INTR_HANDLE_UNKNOWN; } -#endif > /* RTE_LIBRTE_EAL_HOTPLUG */ diff --git > a/lib/librte_eal/common/eal_private.h > b/lib/librte_eal/common/eal_private.h > index 216c098..6c9ac1a 100644 > --- a/lib/librte_eal/common/eal_private.h > +++ b/lib/librte_eal/common/eal_private.h > @@ -174,14 +174,12 @@ int pci_unbind_kernel_driver(struct rte_pci_device > *dev); > */ > int pci_uio_map_resource(struct rte_pci_device *dev); >=20 > -#ifdef RTE_LIBRTE_EAL_HOTPLUG > /** > * Unmap this device > * > * This function is private to EAL. > */ > void pci_uio_unmap_resource(struct rte_pci_device *dev); -#endif /* > RTE_LIBRTE_EAL_HOTPLUG */ >=20 > /** > * Allocate uio resource for PCI device diff --git > a/lib/librte_eal/common/include/rte_pci.h > b/lib/librte_eal/common/include/rte_pci.h > index 475d2dc..a8b6a10 100644 > --- a/lib/librte_eal/common/include/rte_pci.h > +++ b/lib/librte_eal/common/include/rte_pci.h > @@ -376,7 +376,6 @@ void *pci_map_resource(void *requested_addr, int > fd, off_t offset, > */ > void pci_unmap_resource(void *requested_addr, size_t size); >=20 > -#ifdef RTE_LIBRTE_EAL_HOTPLUG > /** > * Probe the single PCI device. > * > @@ -406,7 +405,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 */ >=20 > /** > * Dump the content of the PCI bus. > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.= c > index 1822258..43b9fcc 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; > } >=20 > -/* 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 */ >=20 > static int > rte_eth_dev_rx_queue_config(struct rte_eth_dev *dev, uint16_t > nb_queues) > -- > 2.1.4