get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 73229,
    "url": "https://patches.dpdk.org/api/patches/73229/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200706112452.1474533-3-amorenoz@redhat.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": "<20200706112452.1474533-3-amorenoz@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200706112452.1474533-3-amorenoz@redhat.com",
    "date": "2020-07-06T11:24:46",
    "name": "[v3,2/8] vhost: refactor Virtio ready check",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "8a4b8281d6adc7c6bc5dcdb88bd9146cd8384de8",
    "submitter": {
        "id": 1397,
        "url": "https://patches.dpdk.org/api/people/1397/?format=api",
        "name": "Adrian Moreno",
        "email": "amorenoz@redhat.com"
    },
    "delegate": {
        "id": 2642,
        "url": "https://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200706112452.1474533-3-amorenoz@redhat.com/mbox/",
    "series": [
        {
            "id": 10810,
            "url": "https://patches.dpdk.org/api/series/10810/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10810",
            "date": "2020-07-06T11:24:45",
            "name": "vhost: improve Vhost/vDPA device init",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/10810/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/73229/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/73229/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 D68F7A00C5;\n\tMon,  6 Jul 2020 13:25:36 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id F05F81DA2A;\n\tMon,  6 Jul 2020 13:25:21 +0200 (CEST)",
            "from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com\n [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id CDB861D99D\n for <dev@dpdk.org>; Mon,  6 Jul 2020 13:25:20 +0200 (CEST)",
            "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-176-Y6EMt-WfP9aiv2eLVXl9Wg-1; Mon, 06 Jul 2020 07:25:18 -0400",
            "from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com\n [10.5.11.12])\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 178E2107ACCD;\n Mon,  6 Jul 2020 11:25:17 +0000 (UTC)",
            "from amorenoz.users.ipa.redhat.com (ovpn-112-91.ams2.redhat.com\n [10.36.112.91])\n by smtp.corp.redhat.com (Postfix) with ESMTP id CF48860CC0;\n Mon,  6 Jul 2020 11:25:12 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1594034720;\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=sAO2YIBC8xHEOuVbe6RZikpOFwg/qMmm0vJ7hF+s9VU=;\n b=TCjMfRP6d8Xi8enkCjzD3sk16klbjCgkKtxuxUtBK0kevmpO7UTTYoRl+fuiHuLcXAC18i\n eUrrNXW2bWDUh+80a9b19yFda6J0mt/MxiVV4fK6Ql4dB8bPVvKjOV6DKrP7pmgJVmPGWQ\n tbH62tUtifbsWYeyX11Byk+O4r4HkV8=",
        "X-MC-Unique": "Y6EMt-WfP9aiv2eLVXl9Wg-1",
        "From": "Adrian Moreno <amorenoz@redhat.com>",
        "To": "dev@dpdk.org, chenbo.xia@intel.com, xiaolong.ye@intel.com,\n shahafs@mellanox.com, matan@mellanox.com, maxime.coquelin@redhat.com,\n xiao.w.wang@intel.com, viacheslavo@mellanox.com",
        "Cc": "jasowang@redhat.com,\n\tlulu@redhat.com",
        "Date": "Mon,  6 Jul 2020 13:24:46 +0200",
        "Message-Id": "<20200706112452.1474533-3-amorenoz@redhat.com>",
        "In-Reply-To": "<20200706112452.1474533-1-amorenoz@redhat.com>",
        "References": "<20200706112452.1474533-1-amorenoz@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.12",
        "Authentication-Results": "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=amorenoz@redhat.com",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Type": "text/plain; charset=US-ASCII",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 2/8] vhost: refactor Virtio ready check",
        "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": "From: Maxime Coquelin <maxime.coquelin@redhat.com>\n\nThis patch is a small refactoring, as preliminary work\nfor adding support to Virtio status support.\n\nNo functionnal change here.\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n lib/librte_vhost/vhost.c      |  1 +\n lib/librte_vhost/vhost_user.c | 33 +++++++++++++++++++++------------\n 2 files changed, 22 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c\nindex 0d822d6a3..aa1424261 100644\n--- a/lib/librte_vhost/vhost.c\n+++ b/lib/librte_vhost/vhost.c\n@@ -710,6 +710,7 @@ vhost_enable_dequeue_zero_copy(int vid)\n \t\treturn;\n \n \tdev->dequeue_zero_copy = 1;\n+\tVHOST_LOG_CONFIG(INFO, \"dequeue zero copy is enabled\\n\");\n }\n \n void\ndiff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c\nindex 5750dde6d..ff8b1752b 100644\n--- a/lib/librte_vhost/vhost_user.c\n+++ b/lib/librte_vhost/vhost_user.c\n@@ -1337,6 +1337,9 @@ virtio_is_ready(struct virtio_net *dev)\n \tstruct vhost_virtqueue *vq;\n \tuint32_t i;\n \n+\tif (dev->flags & VIRTIO_DEV_READY)\n+\t\treturn 1;\n+\n \tif (dev->nr_vring < VIRTIO_DEV_NUM_VQS_TO_BE_READY)\n \t\treturn 0;\n \n@@ -1347,6 +1350,8 @@ virtio_is_ready(struct virtio_net *dev)\n \t\t\treturn 0;\n \t}\n \n+\tdev->flags |= VIRTIO_DEV_READY;\n+\n \tif (!(dev->flags & VIRTIO_DEV_RUNNING))\n \t\tVHOST_LOG_CONFIG(INFO,\n \t\t\t\"virtio is now ready for processing.\\n\");\n@@ -2825,28 +2830,32 @@ vhost_user_msg_handler(int vid, int fd)\n \t}\n \n \n-\tif (!(dev->flags & VIRTIO_DEV_READY) && virtio_is_ready(dev)) {\n-\t\tdev->flags |= VIRTIO_DEV_READY;\n+\tif (!virtio_is_ready(dev))\n+\t\tgoto out;\n \n-\t\tif (!(dev->flags & VIRTIO_DEV_RUNNING)) {\n-\t\t\tif (dev->dequeue_zero_copy) {\n-\t\t\t\tVHOST_LOG_CONFIG(INFO,\n-\t\t\t\t\t\t\"dequeue zero copy is enabled\\n\");\n-\t\t\t}\n+\t/*\n+\t * Virtio is now ready. If not done already, it is time\n+\t * to notify the application it can process the rings and\n+\t * configure the vDPA device if present.\n+\t */\n \n-\t\t\tif (dev->notify_ops->new_device(dev->vid) == 0)\n-\t\t\t\tdev->flags |= VIRTIO_DEV_RUNNING;\n-\t\t}\n+\tif (!(dev->flags & VIRTIO_DEV_RUNNING)) {\n+\t\tif (dev->notify_ops->new_device(dev->vid) == 0)\n+\t\t\tdev->flags |= VIRTIO_DEV_RUNNING;\n \t}\n \n \tvdpa_dev = dev->vdpa_dev;\n-\tif (vdpa_dev && virtio_is_ready(dev) &&\n-\t    !(dev->flags & VIRTIO_DEV_VDPA_CONFIGURED)) {\n+\tif (!vdpa_dev)\n+\t\tgoto out;\n+\n+\tif (!(dev->flags & VIRTIO_DEV_VDPA_CONFIGURED)) {\n \t\tif (vdpa_dev->ops->dev_conf)\n \t\t\tvdpa_dev->ops->dev_conf(dev->vid);\n+\n \t\tdev->flags |= VIRTIO_DEV_VDPA_CONFIGURED;\n \t}\n \n+out:\n \treturn 0;\n }\n \n",
    "prefixes": [
        "v3",
        "2/8"
    ]
}