get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 51326,
    "url": "https://patches.dpdk.org/api/patches/51326/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190319064312.13743-10-tiwei.bie@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": "<20190319064312.13743-10-tiwei.bie@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190319064312.13743-10-tiwei.bie@intel.com",
    "date": "2019-03-19T06:43:11",
    "name": "[09/10] net/virtio: add ctrl vq helper for split ring",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "2dba051c7d54c02ab069c82008e59de93c8b865e",
    "submitter": {
        "id": 617,
        "url": "https://patches.dpdk.org/api/people/617/?format=api",
        "name": "Tiwei Bie",
        "email": "tiwei.bie@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/20190319064312.13743-10-tiwei.bie@intel.com/mbox/",
    "series": [
        {
            "id": 3795,
            "url": "https://patches.dpdk.org/api/series/3795/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=3795",
            "date": "2019-03-19T06:43:02",
            "name": "net/virtio: cleanups and fixes for packed/split ring",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/3795/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/51326/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/51326/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 8891256A3;\n\tTue, 19 Mar 2019 07:44:00 +0100 (CET)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n\tby dpdk.org (Postfix) with ESMTP id 932DD4C9C\n\tfor <dev@dpdk.org>; Tue, 19 Mar 2019 07:43:44 +0100 (CET)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n\tby orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t18 Mar 2019 23:43:44 -0700",
            "from dpdk-tbie.sh.intel.com ([10.67.104.173])\n\tby orsmga007.jf.intel.com with ESMTP; 18 Mar 2019 23:43:43 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.58,496,1544515200\"; d=\"scan'208\";a=\"123847075\"",
        "From": "Tiwei Bie <tiwei.bie@intel.com>",
        "To": "maxime.coquelin@redhat.com,\n\tzhihong.wang@intel.com,\n\tdev@dpdk.org",
        "Date": "Tue, 19 Mar 2019 14:43:11 +0800",
        "Message-Id": "<20190319064312.13743-10-tiwei.bie@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190319064312.13743-1-tiwei.bie@intel.com>",
        "References": "<20190319064312.13743-1-tiwei.bie@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 09/10] net/virtio: add ctrl vq helper for split\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": "Add a helper for sending commands in split ring to make the\ncode consistent with the corresponding code in packed ring.\n\nSigned-off-by: Tiwei Bie <tiwei.bie@intel.com>\n---\n drivers/net/virtio/virtio_ethdev.c | 76 +++++++++++++++++-------------\n 1 file changed, 43 insertions(+), 33 deletions(-)",
    "diff": "diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c\nindex 8aa250997..85b223451 100644\n--- a/drivers/net/virtio/virtio_ethdev.c\n+++ b/drivers/net/virtio/virtio_ethdev.c\n@@ -237,44 +237,18 @@ virtio_send_command_packed(struct virtnet_ctl *cvq,\n \treturn result;\n }\n \n-static int\n-virtio_send_command(struct virtnet_ctl *cvq, struct virtio_pmd_ctrl *ctrl,\n-\t\tint *dlen, int pkt_num)\n+static struct virtio_pmd_ctrl *\n+virtio_send_command_split(struct virtnet_ctl *cvq,\n+\t\t\t  struct virtio_pmd_ctrl *ctrl,\n+\t\t\t  int *dlen, int pkt_num)\n {\n+\tstruct virtio_pmd_ctrl *result;\n+\tstruct virtqueue *vq = cvq->vq;\n \tuint32_t head, i;\n \tint k, sum = 0;\n-\tvirtio_net_ctrl_ack status = ~0;\n-\tstruct virtio_pmd_ctrl *result;\n-\tstruct virtqueue *vq;\n \n-\tctrl->status = status;\n-\n-\tif (!cvq || !cvq->vq) {\n-\t\tPMD_INIT_LOG(ERR, \"Control queue is not supported.\");\n-\t\treturn -1;\n-\t}\n-\n-\trte_spinlock_lock(&cvq->lock);\n-\tvq = cvq->vq;\n \thead = vq->vq_desc_head_idx;\n \n-\tPMD_INIT_LOG(DEBUG, \"vq->vq_desc_head_idx = %d, status = %d, \"\n-\t\t\"vq->hw->cvq = %p vq = %p\",\n-\t\tvq->vq_desc_head_idx, status, vq->hw->cvq, vq);\n-\n-\tif (vq->vq_free_cnt < pkt_num + 2 || pkt_num < 1) {\n-\t\trte_spinlock_unlock(&cvq->lock);\n-\t\treturn -1;\n-\t}\n-\n-\tmemcpy(cvq->virtio_net_hdr_mz->addr, ctrl,\n-\t\tsizeof(struct virtio_pmd_ctrl));\n-\n-\tif (vtpci_packed_queue(vq->hw)) {\n-\t\tresult = virtio_send_command_packed(cvq, ctrl, dlen, pkt_num);\n-\t\tgoto out_unlock;\n-\t}\n-\n \t/*\n \t * Format is enforced in qemu code:\n \t * One TX packet for header;\n@@ -346,8 +320,44 @@ virtio_send_command(struct virtnet_ctl *cvq, struct virtio_pmd_ctrl *ctrl,\n \t\t\tvq->vq_free_cnt, vq->vq_desc_head_idx);\n \n \tresult = cvq->virtio_net_hdr_mz->addr;\n+\treturn result;\n+}\n+\n+static int\n+virtio_send_command(struct virtnet_ctl *cvq, struct virtio_pmd_ctrl *ctrl,\n+\t\t    int *dlen, int pkt_num)\n+{\n+\tvirtio_net_ctrl_ack status = ~0;\n+\tstruct virtio_pmd_ctrl *result;\n+\tstruct virtqueue *vq;\n+\n+\tctrl->status = status;\n+\n+\tif (!cvq || !cvq->vq) {\n+\t\tPMD_INIT_LOG(ERR, \"Control queue is not supported.\");\n+\t\treturn -1;\n+\t}\n+\n+\trte_spinlock_lock(&cvq->lock);\n+\tvq = cvq->vq;\n+\n+\tPMD_INIT_LOG(DEBUG, \"vq->vq_desc_head_idx = %d, status = %d, \"\n+\t\t\"vq->hw->cvq = %p vq = %p\",\n+\t\tvq->vq_desc_head_idx, status, vq->hw->cvq, vq);\n+\n+\tif (vq->vq_free_cnt < pkt_num + 2 || pkt_num < 1) {\n+\t\trte_spinlock_unlock(&cvq->lock);\n+\t\treturn -1;\n+\t}\n+\n+\tmemcpy(cvq->virtio_net_hdr_mz->addr, ctrl,\n+\t\tsizeof(struct virtio_pmd_ctrl));\n+\n+\tif (vtpci_packed_queue(vq->hw))\n+\t\tresult = virtio_send_command_packed(cvq, ctrl, dlen, pkt_num);\n+\telse\n+\t\tresult = virtio_send_command_split(cvq, ctrl, dlen, pkt_num);\n \n-out_unlock:\n \trte_spinlock_unlock(&cvq->lock);\n \treturn result->status;\n }\n",
    "prefixes": [
        "09/10"
    ]
}