Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/5466/?format=api
http://patches.dpdk.org/api/patches/5466/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1434530691-16242-1-git-send-email-michael.qiu@intel.com/", "project": { "id": 1, "url": "http://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": "<1434530691-16242-1-git-send-email-michael.qiu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1434530691-16242-1-git-send-email-michael.qiu@intel.com", "date": "2015-06-17T08:44:51", "name": "[dpdk-dev,2/2,v2] fm10k: Add hotplug support for fm10k", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "3c6f071ee5d598c1814fcc6c88418b666c8b2f64", "submitter": { "id": 101, "url": "http://patches.dpdk.org/api/people/101/?format=api", "name": "Michael Qiu", "email": "michael.qiu@intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1434530691-16242-1-git-send-email-michael.qiu@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/5466/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/5466/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 0E000C3EE;\n\tWed, 17 Jun 2015 10:45:00 +0200 (CEST)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id E8C1BC3E2\n\tfor <dev@dpdk.org>; Wed, 17 Jun 2015 10:44:57 +0200 (CEST)", "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga102.jf.intel.com with ESMTP; 17 Jun 2015 01:44:56 -0700", "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga003.jf.intel.com with ESMTP; 17 Jun 2015 01:44:56 -0700", "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id t5H8isZ1023105;\n\tWed, 17 Jun 2015 16:44:54 +0800", "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid t5H8iqLN016276; Wed, 17 Jun 2015 16:44:54 +0800", "(from dayuqiu@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t5H8ipb4016272; \n\tWed, 17 Jun 2015 16:44:51 +0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.13,632,1427785200\"; d=\"scan'208\";a=\"589411036\"", "From": "Michael Qiu <michael.qiu@intel.com>", "To": "dev@dpdk.org", "Date": "Wed, 17 Jun 2015 16:44:51 +0800", "Message-Id": "<1434530691-16242-1-git-send-email-michael.qiu@intel.com>", "X-Mailer": "git-send-email 1.7.4.1", "In-Reply-To": "<1433938895-16331-2-git-send-email-michael.qiu@intel.com>", "References": "<1433938895-16331-2-git-send-email-michael.qiu@intel.com>", "Cc": "shaopeng.he@intel.com", "Subject": "[dpdk-dev] [PATCH 2/2 v2] fm10k: Add hotplug support for fm10k", "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": "Add hotplug support for fm10k.\n\nSigned-off-by: Michael Qiu <michael.qiu@intel.com>\n---\n drivers/net/fm10k/fm10k_ethdev.c | 97 +++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 96 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c\nindex e310698..0d3eaf1 100644\n--- a/drivers/net/fm10k/fm10k_ethdev.c\n+++ b/drivers/net/fm10k/fm10k_ethdev.c\n@@ -1412,6 +1412,36 @@ fm10k_dev_enable_intr_pf(struct rte_eth_dev *dev)\n }\n \n static void\n+fm10k_dev_disable_intr_pf(struct rte_eth_dev *dev)\n+{\n+\tstruct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tuint32_t int_map = FM10K_INT_MAP_DISABLE;\n+\n+\tint_map |= 0;\n+\n+\tFM10K_WRITE_REG(hw, FM10K_INT_MAP(fm10k_int_Mailbox), int_map);\n+\tFM10K_WRITE_REG(hw, FM10K_INT_MAP(fm10k_int_PCIeFault), int_map);\n+\tFM10K_WRITE_REG(hw, FM10K_INT_MAP(fm10k_int_SwitchUpDown), int_map);\n+\tFM10K_WRITE_REG(hw, FM10K_INT_MAP(fm10k_int_SwitchEvent), int_map);\n+\tFM10K_WRITE_REG(hw, FM10K_INT_MAP(fm10k_int_SRAM), int_map);\n+\tFM10K_WRITE_REG(hw, FM10K_INT_MAP(fm10k_int_VFLR), int_map);\n+\n+\t/* Disable misc causes */\n+\tFM10K_WRITE_REG(hw, FM10K_EIMR, FM10K_EIMR_DISABLE(PCA_FAULT) |\n+\t\t\t\tFM10K_EIMR_DISABLE(THI_FAULT) |\n+\t\t\t\tFM10K_EIMR_DISABLE(FUM_FAULT) |\n+\t\t\t\tFM10K_EIMR_DISABLE(MAILBOX) |\n+\t\t\t\tFM10K_EIMR_DISABLE(SWITCHREADY) |\n+\t\t\t\tFM10K_EIMR_DISABLE(SWITCHNOTREADY) |\n+\t\t\t\tFM10K_EIMR_DISABLE(SRAMERROR) |\n+\t\t\t\tFM10K_EIMR_DISABLE(VFLR));\n+\n+\t/* Disable ITR 0 */\n+\tFM10K_WRITE_REG(hw, FM10K_ITR(0), FM10K_ITR_MASK_SET);\n+\tFM10K_WRITE_FLUSH(hw);\n+}\n+\n+static void\n fm10k_dev_enable_intr_vf(struct rte_eth_dev *dev)\n {\n \tstruct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n@@ -1429,6 +1459,22 @@ fm10k_dev_enable_intr_vf(struct rte_eth_dev *dev)\n \tFM10K_WRITE_FLUSH(hw);\n }\n \n+static void\n+fm10k_dev_disable_intr_vf(struct rte_eth_dev *dev)\n+{\n+\tstruct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tuint32_t int_map = FM10K_INT_MAP_DISABLE;\n+\n+\tint_map |= 0;\n+\n+\t/* Only INT 0 available, other 15 are reserved. */\n+\tFM10K_WRITE_REG(hw, FM10K_VFINT_MAP, int_map);\n+\n+\t/* Disable ITR 0 */\n+\tFM10K_WRITE_REG(hw, FM10K_VFITR(0), FM10K_ITR_MASK_SET);\n+\tFM10K_WRITE_FLUSH(hw);\n+}\n+\n static int\n fm10k_dev_handle_fault(struct fm10k_hw *hw, uint32_t eicr)\n {\n@@ -1858,6 +1904,54 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)\n \treturn 0;\n }\n \n+static int\n+eth_fm10k_dev_uninit(struct rte_eth_dev *dev)\n+{\n+\tstruct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\n+\tPMD_INIT_FUNC_TRACE();\n+\n+\t/* only uninitialize in the primary process */\n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\t\treturn 0;\n+\n+\t/* safe to close dev here */\n+\tfm10k_dev_close(dev);\n+\n+\tdev->dev_ops = NULL;\n+\tdev->rx_pkt_burst = NULL;\n+\tdev->tx_pkt_burst = NULL;\n+\n+\t/* disable uio/vfio intr */\n+\trte_intr_disable(&(dev->pci_dev->intr_handle));\n+\n+\t/*PF/VF has different interrupt handling mechanism */\n+\tif (hw->mac.type == fm10k_mac_pf) {\n+\t\t/* disable interrupt */\n+\t\tfm10k_dev_disable_intr_pf(dev);\n+\n+\t\t/* unregister callback func to eal lib */\n+\t\trte_intr_callback_unregister(&(dev->pci_dev->intr_handle),\n+\t\t\tfm10k_dev_interrupt_handler_pf, (void *)dev);\n+\t} else {\n+\t\t/* disable interrupt */\n+\t\tfm10k_dev_disable_intr_vf(dev);\n+\n+\t\trte_intr_callback_unregister(&(dev->pci_dev->intr_handle),\n+\t\t\tfm10k_dev_interrupt_handler_vf, (void *)dev);\n+\t}\n+\n+\t/* free mac memory */\n+\tif (dev->data->mac_addrs) {\n+\t\trte_free(dev->data->mac_addrs);\n+\t\tdev->data->mac_addrs = NULL;\n+\t}\n+\n+\tmemset(hw, 0, sizeof(*hw));\n+\n+\treturn 0;\n+}\n+\n /*\n * The set of PCI devices this driver supports. This driver will enable both PF\n * and SRIOV-VF devices.\n@@ -1873,9 +1967,10 @@ static struct eth_driver rte_pmd_fm10k = {\n \t{\n \t\t.name = \"rte_pmd_fm10k\",\n \t\t.id_table = pci_id_fm10k_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_fm10k_dev_init,\n+\t.eth_dev_uninit = eth_fm10k_dev_uninit,\n \t.dev_private_size = sizeof(struct fm10k_adapter),\n };\n \n", "prefixes": [ "dpdk-dev", "2/2", "v2" ] }{ "id": 5466, "url": "