get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 65876,
    "url": "http://patches.dpdk.org/api/patches/65876/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200218172240.558516-2-maxime.coquelin@redhat.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": "<20200218172240.558516-2-maxime.coquelin@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200218172240.558516-2-maxime.coquelin@redhat.com",
    "date": "2020-02-18T17:22:39",
    "name": "[1/2] net/vhost: fix Vhost setup error path",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "f5c01963afc6bafbba214b0f0fc0ea59b92ba785",
    "submitter": {
        "id": 512,
        "url": "http://patches.dpdk.org/api/people/512/?format=api",
        "name": "Maxime Coquelin",
        "email": "maxime.coquelin@redhat.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/20200218172240.558516-2-maxime.coquelin@redhat.com/mbox/",
    "series": [
        {
            "id": 8590,
            "url": "http://patches.dpdk.org/api/series/8590/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8590",
            "date": "2020-02-18T17:22:38",
            "name": "Fix Vhost PMD setup",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/8590/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/65876/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/65876/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 60498A054F;\n\tTue, 18 Feb 2020 18:24:13 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 1006B1C001;\n\tTue, 18 Feb 2020 18:24:08 +0100 (CET)",
            "from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com\n [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 035D81C000\n for <dev@dpdk.org>; Tue, 18 Feb 2020 18:24:06 +0100 (CET)",
            "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id\n us-mta-45-V-zyNwZlOUW3d5SeX59Naw-1; Tue, 18 Feb 2020 12:24:03 -0500",
            "from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com\n [10.5.11.15])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 72DF8800D48;\n Tue, 18 Feb 2020 17:24:02 +0000 (UTC)",
            "from localhost.localdomain (ovpn-112-45.ams2.redhat.com\n [10.36.112.45])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 8A4C22CC39;\n Tue, 18 Feb 2020 17:24:00 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1582046646;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=hx48P68VGw11SBRB3/eaLVMR3MnNl8z9dJXDkoXOBEY=;\n b=OrZA/kaEw3pdRwzP4+WJzsrP+BS5IYw44+UFAceLeg1iTW9lYn1YmY4BjNLr+9k5TM6VVC\n bHRr5s/fSLkzkY1jbeNMnwpVJi+nfjiUdkRWWXojX2qZllWNQaDMlM2lgCvQ1ks7TjWVhZ\n N1+QlhzqxNHn84XQybXXW60luvnoiD8=",
        "From": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "To": "dev@dpdk.org, oda@valinux.co.jp, yinan.wang@intel.com,\n tiwei.bie@intel.com,\n amorenoz@redhat.com, david.marchand@redhat.com",
        "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "Date": "Tue, 18 Feb 2020 18:22:39 +0100",
        "Message-Id": "<20200218172240.558516-2-maxime.coquelin@redhat.com>",
        "In-Reply-To": "<20200218172240.558516-1-maxime.coquelin@redhat.com>",
        "References": "<20200218172240.558516-1-maxime.coquelin@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.15",
        "X-MC-Unique": "V-zyNwZlOUW3d5SeX59Naw-1",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Type": "text/plain; charset=US-ASCII",
        "Content-Transfer-Encoding": "quoted-printable",
        "Subject": "[dpdk-dev] [PATCH 1/2] net/vhost: fix Vhost setup error path",
        "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "If for some reason vhost_driver_setup() fails, the list\nelement for the device may be freed without being removed\nfrom the internal list of devices.\n\nThis patch fixes all the error paths, by unregistering the\ndevice from Vhost library it has been registered, remove\nthe device from the list, reset device vring_state pointer\nfrom the global table and only free vring state if it had\nbeen allocated.\n\nFixes: 3d01b759d267 (\"net/vhost: delay driver setup\")\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\nReviewed-by: David Marchand <david.marchand@redhat.com>\n---\n drivers/net/vhost/rte_eth_vhost.c | 21 ++++++++++++++-------\n 1 file changed, 14 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c\nindex 90263ae77c..4a7b1b608c 100644\n--- a/drivers/net/vhost/rte_eth_vhost.c\n+++ b/drivers/net/vhost/rte_eth_vhost.c\n@@ -878,12 +878,12 @@ vhost_driver_setup(struct rte_eth_dev *eth_dev)\n \n \tlist = rte_zmalloc_socket(name, sizeof(*list), 0, numa_node);\n \tif (list == NULL)\n-\t\tgoto error;\n+\t\treturn -1;\n \n \tvring_state = rte_zmalloc_socket(name, sizeof(*vring_state),\n \t\t\t\t\t 0, numa_node);\n \tif (vring_state == NULL)\n-\t\tgoto error;\n+\t\tgoto free_list;\n \n \tlist->eth_dev = eth_dev;\n \tpthread_mutex_lock(&internal_list_lock);\n@@ -894,30 +894,37 @@ vhost_driver_setup(struct rte_eth_dev *eth_dev)\n \tvring_states[eth_dev->data->port_id] = vring_state;\n \n \tif (rte_vhost_driver_register(internal->iface_name, internal->flags))\n-\t\tgoto error;\n+\t\tgoto list_remove;\n \n \tif (internal->disable_flags) {\n \t\tif (rte_vhost_driver_disable_features(internal->iface_name,\n \t\t\t\t\t\t      internal->disable_flags))\n-\t\t\tgoto error;\n+\t\t\tgoto drv_unreg;\n \t}\n \n \tif (rte_vhost_driver_callback_register(internal->iface_name,\n \t\t\t\t\t       &vhost_ops) < 0) {\n \t\tVHOST_LOG(ERR, \"Can't register callbacks\\n\");\n-\t\tgoto error;\n+\t\tgoto drv_unreg;\n \t}\n \n \tif (rte_vhost_driver_start(internal->iface_name) < 0) {\n \t\tVHOST_LOG(ERR, \"Failed to start driver for %s\\n\",\n \t\t\t  internal->iface_name);\n-\t\tgoto error;\n+\t\tgoto drv_unreg;\n \t}\n \n \treturn 0;\n \n-error:\n+drv_unreg:\n+\trte_vhost_driver_unregister(internal->iface_name);\n+list_remove:\n+\tvring_states[eth_dev->data->port_id] = NULL;\n+\tpthread_mutex_lock(&internal_list_lock);\n+\tTAILQ_REMOVE(&internal_list, list, next);\n+\tpthread_mutex_unlock(&internal_list_lock);\n \trte_free(vring_state);\n+free_list:\n \trte_free(list);\n \n \treturn -1;\n",
    "prefixes": [
        "1/2"
    ]
}