Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/5756/?format=api
https://patches.dpdk.org/api/patches/5756/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1435158522-28547-1-git-send-email-bernard.iremonger@intel.com/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1435158522-28547-1-git-send-email-bernard.iremonger@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1435158522-28547-1-git-send-email-bernard.iremonger@intel.com", "date": "2015-06-24T15:08:42", "name": "[dpdk-dev,v5] ixgbe: changes to support PCI Port Hotplug", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "32f57b03ec392911017571984fdace756fd77f61", "submitter": { "id": 91, "url": "https://patches.dpdk.org/api/people/91/?format=api", "name": "Iremonger, Bernard", "email": "bernard.iremonger@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1435158522-28547-1-git-send-email-bernard.iremonger@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/5756/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/5756/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 0AA9FC53C;\n\tWed, 24 Jun 2015 17:08:49 +0200 (CEST)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id A50AEC534\n\tfor <dev@dpdk.org>; Wed, 24 Jun 2015 17:08:47 +0200 (CEST)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga102.fm.intel.com with ESMTP; 24 Jun 2015 08:08:46 -0700", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga001.jf.intel.com with ESMTP; 24 Jun 2015 08:08:44 -0700", "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tt5OF8iuU002307; Wed, 24 Jun 2015 16:08:44 +0100", "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id t5OF8h48028749;\n\tWed, 24 Jun 2015 16:08:43 +0100", "(from bairemon@localhost)\n\tby sivswdev01.ir.intel.com with id t5OF8ht4028745;\n\tWed, 24 Jun 2015 16:08:43 +0100" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.13,672,1427785200\"; d=\"scan'208\";a=\"716891456\"", "From": "Bernard Iremonger <bernard.iremonger@intel.com>", "To": "dev@dpdk.org", "Date": "Wed, 24 Jun 2015 16:08:42 +0100", "Message-Id": "<1435158522-28547-1-git-send-email-bernard.iremonger@intel.com>", "X-Mailer": "git-send-email 1.7.4.1", "In-Reply-To": "<PATCH>", "References": "<PATCH>", "Subject": "[dpdk-dev] [PATCH v5] ixgbe: changes to support PCI Port Hotplug", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "This patch depends on the Port Hotplug Framework.\nIt implements the eth_dev_uninit functions for rte_ixgbe_pmd and\nrte_ixgbevf_pmd.\n\nChanges in V5:\nSet nb_rx_queues and nb_tx_queues to 0 in uninit functions.\nRebased to latest ixgbe code.\n\nChanges in V4:\nRelease rx and tx queues in dev_uninit() functions.\nReplace TRUE and FALSE with 1 and 0.\n\nChanges in V3:\nRebased to use drivers/net/ixgbe directory.\n\nChanges in V2:\nAdded call to dev_close() in dev_uninit() functions.\nRemoved input parameter checks from dev_uninit() functions.\n\nSigned-off-by: Bernard Iremonger <bernard.iremonger@intel.com>\n---\n drivers/net/ixgbe/ixgbe_ethdev.c | 111 ++++++++++++++++++++++++++++++++++++--\n drivers/net/ixgbe/ixgbe_ethdev.h | 2 +\n drivers/net/ixgbe/ixgbe_pf.c | 23 ++++++++\n 3 files changed, 131 insertions(+), 5 deletions(-)", "diff": "diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c\nindex f18550c..b657c38 100644\n--- a/drivers/net/ixgbe/ixgbe_ethdev.c\n+++ b/drivers/net/ixgbe/ixgbe_ethdev.c\n@@ -117,6 +117,7 @@\n #define IXGBE_QUEUE_STAT_COUNTERS (sizeof(hw_stats->qprc) / sizeof(hw_stats->qprc[0]))\n \n static int eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev);\n+static int eth_ixgbe_dev_uninit(struct rte_eth_dev *eth_dev);\n static int ixgbe_dev_configure(struct rte_eth_dev *dev);\n static int ixgbe_dev_start(struct rte_eth_dev *dev);\n static void ixgbe_dev_stop(struct rte_eth_dev *dev);\n@@ -183,6 +184,7 @@ static void ixgbe_dcb_init(struct ixgbe_hw *hw,struct ixgbe_dcb_config *dcb_conf\n \n /* For Virtual Function support */\n static int eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev);\n+static int eth_ixgbevf_dev_uninit(struct rte_eth_dev *eth_dev);\n static int ixgbevf_dev_configure(struct rte_eth_dev *dev);\n static int ixgbevf_dev_start(struct rte_eth_dev *dev);\n static void ixgbevf_dev_stop(struct rte_eth_dev *dev);\n@@ -922,6 +924,59 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)\n \treturn 0;\n }\n \n+static int\n+eth_ixgbe_dev_uninit(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct rte_pci_device *pci_dev;\n+\tstruct ixgbe_hw *hw;\n+\tunsigned i;\n+\n+\tPMD_INIT_FUNC_TRACE();\n+\n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\t\treturn -EPERM;\n+\n+\thw = IXGBE_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);\n+\tpci_dev = eth_dev->pci_dev;\n+\n+\tif (hw->adapter_stopped == 0)\n+\t\tixgbe_dev_close(eth_dev);\n+\n+\teth_dev->dev_ops = NULL;\n+\teth_dev->rx_pkt_burst = NULL;\n+\teth_dev->tx_pkt_burst = NULL;\n+\n+\t/* Unlock any pending hardware semaphore */\n+\tixgbe_swfw_lock_reset(hw);\n+\n+\t/* disable uio intr before callback unregister */\n+\trte_intr_disable(&(pci_dev->intr_handle));\n+\trte_intr_callback_unregister(&(pci_dev->intr_handle),\n+\t\tixgbe_dev_interrupt_handler, (void *)eth_dev);\n+\n+\t/* uninitialize PF if max_vfs not zero */\n+\tixgbe_pf_host_uninit(eth_dev);\n+\n+\tfor (i = 0; i < eth_dev->data->nb_rx_queues; i++) {\n+\t\tixgbe_dev_rx_queue_release(eth_dev->data->rx_queues[i]);\n+\t\teth_dev->data->rx_queues[i] = NULL;\n+\t}\n+\teth_dev->data->nb_rx_queues = 0;\n+\n+\tfor (i = 0; i < eth_dev->data->nb_tx_queues; i++) {\n+\t\tixgbe_dev_tx_queue_release(eth_dev->data->tx_queues[i]);\n+\t\teth_dev->data->tx_queues[i] = NULL;\n+\t}\n+\teth_dev->data->nb_tx_queues = 0;\n+\n+\trte_free(eth_dev->data->mac_addrs);\n+\teth_dev->data->mac_addrs = NULL;\n+\n+\trte_free(eth_dev->data->hash_mac_addrs);\n+\teth_dev->data->hash_mac_addrs = NULL;\n+\n+\treturn 0;\n+}\n \n /*\n * Negotiate mailbox API version with the PF.\n@@ -1092,13 +1147,58 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev)\n \treturn 0;\n }\n \n+/* Virtual Function device uninit */\n+\n+static int\n+eth_ixgbevf_dev_uninit(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct ixgbe_hw *hw;\n+\tunsigned i;\n+\n+\tPMD_INIT_FUNC_TRACE();\n+\n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\t\treturn -EPERM;\n+\n+\thw = IXGBE_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);\n+\n+\tif (hw->adapter_stopped == 0)\n+\t\tixgbevf_dev_close(eth_dev);\n+\n+\teth_dev->dev_ops = NULL;\n+\teth_dev->rx_pkt_burst = NULL;\n+\teth_dev->tx_pkt_burst = NULL;\n+\n+\t/* Disable the interrupts for VF */\n+\tixgbevf_intr_disable(hw);\n+\n+\tfor (i = 0; i < eth_dev->data->nb_rx_queues; i++) {\n+\t\tixgbe_dev_rx_queue_release(eth_dev->data->rx_queues[i]);\n+\t\teth_dev->data->rx_queues[i] = NULL;\n+\t}\n+\teth_dev->data->nb_rx_queues = 0;\n+\n+\tfor (i = 0; i < eth_dev->data->nb_tx_queues; i++) {\n+\t\tixgbe_dev_tx_queue_release(eth_dev->data->tx_queues[i]);\n+\t\teth_dev->data->tx_queues[i] = NULL;\n+\t}\n+\teth_dev->data->nb_tx_queues = 0;\n+\n+\trte_free(eth_dev->data->mac_addrs);\n+\teth_dev->data->mac_addrs = NULL;\n+\n+\treturn 0;\n+}\n+\n static struct eth_driver rte_ixgbe_pmd = {\n \t.pci_drv = {\n \t\t.name = \"rte_ixgbe_pmd\",\n \t\t.id_table = pci_id_ixgbe_map,\n-\t\t.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,\n+\t\t.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC |\n+\t\t\tRTE_PCI_DRV_DETACHABLE,\n \t},\n \t.eth_dev_init = eth_ixgbe_dev_init,\n+\t.eth_dev_uninit = eth_ixgbe_dev_uninit,\n \t.dev_private_size = sizeof(struct ixgbe_adapter),\n };\n \n@@ -1109,9 +1209,10 @@ static struct eth_driver rte_ixgbevf_pmd = {\n \t.pci_drv = {\n \t\t.name = \"rte_ixgbevf_pmd\",\n \t\t.id_table = pci_id_ixgbevf_map,\n-\t\t.drv_flags = RTE_PCI_DRV_NEED_MAPPING,\n+\t\t.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_DETACHABLE,\n \t},\n \t.eth_dev_init = eth_ixgbevf_dev_init,\n+\t.eth_dev_uninit = eth_ixgbevf_dev_uninit,\n \t.dev_private_size = sizeof(struct ixgbe_adapter),\n };\n \n@@ -1481,7 +1582,7 @@ ixgbe_dev_start(struct rte_eth_dev *dev)\n \t}\n \n \t/* stop adapter */\n-\thw->adapter_stopped = FALSE;\n+\thw->adapter_stopped = 0;\n \tixgbe_stop_adapter(hw);\n \n \t/* reinitialize adapter\n@@ -1639,7 +1740,7 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)\n \n \t/* reset the NIC */\n \tixgbe_pf_reset_hw(hw);\n-\thw->adapter_stopped = FALSE;\n+\thw->adapter_stopped = 0;\n \n \t/* stop adapter */\n \tixgbe_stop_adapter(hw);\n@@ -3043,7 +3144,7 @@ ixgbevf_dev_stop(struct rte_eth_dev *dev)\n \n \tPMD_INIT_FUNC_TRACE();\n \n-\thw->adapter_stopped = TRUE;\n+\thw->adapter_stopped = 1;\n \tixgbe_stop_adapter(hw);\n \n \t/*\ndiff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h\nindex 19237b8..710ee87 100644\n--- a/drivers/net/ixgbe/ixgbe_ethdev.h\n+++ b/drivers/net/ixgbe/ixgbe_ethdev.h\n@@ -389,6 +389,8 @@ void ixgbe_vlan_hw_strip_disable_all(struct rte_eth_dev *dev);\n \n void ixgbe_pf_host_init(struct rte_eth_dev *eth_dev);\n \n+void ixgbe_pf_host_uninit(struct rte_eth_dev *eth_dev);\n+\n void ixgbe_pf_mbx_process(struct rte_eth_dev *eth_dev);\n \n int ixgbe_pf_host_configure(struct rte_eth_dev *eth_dev);\ndiff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c\nindex caed137..46d1ea9 100644\n--- a/drivers/net/ixgbe/ixgbe_pf.c\n+++ b/drivers/net/ixgbe/ixgbe_pf.c\n@@ -144,6 +144,29 @@ void ixgbe_pf_host_init(struct rte_eth_dev *eth_dev)\n \treturn;\n }\n \n+void ixgbe_pf_host_uninit(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct ixgbe_vf_info **vfinfo;\n+\tuint16_t vf_num;\n+\n+\tPMD_INIT_FUNC_TRACE();\n+\n+\tvfinfo = IXGBE_DEV_PRIVATE_TO_P_VFDATA(eth_dev->data->dev_private);\n+\n+\tRTE_ETH_DEV_SRIOV(eth_dev).active = 0;\n+\tRTE_ETH_DEV_SRIOV(eth_dev).nb_q_per_pool = 0;\n+\tRTE_ETH_DEV_SRIOV(eth_dev).def_vmdq_idx = 0;\n+\tRTE_ETH_DEV_SRIOV(eth_dev).def_pool_q_idx = 0;\n+\n+\tvf_num = dev_num_vf(eth_dev);\n+\tif (vf_num == 0)\n+\t\treturn;\n+\n+\trte_free(*vfinfo);\n+\t*vfinfo = NULL;\n+}\n+\n+\n int ixgbe_pf_host_configure(struct rte_eth_dev *eth_dev)\n {\n \tuint32_t vtctl, fcrth;\n", "prefixes": [ "dpdk-dev", "v5" ] }{ "id": 5756, "url": "