get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 8086,
    "url": "https://patches.dpdk.org/api/patches/8086/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1445961794-30528-2-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": "<1445961794-30528-2-git-send-email-bernard.iremonger@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1445961794-30528-2-git-send-email-bernard.iremonger@intel.com",
    "date": "2015-10-27T16:03:13",
    "name": "[dpdk-dev,v2,1/2] xenvirt: add support for Port Hotplug",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "1b66fbe5c87d24f93c9bce2327c88eb0e6c5be48",
    "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/1445961794-30528-2-git-send-email-bernard.iremonger@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/8086/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/8086/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 8F8E88DA1;\n\tTue, 27 Oct 2015 17:05:28 +0100 (CET)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 5FD38567C\n\tfor <dev@dpdk.org>; Tue, 27 Oct 2015 17:05:26 +0100 (CET)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga102.jf.intel.com with ESMTP; 27 Oct 2015 09:03:22 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga003.jf.intel.com with ESMTP; 27 Oct 2015 09:03:21 -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\tt9RG3Kng002242; Tue, 27 Oct 2015 16:03:20 GMT",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id t9RG3KTL030577;\n\tTue, 27 Oct 2015 16:03:20 GMT",
            "(from bairemon@localhost)\n\tby sivswdev01.ir.intel.com with  id t9RG3K02030571;\n\tTue, 27 Oct 2015 16:03:20 GMT"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,205,1444719600\"; d=\"scan'208\";a=\"672800733\"",
        "From": "Bernard Iremonger <bernard.iremonger@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Tue, 27 Oct 2015 16:03:13 +0000",
        "Message-Id": "<1445961794-30528-2-git-send-email-bernard.iremonger@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1445961794-30528-1-git-send-email-bernard.iremonger@intel.com>",
        "References": "<PATCH v2>\n\t<1445961794-30528-1-git-send-email-bernard.iremonger@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 1/2] xenvirt: add support for 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": "update release notes.\n\nSigned-off-by: Bernard Iremonger <bernard.iremonger@intel.com>\n---\n doc/guides/rel_notes/release_2_2.rst  |  2 ++\n drivers/net/xenvirt/rte_eth_xenvirt.c | 49 ++++++++++++++++++++++++++++++++++-\n drivers/net/xenvirt/rte_xen_lib.c     | 26 ++++++++++++++++---\n drivers/net/xenvirt/rte_xen_lib.h     |  5 +++-\n 4 files changed, 76 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/doc/guides/rel_notes/release_2_2.rst b/doc/guides/rel_notes/release_2_2.rst\nindex 455b5a2..c88392b 100644\n--- a/doc/guides/rel_notes/release_2_2.rst\n+++ b/doc/guides/rel_notes/release_2_2.rst\n@@ -13,6 +13,8 @@ New Features\n \n   * This change required modifications to librte_ether and all vdev and pdev PMD's.\n \n+* **Added Port Hotplug support to xenvirt PMD.**\n+\n Resolved Issues\n ---------------\n \ndiff --git a/drivers/net/xenvirt/rte_eth_xenvirt.c b/drivers/net/xenvirt/rte_eth_xenvirt.c\nindex 1b13758..084a753 100644\n--- a/drivers/net/xenvirt/rte_eth_xenvirt.c\n+++ b/drivers/net/xenvirt/rte_eth_xenvirt.c\n@@ -661,7 +661,7 @@ eth_dev_xenvirt_create(const char *name, const char *params,\n \n \teth_dev->data = data;\n \teth_dev->dev_ops = &ops;\n-\teth_dev->data->dev_flags = 0;\n+\teth_dev->data->dev_flags = RTE_PCI_DRV_DETACHABLE;\n \teth_dev->data->kdrv = RTE_KDRV_NONE;\n \teth_dev->data->drv_name = NULL;\n \teth_dev->driver = NULL;\n@@ -683,6 +683,38 @@ err:\n }\n \n \n+static int\n+eth_dev_xenvirt_free(const char *name, const unsigned numa_node)\n+{\n+\tstruct rte_eth_dev *eth_dev = NULL;\n+\n+\tRTE_LOG(DEBUG, PMD,\n+\t\t\"Free virtio rings backed ethdev on numa socket %u\\n\",\n+\t\tnuma_node);\n+\n+\t/* find an ethdev entry */\n+\teth_dev = rte_eth_dev_allocated(name);\n+\tif (eth_dev == NULL)\n+\t\treturn -1;\n+\n+\tif (eth_dev->data->dev_started == 1) {\n+\t\teth_dev_stop(eth_dev);\n+\t\teth_dev_close(eth_dev);\n+\t}\n+\n+\teth_dev->rx_pkt_burst = NULL;\n+\teth_dev->tx_pkt_burst = NULL;\n+\teth_dev->dev_ops = NULL;\n+\n+\trte_free(eth_dev->data);\n+\trte_free(eth_dev->data->dev_private);\n+\trte_free(eth_dev->data->mac_addrs);\n+\n+\tvirtio_idx--;\n+\n+\treturn 0;\n+}\n+\n /*TODO: Support multiple process model */\n static int\n rte_pmd_xenvirt_devinit(const char *name, const char *params)\n@@ -701,10 +733,25 @@ rte_pmd_xenvirt_devinit(const char *name, const char *params)\n \treturn 0;\n }\n \n+static int\n+rte_pmd_xenvirt_devuninit(const char *name)\n+{\n+\teth_dev_xenvirt_free(name, rte_socket_id());\n+\n+\tif (virtio_idx == 0) {\n+\t\tif (xenstore_uninit() != 0)\n+\t\t\tRTE_LOG(ERR, PMD, \"%s: xenstore uninit failed\\n\", __func__);\n+\n+\t\tgntalloc_close();\n+\t}\n+\treturn 0;\n+}\n+\n static struct rte_driver pmd_xenvirt_drv = {\n \t.name = \"eth_xenvirt\",\n \t.type = PMD_VDEV,\n \t.init = rte_pmd_xenvirt_devinit,\n+\t.uninit = rte_pmd_xenvirt_devuninit,\n };\n \n PMD_REGISTER_DRIVER(pmd_xenvirt_drv);\ndiff --git a/drivers/net/xenvirt/rte_xen_lib.c b/drivers/net/xenvirt/rte_xen_lib.c\nindex b3932f0..5900b53 100644\n--- a/drivers/net/xenvirt/rte_xen_lib.c\n+++ b/drivers/net/xenvirt/rte_xen_lib.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@@ -50,6 +50,7 @@\n \n #include <rte_common.h>\n #include <rte_string_fns.h>\n+#include <rte_malloc.h>\n \n #include \"rte_xen_lib.h\"\n \n@@ -72,6 +73,8 @@ int gntalloc_fd = -1;\n static char *dompath = NULL;\n /* handle to xenstore read/write operations */\n static struct xs_handle *xs = NULL;\n+/* flag to indicate if xenstore cleanup is required */\n+static bool is_xenstore_cleaned_up;\n \n /*\n  * Reserve a virtual address space.\n@@ -275,7 +278,6 @@ xenstore_init(void)\n {\n \tunsigned int len, domid;\n \tchar *buf;\n-\tstatic int cleanup = 0;\n \tchar *end;\n \n \txs = xs_domain_open();\n@@ -301,16 +303,32 @@ xenstore_init(void)\n \n \txs_transaction_start(xs); /* When to stop transaction */\n \n-\tif (cleanup == 0) {\n+\tif (is_xenstore_cleaned_up == 0) {\n \t\tif (xenstore_cleanup())\n \t\t\treturn -1;\n-\t\tcleanup = 1;\n+\t\tis_xenstore_cleaned_up = 1;\n \t}\n \n \treturn 0;\n }\n \n int\n+xenstore_uninit(void)\n+{\n+\txs_close(xs);\n+\n+\tif (is_xenstore_cleaned_up == 0) {\n+\t\tif (xenstore_cleanup())\n+\t\t\treturn -1;\n+\t\tis_xenstore_cleaned_up = 1;\n+\t}\n+\tfree(dompath);\n+\tdompath = NULL;\n+\n+\treturn 0;\n+}\n+\n+int\n xenstore_write(const char *key_str, const char *val_str)\n {\n \tchar grant_path[PATH_MAX];\ndiff --git a/drivers/net/xenvirt/rte_xen_lib.h b/drivers/net/xenvirt/rte_xen_lib.h\nindex 0ba7148..d973eac 100644\n--- a/drivers/net/xenvirt/rte_xen_lib.h\n+++ b/drivers/net/xenvirt/rte_xen_lib.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@@ -93,6 +93,9 @@ int\n xenstore_init(void);\n \n int\n+xenstore_uninit(void);\n+\n+int\n xenstore_write(const char *key_str, const char *val_str);\n \n int\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "1/2"
    ]
}