get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 50365,
    "url": "http://patches.dpdk.org/api/patches/50365/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190219105951.31046-6-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": "<20190219105951.31046-6-tiwei.bie@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190219105951.31046-6-tiwei.bie@intel.com",
    "date": "2019-02-19T10:59:51",
    "name": "[5/5] net/virtio: optimize xmit enqueue for packed ring",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "fc3a07ff98843659bedc7938457b2e360e2daeb3",
    "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/20190219105951.31046-6-tiwei.bie@intel.com/mbox/",
    "series": [
        {
            "id": 3481,
            "url": "http://patches.dpdk.org/api/series/3481/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3481",
            "date": "2019-02-19T10:59:46",
            "name": "Fixes and enhancements for Tx path in Virtio PMD",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/3481/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/50365/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/50365/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 E5B031B1CE;\n\tTue, 19 Feb 2019 12:02:46 +0100 (CET)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby dpdk.org (Postfix) with ESMTP id BAEB57CB0\n\tfor <dev@dpdk.org>; Tue, 19 Feb 2019 12:02:42 +0100 (CET)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Feb 2019 03:02:41 -0800",
            "from dpdk-tbie.sh.intel.com ([10.67.104.173])\n\tby orsmga002.jf.intel.com with ESMTP; 19 Feb 2019 03:02:41 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.58,388,1544515200\"; d=\"scan'208\";a=\"135430806\"",
        "From": "Tiwei Bie <tiwei.bie@intel.com>",
        "To": "maxime.coquelin@redhat.com,\n\tzhihong.wang@intel.com,\n\tdev@dpdk.org",
        "Date": "Tue, 19 Feb 2019 18:59:51 +0800",
        "Message-Id": "<20190219105951.31046-6-tiwei.bie@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190219105951.31046-1-tiwei.bie@intel.com>",
        "References": "<20190219105951.31046-1-tiwei.bie@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 5/5] net/virtio: optimize xmit enqueue for packed\n\tring",
        "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": "This patch introduces an optimized enqueue function in packed\nring for the case that virtio net header can be prepended to\nthe unchained mbuf.\n\nSigned-off-by: Tiwei Bie <tiwei.bie@intel.com>\n---\n drivers/net/virtio/virtio_rxtx.c | 63 +++++++++++++++++++++++++++++++-\n 1 file changed, 61 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c\nindex 60fa3aa50..771d3c3f6 100644\n--- a/drivers/net/virtio/virtio_rxtx.c\n+++ b/drivers/net/virtio/virtio_rxtx.c\n@@ -623,6 +623,62 @@ virtqueue_enqueue_xmit_inorder(struct virtnet_tx *txvq,\n \tvq->vq_desc_head_idx = idx & (vq->vq_nentries - 1);\n }\n \n+static inline void\n+virtqueue_enqueue_xmit_packed_fast(struct virtnet_tx *txvq,\n+\t\t\t\t   struct rte_mbuf *cookie,\n+\t\t\t\t   int in_order)\n+{\n+\tstruct virtqueue *vq = txvq->vq;\n+\tstruct vring_packed_desc *dp;\n+\tstruct vq_desc_extra *dxp;\n+\tuint16_t idx, id, flags;\n+\tuint16_t head_size = vq->hw->vtnet_hdr_size;\n+\tstruct virtio_net_hdr *hdr;\n+\n+\tid = in_order ? vq->vq_avail_idx : vq->vq_desc_head_idx;\n+\tidx = vq->vq_avail_idx;\n+\tdp = &vq->ring_packed.desc_packed[idx];\n+\n+\tdxp = &vq->vq_descx[id];\n+\tdxp->ndescs = 1;\n+\tdxp->cookie = cookie;\n+\n+\tflags = vq->avail_used_flags;\n+\n+\t/* prepend cannot fail, checked by caller */\n+\thdr = (struct virtio_net_hdr *)\n+\t\trte_pktmbuf_prepend(cookie, head_size);\n+\tcookie->pkt_len -= head_size;\n+\n+\t/* if offload disabled, hdr is not zeroed yet, do it now */\n+\tif (!vq->hw->has_tx_offload)\n+\t\tvirtqueue_clear_net_hdr(hdr);\n+\telse\n+\t\tvirtqueue_xmit_offload(hdr, cookie, true);\n+\n+\tdp->addr = VIRTIO_MBUF_DATA_DMA_ADDR(cookie, vq);\n+\tdp->len  = cookie->data_len;\n+\tdp->id   = id;\n+\n+\tif (++vq->vq_avail_idx >= vq->vq_nentries) {\n+\t\tvq->vq_avail_idx -= vq->vq_nentries;\n+\t\tvq->avail_wrap_counter ^= 1;\n+\t\tvq->avail_used_flags ^=\n+\t\t\tVRING_DESC_F_AVAIL(1) | VRING_DESC_F_USED(1);\n+\t}\n+\n+\tvq->vq_free_cnt--;\n+\n+\tif (!in_order) {\n+\t\tvq->vq_desc_head_idx = dxp->next;\n+\t\tif (vq->vq_desc_head_idx == VQ_RING_DESC_CHAIN_END)\n+\t\t\tvq->vq_desc_tail_idx = VQ_RING_DESC_CHAIN_END;\n+\t}\n+\n+\tvirtio_wmb(vq->hw->weak_barriers);\n+\tdp->flags = flags;\n+}\n+\n static inline void\n virtqueue_enqueue_xmit_packed(struct virtnet_tx *txvq, struct rte_mbuf *cookie,\n \t\t\t      uint16_t needed, int can_push, int in_order)\n@@ -1979,8 +2035,11 @@ virtio_xmit_pkts_packed(void *tx_queue, struct rte_mbuf **tx_pkts,\n \t\t}\n \n \t\t/* Enqueue Packet buffers */\n-\t\tvirtqueue_enqueue_xmit_packed(txvq, txm, slots, can_push,\n-\t\t\t\t\t      in_order);\n+\t\tif (can_push)\n+\t\t\tvirtqueue_enqueue_xmit_packed_fast(txvq, txm, in_order);\n+\t\telse\n+\t\t\tvirtqueue_enqueue_xmit_packed(txvq, txm, slots, 0,\n+\t\t\t\t\t\t      in_order);\n \n \t\tvirtio_update_packet_stats(&txvq->stats, txm);\n \t}\n",
    "prefixes": [
        "5/5"
    ]
}