From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 10A89B5A1 for ; Mon, 16 Feb 2015 06:13:33 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 15 Feb 2015 21:13:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,585,1418112000"; d="scan'208";a="678467087" Received: from kmsmsx153.gar.corp.intel.com ([172.21.73.88]) by fmsmga002.fm.intel.com with ESMTP; 15 Feb 2015 21:13:30 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by KMSMSX153.gar.corp.intel.com (172.21.73.88) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 16 Feb 2015 13:13:29 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.192]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.209]) with mapi id 14.03.0195.001; Mon, 16 Feb 2015 13:13:27 +0800 From: "Qiu, Michael" To: Tetsuya Mukawa , "dev@dpdk.org" Thread-Topic: [PATCH v8 00/14] Port Hotplug Framework Thread-Index: AQHQSZ8kdINegZ3+6UuH9Aq7xXvkLQ== Date: Mon, 16 Feb 2015 05:13:27 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286CEA233@SHSMSX101.ccr.corp.intel.com> References: <1423470639-15744-2-git-send-email-mukawa@igel.co.jp> <1424060073-23484-1-git-send-email-mukawa@igel.co.jp> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v8 00/14] Port Hotplug Framework 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: Mon, 16 Feb 2015 05:13:34 -0000 On 2/16/2015 12:15 PM, Tetsuya Mukawa wrote:=0A= > This patch series adds a dynamic port hotplug framework to DPDK.=0A= > With the patches, DPDK apps can attach or detach ports at runtime.=0A= >=0A= > The basic concept of the port hotplug is like followings.=0A= > - DPDK apps must have responsibility to manage ports.=0A= > DPDK apps only know which ports are attached or detached at the moment.= =0A= > The port hotplug framework is implemented to allow DPDK apps to manage = ports.=0A= > For example, when DPDK apps call port attach function, attached port nu= mber=0A= > will be returned. Also, DPDK apps can detach port by port number.=0A= > - Kernel support is needed for attaching or detaching physical device por= ts.=0A= > To attach a new physical device port, the device will be recognized by= =0A= > userspace directly I/O framework in kernel at first. Then DPDK apps can= =0A= > call the port hotplug functions to attach ports.=0A= > For detaching, steps are vice versa.=0A= > - Before detach ports, ports must be stopped and closed.=0A= > DPDK application must call rte_eth_dev_stop() and rte_eth_dev_close() b= efore=0A= > detaching ports. These function will call finalization codes of PMDs.= =0A= > But so far, no PMD frees all resources allocated by initialization.=0A= > It means PMDs are needed to be fixed to support the port hotplug.=0A= > 'RTE_PCI_DRV_DETACHABLE' is a new flag indicating a PMD supports detach= ing.=0A= > Without this flag, detaching will be failed.=0A= > - Mustn't affect legacy DPDK apps.=0A= > No DPDK EAL behavior is changed, if the port hotplug functions are't ca= lled.=0A= > So all legacy DPDK apps can still work without modifications.=0A= >=0A= > And a few limitations.=0A= > - The port hotplug functions are not thread safe.=0A= > DPDK apps should handle it.=0A= > - Only support Linux and igb_uio so far.=0A= > BSD and VFIO is not supported. I will send VFIO patches at least, but I= don't=0A= > have a plan to submit BSD patch so far.=0A= >=0A= >=0A= > Here is port hotplug APIs.=0A= > -------------------------------------------------------------------------= ------=0A= > /**=0A= > * Attach a new device.=0A= > *=0A= > * @param devargs=0A= > * A pointer to a strings array describing the new device=0A= > * to be attached. The strings should be a pci address like=0A= > * '0000:01:00.0' or virtual device name like 'eth_pcap0'.=0A= > * @param port_id=0A= > * A pointer to a port identifier actually attached.=0A= > * @return=0A= > * 0 on success and port_id is filled, negative on error=0A= > */=0A= > int rte_eal_dev_attach(const char *devargs, uint8_t *port_id);=0A= >=0A= > /**=0A= > * Detach a device.=0A= > *=0A= > * @param port_id=0A= > * The port identifier of the device to detach.=0A= > * @param addr=0A= > * A pointer to a device name actually detached.=0A= > * @return=0A= > * 0 on success and devname is filled, negative on error=0A= > */=0A= > int rte_eal_dev_detach(uint8_t port_id, char *devname);=0A= > -------------------------------------------------------------------------= ------=0A= >=0A= > This patch series are for DPDK EAL. To use port hotplug function by DPDK = apps,=0A= > each PMD should be fixed to support 'RTE_PCI_DRV_DETACHABLE' flag. Please= check=0A= > a patch for pcap PMD.=0A= >=0A= > Also, please check testpmd patch. It will show you how to fix your legacy= =0A= > applications to support port hotplug feature.=0A= >=0A= > PATCH v8 changes=0A= > - Fix Makefile and add version map file.=0A= > - Add missing symbol in version map.=0A= > - Fix pci_scan_one() to update sysfs values.=0A= > (Thanks to Qiu, Michael and Iremonger, Bernard)=0A= > - NONE_TRACE is replaced by NO_TRACE.=0A= > - Fix typo.=0A= > - Add size parameter to rte_eth_dev_save().=0A= > (Thanks to Iremonger, Bernard)=0A= >=0A= > PATCH v7 changes=0A= > - Add a new section to programmer's guide.=0A= > (Thanks to Iremonger, Bernard)=0A= > - Fix port checking implementation of star_port().=0A= > - Fix typo of warning messages.=0A= > - Add pt_driver checking to rte_eth_dev_check_detachable().=0A= > (Thanks to Qiu, Michael)=0A= >=0A= > PATCH v6 changes=0A= > - Fix rte_eth_dev_uninit() to handle a return value of uninit=0A= > function of PMD. To do this, below changes also be applied.=0A= > - Fix a parameter of rte_eth_dev_free().=0A= > - Use rte_eth_dev structure as the paramter of rte_eth_dev_free().=0A= >=0A= > PATCH v5 changes=0A= > - Add runtime check passthrough driver type, like vfio-pci, igb_uio=0A= > and uio_pci_generic.=0A= > This was done by Qiu, Michael. Thanks a lot.=0A= > - Change function names like below.=0A= > - rte_eal_dev_find_and_invoke() to rte_eal_vdev_find_and_invoke().=0A= > - rte_eal_dev_invoke() to rte_eal_vdev_invoke().=0A= > - Add code to handle a return value of rte_eal_devargs_remove().=0A= > - Fix pci address format in rte_eal_dev_detach().=0A= > - Remove RTE_EAL_INVOKE_TYPE_UNKNOWN, because it's unused.=0A= > - Change function definition of rte_eal_devargs_remove().=0A= > - Fix pci_unmap_device() to check pt_driver.=0A= > - Fix return value of below functions.=0A= > - rte_eth_dev_get_changed_port().=0A= > - rte_eth_dev_get_port_by_addr().=0A= > - Change paramters of rte_eth_dev_validate_port() to cleanup code.=0A= > - Fix pci_scan_one to handle pt_driver correctly.=0A= > (Thanks to Qiu, Michael for above suggestions)=0A= >=0A= > PATCH v4 changes=0A= > - Merge patches to review easier.=0A= > - Fix indent of 'if' statement.=0A= > - Fix calculation method of eal_compare_pci_addr().=0A= > - Fix header file declaration.=0A= > - Add header file to determine if hotplug can be enabled.=0A= > (Thanks to Qiu, Michael)=0A= > - Use braces with 'for' loop.=0A= > - Add parameter checking.=0A= > - Fix sanity check code=0A= > - Fix comments of rte_eth_dev_type.=0A= > - Change function names.=0A= > (Thanks to Iremonger, Bernard)=0A= >=0A= > PATCH v3 changes:=0A= > - Fix enum definition used in rte_ethdev.c.=0A= > (Thanks to Zhang, Helin)=0A= >=0A= > PATCH v2 changes:=0A= > - Replace rte_eal_dev_attach_pdev(), rte_eal_dev_detach_pdev,=0A= > rte_eal_dev_attach_vdev() and rte_eal_dev_detach_vdev() to=0A= > rte_eal_dev_attach() and rte_eal_dev_detach().=0A= > - Add parameter values checking.=0A= > - Refashion a few functions.=0A= > (Thanks to Iremonger, Bernard)=0A= >=0A= > PATCH v1 Changes:=0A= > - Fix error checking code of librte_eth APIs.=0A= > - Fix issue that port from pcap PMD cannot be detached correctly.=0A= > - Fix issue that testpmd could hang after forwarding, if attaching and d= etaching=0A= > is repeatedly.=0A= > - Fix if-condition of rte_eth_dev_get_port_by_addr().=0A= > (Thanks to Mark Enright)=0A= >=0A= > RFC PATCH v2 Changes:=0A= > - remove 'rte_eth_dev_validate_port()', and cleanup codes.=0A= >=0A= >=0A= > Michael Qiu (2):=0A= > eal_pci: Add flag to hold kernel driver type=0A= > eal_pci: pci memory map work with driver type=0A= >=0A= > Tetsuya Mukawa (12):=0A= > eal/pci,ethdev: Remove assumption that port will not be detached=0A= > eal/pci: Consolidate pci address comparison APIs=0A= > ethdev: Add rte_eth_dev_free to free specified device=0A= > eal,ethdev: Add a function and function pointers to close ether device= =0A= > ethdev: Add functions that will be used by port hotplug functions=0A= > eal/linux/pci: Add functions for unmapping igb_uio resources=0A= > eal/pci: Add a function to remove the entry of devargs list=0A= > eal/pci: Cleanup pci driver initialization code=0A= > ethdev: Add one dev_type parameter to rte_eth_dev_allocate=0A= > eal/pci: Add rte_eal_dev_attach/detach() functions=0A= > eal: Enable port hotplug framework in Linux=0A= > doc: Add port hotplug framework section to programmers guide=0A= >=0A= > app/test/virtual_pmd.c | 2 +-=0A= > config/common_linuxapp | 5 +=0A= > doc/guides/prog_guide/index.rst | 1 +=0A= > doc/guides/prog_guide/port_hotplug_framework.rst | 110 ++++=0A= > lib/librte_eal/bsdapp/eal/eal_pci.c | 29 +-=0A= > lib/librte_eal/common/Makefile | 1 +=0A= > lib/librte_eal/common/eal_common_dev.c | 276 ++++++++++=0A= > lib/librte_eal/common/eal_common_devargs.c | 60 +++=0A= > lib/librte_eal/common/eal_common_pci.c | 92 +++-=0A= > lib/librte_eal/common/eal_private.h | 35 ++=0A= > lib/librte_eal/common/include/rte_dev.h | 33 ++=0A= > lib/librte_eal/common/include/rte_dev_hotplug.h | 44 ++=0A= > lib/librte_eal/common/include/rte_devargs.h | 21 +=0A= > lib/librte_eal/common/include/rte_pci.h | 84 +++=0A= > lib/librte_eal/linuxapp/eal/Makefile | 1 +=0A= > lib/librte_eal/linuxapp/eal/eal_pci.c | 232 +++++++--=0A= > lib/librte_eal/linuxapp/eal/eal_pci_init.h | 8 +=0A= > lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 67 ++-=0A= > lib/librte_eal/linuxapp/eal/rte_eal_version.map | 2 +=0A= > lib/librte_ether/rte_ethdev.c | 636 +++++++++++++----= ------=0A= > lib/librte_ether/rte_ethdev.h | 151 +++++-=0A= > lib/librte_ether/rte_ether_version.map | 7 +=0A= > lib/librte_pmd_af_packet/rte_eth_af_packet.c | 2 +-=0A= > lib/librte_pmd_bond/rte_eth_bond_api.c | 2 +-=0A= > lib/librte_pmd_pcap/rte_eth_pcap.c | 2 +-=0A= > lib/librte_pmd_ring/rte_eth_ring.c | 2 +-=0A= > lib/librte_pmd_xenvirt/rte_eth_xenvirt.c | 2 +-=0A= > 27 files changed, 1560 insertions(+), 347 deletions(-)=0A= > create mode 100644 doc/guides/prog_guide/port_hotplug_framework.rst=0A= > create mode 100644 lib/librte_eal/common/include/rte_dev_hotplug.h=0A= >=0A= Acked-by: Michael Qiu =0A=