get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 54400,
    "url": "http://patches.dpdk.org/api/patches/54400/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190605094342.17563-4-tiwei.bie@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": "<20190605094342.17563-4-tiwei.bie@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190605094342.17563-4-tiwei.bie@intel.com",
    "date": "2019-06-05T09:43:40",
    "name": "[3/5] net/virtio: unmap device on initialization error",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "a4385e34cd1e47c394eec7bc5dc5ee5fe6bc7fbf",
    "submitter": {
        "id": 617,
        "url": "http://patches.dpdk.org/api/people/617/?format=api",
        "name": "Tiwei Bie",
        "email": "tiwei.bie@intel.com"
    },
    "delegate": {
        "id": 2642,
        "url": "http://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190605094342.17563-4-tiwei.bie@intel.com/mbox/",
    "series": [
        {
            "id": 4903,
            "url": "http://patches.dpdk.org/api/series/4903/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4903",
            "date": "2019-06-05T09:43:37",
            "name": "virtio: release port upon close",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/4903/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/54400/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/54400/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 66AE91BB0C;\n\tWed,  5 Jun 2019 11:45:10 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 3AA051B9CE;\n\tWed,  5 Jun 2019 11:45:04 +0200 (CEST)",
            "from orsmga006.jf.intel.com ([10.7.209.51])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t05 Jun 2019 02:45:03 -0700",
            "from npg-dpdk-virtio-tbie-2.sh.intel.com ([10.67.104.151])\n\tby orsmga006.jf.intel.com with ESMTP; 05 Jun 2019 02:45:02 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Tiwei Bie <tiwei.bie@intel.com>",
        "To": "maxime.coquelin@redhat.com,\n\tzhihong.wang@intel.com,\n\tdev@dpdk.org",
        "Cc": "stable@dpdk.org",
        "Date": "Wed,  5 Jun 2019 17:43:40 +0800",
        "Message-Id": "<20190605094342.17563-4-tiwei.bie@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190605094342.17563-1-tiwei.bie@intel.com>",
        "References": "<20190605094342.17563-1-tiwei.bie@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 3/5] net/virtio: unmap device on initialization\n\terror",
        "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": "We should unmap the device when we failed to initialize the device.\n\nFixes: 6ba1f63b5ab0 (\"virtio: support specification 1.0\")\nCc: stable@dpdk.org\n\nSigned-off-by: Tiwei Bie <tiwei.bie@intel.com>\n---\n drivers/net/virtio/virtio_ethdev.c | 12 +++++++++---\n drivers/net/virtio/virtio_pci.c    |  1 +\n 2 files changed, 10 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c\nindex a2cedcc87..46d2e4ac6 100644\n--- a/drivers/net/virtio/virtio_ethdev.c\n+++ b/drivers/net/virtio/virtio_ethdev.c\n@@ -1857,17 +1857,23 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)\n \tif (!hw->virtio_user_dev) {\n \t\tret = vtpci_init(RTE_ETH_DEV_TO_PCI(eth_dev), hw);\n \t\tif (ret)\n-\t\t\tgoto out;\n+\t\t\tgoto err_vtpci_init;\n \t}\n \n \t/* reset device and negotiate default features */\n \tret = virtio_init_device(eth_dev, VIRTIO_PMD_DEFAULT_GUEST_FEATURES);\n \tif (ret < 0)\n-\t\tgoto out;\n+\t\tgoto err_virtio_init;\n \n \treturn 0;\n \n-out:\n+err_virtio_init:\n+\tif (!hw->virtio_user_dev) {\n+\t\trte_pci_unmap_device(RTE_ETH_DEV_TO_PCI(eth_dev));\n+\t\tif (!hw->modern)\n+\t\t\trte_pci_ioport_unmap(VTPCI_IO(hw));\n+\t}\n+err_vtpci_init:\n \trte_free(eth_dev->data->mac_addrs);\n \teth_dev->data->mac_addrs = NULL;\n \treturn ret;\ndiff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c\nindex adc02f96a..4468e89cb 100644\n--- a/drivers/net/virtio/virtio_pci.c\n+++ b/drivers/net/virtio/virtio_pci.c\n@@ -678,6 +678,7 @@ vtpci_init(struct rte_pci_device *dev, struct virtio_hw *hw)\n \n \tPMD_INIT_LOG(INFO, \"trying with legacy virtio pci.\");\n \tif (rte_pci_ioport_map(dev, 0, VTPCI_IO(hw)) < 0) {\n+\t\trte_pci_unmap_device(dev);\n \t\tif (dev->kdrv == RTE_KDRV_UNKNOWN &&\n \t\t    (!dev->device.devargs ||\n \t\t     dev->device.devargs->bus !=\n",
    "prefixes": [
        "3/5"
    ]
}