get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 42613,
    "url": "http://patches.dpdk.org/api/patches/42613/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1531119413-17298-3-git-send-email-jia.guo@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": "<1531119413-17298-3-git-send-email-jia.guo@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1531119413-17298-3-git-send-email-jia.guo@intel.com",
    "date": "2018-07-09T06:56:52",
    "name": "[v2,2/3] net/i40e: enable hotplug detect in i40e",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "45fffde255741ba21ac5499b1f93b60028f651aa",
    "submitter": {
        "id": 507,
        "url": "http://patches.dpdk.org/api/people/507/?format=api",
        "name": "Guo, Jia",
        "email": "jia.guo@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1531119413-17298-3-git-send-email-jia.guo@intel.com/mbox/",
    "series": [
        {
            "id": 470,
            "url": "http://patches.dpdk.org/api/series/470/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=470",
            "date": "2018-07-09T06:56:50",
            "name": "Enable eal hotplug event detect for i40e/ixgbe",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/470/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/42613/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/42613/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 6E8CF1B1ED;\n\tMon,  9 Jul 2018 08:59:22 +0200 (CEST)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby dpdk.org (Postfix) with ESMTP id CB8991B1ED\n\tfor <dev@dpdk.org>; Mon,  9 Jul 2018 08:59:20 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t08 Jul 2018 23:59:20 -0700",
            "from jeffguo-z170x-ud5.sh.intel.com (HELO localhost.localdomain)\n\t([10.67.104.10])\n\tby orsmga001.jf.intel.com with ESMTP; 08 Jul 2018 23:59:17 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,329,1526367600\"; d=\"scan'208\";a=\"71124484\"",
        "From": "Jeff Guo <jia.guo@intel.com>",
        "To": "stephen@networkplumber.org, bruce.richardson@intel.com,\n\tferruh.yigit@intel.com, konstantin.ananyev@intel.com,\n\tgaetan.rivet@6wind.com, jingjing.wu@intel.com, thomas@monjalon.net,\n\tmotih@mellanox.com, matan@mellanox.com, harry.van.haaren@intel.com,\n\tqi.z.zhang@intel.com, shaopeng.he@intel.com,\n\tbernard.iremonger@intel.com, arybchenko@solarflare.com",
        "Cc": "jblunck@infradead.org, shreyansh.jain@nxp.com, dev@dpdk.org,\n\tjia.guo@intel.com, helin.zhang@intel.com",
        "Date": "Mon,  9 Jul 2018 14:56:52 +0800",
        "Message-Id": "<1531119413-17298-3-git-send-email-jia.guo@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1531119413-17298-1-git-send-email-jia.guo@intel.com>",
        "References": "<1530787185-5915-1-git-send-email-jia.guo@intel.com>\n\t<1531119413-17298-1-git-send-email-jia.guo@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 2/3] net/i40e: enable hotplug detect in i40e",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/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 aim to enable hotplug detect in i40e pmd driver. Firstly it\nset the flags RTE_PCI_DRV_INTR_RMV in drv_flags to announce the hotplug\nability, and then use rte_dev_event_callback_register to register\nthe hotplug event callback to eal. When eal detect the hotplug event,\nit will call the callback to process it, if the event is hotplug remove,\nit will trigger the RTE_ETH_EVENT_INTR_RMV event into ethdev callback\nto let app process the hotplug for the ethdev.\n\nThis is an example for other driver, that if any driver support hotplug\nfeature could be use this way to enable hotplug detect.\n\nSigned-off-by: Jeff Guo <jia.guo@intel.com>\n---\nv2->v1:\nno v1, add hotplug detect in ixgbe for new.\n---\n drivers/net/i40e/i40e_ethdev.c | 46 +++++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 45 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c\nindex 13c5d32..ad4231f 100644\n--- a/drivers/net/i40e/i40e_ethdev.c\n+++ b/drivers/net/i40e/i40e_ethdev.c\n@@ -688,7 +688,7 @@ static int eth_i40e_pci_remove(struct rte_pci_device *pci_dev)\n static struct rte_pci_driver rte_i40e_pmd = {\n \t.id_table = pci_id_i40e_map,\n \t.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC |\n-\t\t     RTE_PCI_DRV_IOVA_AS_VA,\n+\t\t     RTE_PCI_DRV_IOVA_AS_VA | RTE_PCI_DRV_INTR_RMV,\n \t.probe = eth_i40e_pci_probe,\n \t.remove = eth_i40e_pci_remove,\n };\n@@ -1183,6 +1183,47 @@ i40e_aq_debug_write_global_register(struct i40e_hw *hw,\n \treturn i40e_aq_debug_write_register(hw, reg_addr, reg_val, cmd_details);\n }\n \n+static void\n+eth_dev_event_callback(char *device_name, enum rte_dev_event_type type,\n+\t\t       __rte_unused void *arg)\n+{\n+\tuint32_t pid;\n+\n+\tif (type >= RTE_DEV_EVENT_MAX) {\n+\t\tfprintf(stderr, \"%s called upon invalid event %d\\n\",\n+\t\t\t__func__, type);\n+\t\tfflush(stderr);\n+\t}\n+\n+\tswitch (type) {\n+\tcase RTE_DEV_EVENT_REMOVE:\n+\t\tPMD_DRV_LOG(INFO, \"The device: %s has been removed!\\n\",\n+\t\t\t    device_name);\n+\n+\t\tif (!device_name)\n+\t\t\treturn;\n+\n+\t\tfor (pid = 0; pid < RTE_MAX_ETHPORTS; pid++) {\n+\t\t\tif (rte_eth_devices[pid].device) {\n+\t\t\t\tif (!strcmp(device_name,\n+\t\t\t\t    rte_eth_devices[pid].device->name)) {\n+\t\t\t\t\t_rte_eth_dev_callback_process(\n+\t\t\t\t\t\t&rte_eth_devices[pid],\n+\t\t\t\t\t\tRTE_ETH_EVENT_INTR_RMV, NULL);\n+\t\t\t\t\tcontinue;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\t\tbreak;\n+\tcase RTE_DEV_EVENT_ADD:\n+\t\tRTE_LOG(INFO, EAL, \"The device: %s has been added!\\n\",\n+\t\t\tdevice_name);\n+\t\tbreak;\n+\tdefault:\n+\t\tbreak;\n+\t}\n+}\n+\n static int\n eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)\n {\n@@ -1442,6 +1483,9 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)\n \trte_intr_callback_register(intr_handle,\n \t\t\t\t   i40e_dev_interrupt_handler, dev);\n \n+\t/* register the device event callback */\n+\trte_dev_event_callback_register(NULL, eth_dev_event_callback, NULL);\n+\n \t/* configure and enable device interrupt */\n \ti40e_pf_config_irq0(hw, TRUE);\n \ti40e_pf_enable_irq0(hw);\n",
    "prefixes": [
        "v2",
        "2/3"
    ]
}