get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 65352,
    "url": "https://patches.dpdk.org/api/patches/65352/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200129193310.9157-1-eperezma@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": "<20200129193310.9157-1-eperezma@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200129193310.9157-1-eperezma@redhat.com",
    "date": "2020-01-29T19:33:10",
    "name": "vhost: flush shadow tx if there is no more packets",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "d0369ecb932606a4fe3fd15064e1bfb0ab668927",
    "submitter": {
        "id": 1579,
        "url": "https://patches.dpdk.org/api/people/1579/?format=api",
        "name": "Eugenio Perez Martin",
        "email": "eperezma@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/20200129193310.9157-1-eperezma@redhat.com/mbox/",
    "series": [
        {
            "id": 8348,
            "url": "https://patches.dpdk.org/api/series/8348/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=8348",
            "date": "2020-01-29T19:33:10",
            "name": "vhost: flush shadow tx if there is no more packets",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/8348/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/65352/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/65352/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 01FE8A052F;\n\tWed, 29 Jan 2020 20:33:22 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id ED7B11C043;\n\tWed, 29 Jan 2020 20:33:21 +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 507571C035\n for <dev@dpdk.org>; Wed, 29 Jan 2020 20:33:20 +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-211-65qMBLsnOpWzTGMt9VG_Aw-1; Wed, 29 Jan 2020 14:33:17 -0500",
            "from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com\n [10.5.11.16])\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 6495013E6;\n Wed, 29 Jan 2020 19:33:16 +0000 (UTC)",
            "from eperezma.remote.csb (ovpn-117-72.ams2.redhat.com\n [10.36.117.72])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 905E05C541;\n Wed, 29 Jan 2020 19:33:12 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1580326399;\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=Z0k+Olqu72hrpWfcWB/byrTv73diRtV6VCqxdtb3ORg=;\n b=GJZAWfhhxQ4po9w+PFTrf1eD4RFzSod+7yFv1IodT3tR815KBVgJaXrrjzXRtMQ/I05VSa\n w6LiX67zI1GhJdluCa1IusECrFmTI/cQHEqEZ1EjjZpPvtKTNQSdpZl0mU6AEdpTm8WhPF\n ZISeVcnQDIlkYCX5mmBGvFnnPzkKk5Y=",
        "From": "=?utf-8?q?Eugenio_P=C3=A9rez?= <eperezma@redhat.com>",
        "To": "dev@dpdk.org,\n\tyong.liu@intel.com",
        "Cc": "Maxime Coquelin <mcoqueli@redhat.com>,\n Adrian Moreno Zapata <amorenoz@redhat.com>,\n Jason Wang <jasowang@redhat.com>, \"Michael S. Tsirkin\" <mst@redhat.com>",
        "Date": "Wed, 29 Jan 2020 20:33:10 +0100",
        "Message-Id": "<20200129193310.9157-1-eperezma@redhat.com>",
        "In-Reply-To": "<bug-383-3@http.bugs.dpdk.org/>",
        "References": "<bug-383-3@http.bugs.dpdk.org/>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.16",
        "X-MC-Unique": "65qMBLsnOpWzTGMt9VG_Aw-1",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "quoted-printable",
        "Subject": "[dpdk-dev] [PATCH] vhost: flush shadow tx if there is no more\n\tpackets",
        "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": "The current implementation of vhost_net in packed vring tries to fill\nthe shadow vector before send any actual changes to the guest. While\nthis can be beneficial for the throughput, it conflicts with some\nbufferfloats methods like the linux kernel napi, that stops\ntransmitting packets if there are too much bytes/buffers in the\ndriver.\n\nTo solve it, we flush the shadow packets at the end of\nvirtio_dev_tx_packed if we have starved the vring, i.e., the next\nbuffer is not available for the device.\n\nSince this last check can be expensive because of the atomic, we only\ncheck it if we have not obtained the expected (count) packets. If it\nhappens to obtain \"count\" packets and there is no more available\npackets the caller needs to keep call virtio_dev_tx_packed again.\n\nSigned-off-by: Eugenio Pérez <eperezma@redhat.com>\n---\n lib/librte_vhost/virtio_net.c | 27 ++++++++++++++++++++++++++-\n 1 file changed, 26 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c\nindex 21c311732..ac2842b2d 100644\n--- a/lib/librte_vhost/virtio_net.c\n+++ b/lib/librte_vhost/virtio_net.c\n@@ -2133,6 +2133,20 @@ virtio_dev_tx_packed_zmbuf(struct virtio_net *dev,\n \treturn pkt_idx;\n }\n \n+static __rte_always_inline bool\n+next_desc_is_avail(const struct vhost_virtqueue *vq)\n+{\n+\tbool wrap_counter = vq->avail_wrap_counter;\n+\tuint16_t next_used_idx = vq->last_used_idx + 1;\n+\n+\tif (next_used_idx >= vq->size) {\n+\t\tnext_used_idx -= vq->size;\n+\t\twrap_counter ^= 1;\n+\t}\n+\n+\treturn desc_is_avail(&vq->desc_packed[next_used_idx], wrap_counter);\n+}\n+\n static __rte_noinline uint16_t\n virtio_dev_tx_packed(struct virtio_net *dev,\n \t\t     struct vhost_virtqueue *vq,\n@@ -2165,9 +2179,20 @@ virtio_dev_tx_packed(struct virtio_net *dev,\n \n \t} while (remained);\n \n-\tif (vq->shadow_used_idx)\n+\tif (vq->shadow_used_idx) {\n \t\tdo_data_copy_dequeue(vq);\n \n+\t\tif (remained && !next_desc_is_avail(vq)) {\n+\t\t\t/*\n+\t\t\t * The guest may be waiting to TX some buffers to\n+\t\t\t * enqueue more to avoid bufferfloat, so we try to\n+\t\t\t * reduce latency here.\n+\t\t\t */\n+\t\t\tvhost_flush_dequeue_shadow_packed(dev, vq);\n+\t\t\tvhost_vring_call_packed(dev, vq);\n+\t\t}\n+\t}\n+\n \treturn pkt_idx;\n }\n \n",
    "prefixes": []
}