get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/6545/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 6545,
    "url": "http://patches.dpdk.org/api/patches/6545/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1437491784-26676-2-git-send-email-bernard.iremonger@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": "<1437491784-26676-2-git-send-email-bernard.iremonger@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1437491784-26676-2-git-send-email-bernard.iremonger@intel.com",
    "date": "2015-07-21T15:16:22",
    "name": "[dpdk-dev,v6,1/3] bonding: add support for PCI Port Hotplug",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "b90616f52bf44f8b525652ca03a2bc16da49d6d1",
    "submitter": {
        "id": 91,
        "url": "http://patches.dpdk.org/api/people/91/?format=api",
        "name": "Iremonger, Bernard",
        "email": "bernard.iremonger@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1437491784-26676-2-git-send-email-bernard.iremonger@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/6545/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/6545/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 9EEBEC326;\n\tTue, 21 Jul 2015 17:16:47 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id F058C11A4\n\tfor <dev@dpdk.org>; Tue, 21 Jul 2015 17:16:45 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga103.fm.intel.com with ESMTP; 21 Jul 2015 08:16:29 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby FMSMGA003.fm.intel.com with ESMTP; 21 Jul 2015 08:16:28 -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\tt6LFGR37014018; Tue, 21 Jul 2015 16:16:27 +0100",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id t6LFGRJl026728;\n\tTue, 21 Jul 2015 16:16:27 +0100",
            "(from bairemon@localhost)\n\tby sivswdev01.ir.intel.com with  id t6LFGRjS026724;\n\tTue, 21 Jul 2015 16:16:27 +0100"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.15,516,1432623600\"; d=\"scan'208\";a=\"527761646\"",
        "From": "Bernard Iremonger <bernard.iremonger@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Tue, 21 Jul 2015 16:16:22 +0100",
        "Message-Id": "<1437491784-26676-2-git-send-email-bernard.iremonger@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1437491784-26676-1-git-send-email-bernard.iremonger@intel.com>",
        "References": "<PATCH>\n\t<1437491784-26676-1-git-send-email-bernard.iremonger@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v6 1/3] bonding: add support for 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 rte_dev_uninit_t() function for the link bonding pmd.\n\nSigned-off-by: Bernard Iremonger <bernard.iremonger@intel.com>\n---\n drivers/net/bonding/rte_eth_bond.h           | 13 ++++-\n drivers/net/bonding/rte_eth_bond_api.c       | 78 ++++++++++++++++++----------\n drivers/net/bonding/rte_eth_bond_pmd.c       | 23 +++++++-\n drivers/net/bonding/rte_eth_bond_private.h   |  7 ++-\n drivers/net/bonding/rte_eth_bond_version.map |  1 +\n 5 files changed, 90 insertions(+), 32 deletions(-)",
    "diff": "diff --git a/drivers/net/bonding/rte_eth_bond.h b/drivers/net/bonding/rte_eth_bond.h\nindex d688fc3..8efbf07 100644\n--- a/drivers/net/bonding/rte_eth_bond.h\n+++ b/drivers/net/bonding/rte_eth_bond.h\n@@ -1,7 +1,7 @@\n /*-\n  *   BSD LICENSE\n  *\n- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+ *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.\n  *   All rights reserved.\n  *\n  *   Redistribution and use in source and binary forms, with or without\n@@ -131,6 +131,17 @@ int\n rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id);\n \n /**\n+ * Free a bonded rte_eth_dev device\n+ *\n+ * @param name\t\t\tName of the link bonding device.\n+ *\n+ * @return\n+ *\t0 on success, negative value otherwise\n+ */\n+int\n+rte_eth_bond_free(const char *name);\n+\n+/**\n  * Add a rte_eth_dev device as a slave to the bonded device\n  *\n  * @param bonded_port_id\tPort ID of bonded device.\ndiff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c\nindex f602658..61ae7ef 100644\n--- a/drivers/net/bonding/rte_eth_bond_api.c\n+++ b/drivers/net/bonding/rte_eth_bond_api.c\n@@ -1,7 +1,7 @@\n /*-\n  *   BSD LICENSE\n  *\n- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+ *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.\n  *   All rights reserved.\n  *\n  *   Redistribution and use in source and binary forms, with or without\n@@ -163,7 +163,22 @@ number_of_sockets(void)\n \treturn ++sockets;\n }\n \n-const char *pmd_bond_driver_name = \"Link Bonding PMD\";\n+const char pmd_bond_driver_name[] = \"rte_bond_pmd\";\n+\n+static struct rte_pci_id pci_id_table = {\n+\t.device_id = PCI_ANY_ID,\n+\t.subsystem_device_id = PCI_ANY_ID,\n+\t.vendor_id = PCI_ANY_ID,\n+\t.subsystem_vendor_id = PCI_ANY_ID,\n+};\n+\n+static struct eth_driver rte_bond_pmd = {\n+\t.pci_drv = {\n+\t\t.name = pmd_bond_driver_name,\n+\t\t.drv_flags = RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_DETACHABLE,\n+\t\t.id_table = &pci_id_table,\n+\t},\n+};\n \n int\n rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id)\n@@ -171,9 +186,8 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id)\n \tstruct rte_pci_device *pci_dev = NULL;\n \tstruct bond_dev_private *internals = NULL;\n \tstruct rte_eth_dev *eth_dev = NULL;\n-\tstruct eth_driver *eth_drv = NULL;\n \tstruct rte_pci_driver *pci_drv = NULL;\n-\tstruct rte_pci_id *pci_id_table = NULL;\n+\n \t/* now do all data allocation - for eth_dev structure, dummy pci driver\n \t * and internal (private) data\n \t */\n@@ -195,26 +209,7 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id)\n \t\tgoto err;\n \t}\n \n-\teth_drv = rte_zmalloc_socket(name, sizeof(*eth_drv), 0, socket_id);\n-\tif (eth_drv == NULL) {\n-\t\tRTE_BOND_LOG(ERR, \"Unable to malloc eth_drv on socket\");\n-\t\tgoto err;\n-\t}\n-\n-\tpci_drv = &eth_drv->pci_drv;\n-\n-\tpci_id_table = rte_zmalloc_socket(name, sizeof(*pci_id_table), 0, socket_id);\n-\tif (pci_id_table == NULL) {\n-\t\tRTE_BOND_LOG(ERR, \"Unable to malloc pci_id_table on socket\");\n-\t\tgoto err;\n-\t}\n-\tpci_id_table->device_id = PCI_ANY_ID;\n-\tpci_id_table->subsystem_device_id = PCI_ANY_ID;\n-\tpci_id_table->vendor_id = PCI_ANY_ID;\n-\tpci_id_table->subsystem_vendor_id = PCI_ANY_ID;\n-\n-\tpci_drv->id_table = pci_id_table;\n-\tpci_drv->drv_flags = RTE_PCI_DRV_INTR_LSC;\n+\tpci_drv = &rte_bond_pmd.pci_drv;\n \n \tinternals = rte_zmalloc_socket(name, sizeof(*internals), 0, socket_id);\n \tif (internals == NULL) {\n@@ -233,7 +228,7 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id)\n \tpci_drv->name = pmd_bond_driver_name;\n \tpci_dev->driver = pci_drv;\n \n-\teth_dev->driver = eth_drv;\n+\teth_dev->driver = &rte_bond_pmd;\n \teth_dev->data->dev_private = internals;\n \teth_dev->data->nb_rx_queues = (uint16_t)1;\n \teth_dev->data->nb_tx_queues = (uint16_t)1;\n@@ -289,13 +284,42 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id)\n \n err:\n \trte_free(pci_dev);\n-\trte_free(pci_id_table);\n-\trte_free(eth_drv);\n \trte_free(internals);\n+\trte_free(eth_dev->data->mac_addrs);\n \n \treturn -1;\n }\n \n+int\n+rte_eth_bond_free(const char *name)\n+{\n+\tstruct rte_eth_dev *eth_dev = NULL;\n+\n+\t/* now free all data allocation - for eth_dev structure,\n+\t * dummy pci driver and internal (private) data\n+\t */\n+\n+\t/* find an ethdev entry */\n+\teth_dev = rte_eth_dev_allocated(name);\n+\tif (eth_dev == NULL)\n+\t\treturn -ENODEV;\n+\n+\tif (eth_dev->data->dev_started == 1)\n+\t\tbond_ethdev_stop(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+\trte_free(eth_dev->pci_dev);\n+\trte_free(eth_dev->data->dev_private);\n+\trte_free(eth_dev->data->mac_addrs);\n+\n+\trte_eth_dev_release_port(eth_dev);\n+\n+\treturn 0;\n+}\n+\n static int\n __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)\n {\ndiff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c\nindex 9cafe65..cad8f3c 100644\n--- a/drivers/net/bonding/rte_eth_bond_pmd.c\n+++ b/drivers/net/bonding/rte_eth_bond_pmd.c\n@@ -1,7 +1,7 @@\n /*-\n  *   BSD LICENSE\n  *\n- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+ *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.\n  *   All rights reserved.\n  *\n  *   Redistribution and use in source and binary forms, with or without\n@@ -1512,7 +1512,7 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev)\n \treturn 0;\n }\n \n-static void\n+void\n bond_ethdev_stop(struct rte_eth_dev *eth_dev)\n {\n \tstruct bond_dev_private *internals = eth_dev->data->dev_private;\n@@ -2042,6 +2042,24 @@ parse_error:\n \treturn -1;\n }\n \n+static int\n+bond_uninit(const char *name)\n+{\n+\tint  ret;\n+\n+\tif (name == NULL)\n+\t\treturn -EINVAL;\n+\n+\tRTE_LOG(INFO, EAL, \"Uninitializing pmd_bond for %s\\n\", name);\n+\n+\t/* free link bonding eth device */\n+\tret = rte_eth_bond_free(name);\n+\tif (ret < 0)\n+\t\tRTE_LOG(ERR, EAL, \"Failed to free %s\\n\", name);\n+\n+\treturn ret;\n+}\n+\n /* this part will resolve the slave portids after all the other pdev and vdev\n  * have been allocated */\n static int\n@@ -2268,6 +2286,7 @@ static struct rte_driver bond_drv = {\n \t.name = \"eth_bond\",\n \t.type = PMD_VDEV,\n \t.init = bond_init,\n+\t.uninit = bond_uninit,\n };\n \n PMD_REGISTER_DRIVER(bond_drv);\ndiff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h\nindex c531e87..205c642 100644\n--- a/drivers/net/bonding/rte_eth_bond_private.h\n+++ b/drivers/net/bonding/rte_eth_bond_private.h\n@@ -1,7 +1,7 @@\n /*-\n  *   BSD LICENSE\n  *\n- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+ *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.\n  *   All rights reserved.\n  *\n  *   Redistribution and use in source and binary forms, with or without\n@@ -62,7 +62,7 @@\n \n extern const char *pmd_bond_init_valid_arguments[];\n \n-extern const char *pmd_bond_driver_name;\n+extern const char pmd_bond_driver_name[];\n \n /** Port Queue Mapping Structure */\n struct bond_rx_queue {\n@@ -284,4 +284,7 @@ bond_tlb_enable(struct bond_dev_private *internals);\n void\n bond_tlb_activate_slave(struct bond_dev_private *internals);\n \n+void\n+bond_ethdev_stop(struct rte_eth_dev *eth_dev);\n+\n #endif\ndiff --git a/drivers/net/bonding/rte_eth_bond_version.map b/drivers/net/bonding/rte_eth_bond_version.map\nindex 135999e..5519e11 100644\n--- a/drivers/net/bonding/rte_eth_bond_version.map\n+++ b/drivers/net/bonding/rte_eth_bond_version.map\n@@ -5,6 +5,7 @@ DPDK_2.0 {\n \trte_eth_bond_8023ad_setup;\n \trte_eth_bond_active_slaves_get;\n \trte_eth_bond_create;\n+\trte_eth_bond_free;\n \trte_eth_bond_link_monitoring_set;\n \trte_eth_bond_mac_address_reset;\n \trte_eth_bond_mac_address_set;\n",
    "prefixes": [
        "dpdk-dev",
        "v6",
        "1/3"
    ]
}