get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 56208,
    "url": "https://patches.dpdk.org/api/patches/56208/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190708171320.38802-2-yong.liu@intel.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": "<20190708171320.38802-2-yong.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190708171320.38802-2-yong.liu@intel.com",
    "date": "2019-07-08T17:13:08",
    "name": "[RFC,01/13] add vhost normal enqueue function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b5b732e9e8c2a96e1951b846b08a600ef76af37c",
    "submitter": {
        "id": 17,
        "url": "https://patches.dpdk.org/api/people/17/?format=api",
        "name": "Marvin Liu",
        "email": "yong.liu@intel.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/20190708171320.38802-2-yong.liu@intel.com/mbox/",
    "series": [
        {
            "id": 5390,
            "url": "https://patches.dpdk.org/api/series/5390/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=5390",
            "date": "2019-07-08T17:13:08",
            "name": "[RFC,01/13] add vhost normal enqueue function",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/5390/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/56208/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/56208/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 9690A5905;\n\tMon,  8 Jul 2019 11:29:53 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 14A3E2F42\n\tfor <dev@dpdk.org>; Mon,  8 Jul 2019 11:29:50 +0200 (CEST)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t08 Jul 2019 02:29:49 -0700",
            "from npg-dpdk-virtual-marvin-dev.sh.intel.com ([10.67.119.142])\n\tby orsmga007.jf.intel.com with ESMTP; 08 Jul 2019 02:29:47 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.63,466,1557212400\"; d=\"scan'208\";a=\"155821628\"",
        "From": "Marvin Liu <yong.liu@intel.com>",
        "To": "tiwei.bie@intel.com,\n\tmaxime.coquelin@redhat.com,\n\tdev@dpdk.org",
        "Cc": "Marvin Liu <yong.liu@intel.com>",
        "Date": "Tue,  9 Jul 2019 01:13:08 +0800",
        "Message-Id": "<20190708171320.38802-2-yong.liu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190708171320.38802-1-yong.liu@intel.com>",
        "References": "<20190708171320.38802-1-yong.liu@intel.com>",
        "Subject": "[dpdk-dev] [RFC PATCH 01/13] add vhost normal enqueue function",
        "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": "Rewrite vhost enqueue function and meanwhile left space for later flush\nenqeueue shadow used descriptors changes.\n\nSigned-off-by: Marvin Liu <yong.liu@intel.com>",
    "diff": "diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c\nindex 5b85b832d..003aec1d4 100644\n--- a/lib/librte_vhost/virtio_net.c\n+++ b/lib/librte_vhost/virtio_net.c\n@@ -774,6 +774,72 @@ copy_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \treturn error;\n }\n \n+/*\n+ * Returns -1 on fail, 0 on success\n+ */\n+static inline int\n+vhost_enqueue_normal_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,\n+\tstruct rte_mbuf *pkt, struct buf_vector *buf_vec,\n+\tuint16_t *nr_descs)\n+{\n+\tuint16_t nr_vec = 0;\n+\n+\tuint16_t avail_idx;\n+\tuint16_t max_tries, tries = 0;\n+\n+\tuint16_t buf_id = 0;\n+\tuint32_t len = 0;\n+\tuint16_t desc_count;\n+\n+\tuint32_t size = pkt->pkt_len + dev->vhost_hlen;\n+\tavail_idx = vq->last_avail_idx;\n+\n+\tif (rxvq_is_mergeable(dev))\n+\t\tmax_tries = vq->size - 1;\n+\telse\n+\t\tmax_tries = 1;\n+\n+\tuint16_t num_buffers = 0;\n+\n+\twhile (size > 0) {\n+\t\t/*\n+\t\t * if we tried all available ring items, and still\n+\t\t * can't get enough buf, it means something abnormal\n+\t\t * happened.\n+\t\t */\n+\t\tif (unlikely(++tries > max_tries))\n+\t\t\treturn -1;\n+\n+\t\tif (unlikely(fill_vec_buf_packed(dev, vq,\n+\t\t\t\t\t\tavail_idx, &desc_count,\n+\t\t\t\t\t\tbuf_vec, &nr_vec,\n+\t\t\t\t\t\t&buf_id, &len,\n+\t\t\t\t\t\tVHOST_ACCESS_RW) < 0)) {\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\tlen = RTE_MIN(len, size);\n+\n+\t\tsize -= len;\n+\n+\t\tavail_idx += desc_count;\n+\t\tif (avail_idx >= vq->size)\n+\t\t\tavail_idx -= vq->size;\n+\n+\t\t*nr_descs += desc_count;\n+\t\tnum_buffers += 1;\n+\t}\n+\n+\tif (copy_mbuf_to_desc(dev, vq, pkt,\n+\t\t\t\t\tbuf_vec, nr_vec,\n+\t\t\t\t\tnum_buffers) < 0) {\n+\t\treturn 0;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+\n static __rte_noinline uint32_t\n virtio_dev_rx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \tstruct rte_mbuf **pkts, uint32_t count)\n@@ -831,6 +897,35 @@ virtio_dev_rx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \treturn pkt_idx;\n }\n \n+static __rte_always_inline uint16_t\n+virtio_dev_rx_normal_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,\n+\t\t\tstruct rte_mbuf *pkt)\n+{\n+\tstruct buf_vector buf_vec[BUF_VECTOR_MAX];\n+\tuint16_t nr_descs = 0;\n+\n+\trte_smp_rmb();\n+\tif (unlikely(vhost_enqueue_normal_packed(dev, vq,\n+\t\t\t\t\tpkt, buf_vec, &nr_descs) < 0)) {\n+\t\tVHOST_LOG_DEBUG(VHOST_DATA,\n+\t\t\t\"(%d) failed to get enough desc from vring\\n\",\n+\t\t\tdev->vid);\n+\t\treturn 0;\n+\t}\n+\n+\tVHOST_LOG_DEBUG(VHOST_DATA, \"(%d) current index %d | end index %d\\n\",\n+\t\tdev->vid, vq->last_avail_idx,\n+\t\tvq->last_avail_idx + nr_descs);\n+\n+\tvq->last_avail_idx += nr_descs;\n+\tif (vq->last_avail_idx >= vq->size) {\n+\t\tvq->last_avail_idx -= vq->size;\n+\t\tvq->avail_wrap_counter ^= 1;\n+\t}\n+\n+\treturn 1;\n+}\n+\n static __rte_noinline uint32_t\n virtio_dev_rx_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \tstruct rte_mbuf **pkts, uint32_t count)\n",
    "prefixes": [
        "RFC",
        "01/13"
    ]
}