Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/45945/?format=api
http://patches.dpdk.org/api/patches/45945/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20181003130646.20676-4-jfreimann@redhat.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": "<20181003130646.20676-4-jfreimann@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20181003130646.20676-4-jfreimann@redhat.com", "date": "2018-10-03T13:06:41", "name": "[v7,3/8] net/virtio: add packed virtqueue helpers", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "d5f6d6fbab362c973959f723a1f6f10dbcebb6e1", "submitter": { "id": 745, "url": "http://patches.dpdk.org/api/people/745/?format=api", "name": "Jens Freimann", "email": "jfreimann@redhat.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20181003130646.20676-4-jfreimann@redhat.com/mbox/", "series": [ { "id": 1662, "url": "http://patches.dpdk.org/api/series/1662/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1662", "date": "2018-10-03T13:06:38", "name": "implement packed virtqueues", "version": 7, "mbox": "http://patches.dpdk.org/series/1662/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/45945/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/45945/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 89F7E1B19C;\n\tWed, 3 Oct 2018 15:07:17 +0200 (CEST)", "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby dpdk.org (Postfix) with ESMTP id EADA21B142\n\tfor <dev@dpdk.org>; Wed, 3 Oct 2018 15:07:15 +0200 (CEST)", "from smtp.corp.redhat.com\n\t(int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 563F9308626E;\n\tWed, 3 Oct 2018 13:07:15 +0000 (UTC)", "from localhost (ovpn-117-117.ams2.redhat.com [10.36.117.117])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id C46B92016BE2;\n\tWed, 3 Oct 2018 13:07:14 +0000 (UTC)" ], "From": "Jens Freimann <jfreimann@redhat.com>", "To": "dev@dpdk.org", "Cc": "tiwei.bie@intel.com,\n\tmaxime.coquelin@redhat.com,\n\tGavin.Hu@arm.com", "Date": "Wed, 3 Oct 2018 15:06:41 +0200", "Message-Id": "<20181003130646.20676-4-jfreimann@redhat.com>", "In-Reply-To": "<20181003130646.20676-1-jfreimann@redhat.com>", "References": "<20181003130646.20676-1-jfreimann@redhat.com>", "X-Scanned-By": "MIMEDefang 2.84 on 10.5.11.25", "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.49]); Wed, 03 Oct 2018 13:07:15 +0000 (UTC)", "Subject": "[dpdk-dev] [PATCH v7 3/8] net/virtio: add packed virtqueue helpers", "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 helper functions to set/clear and check descriptor flags.\n\nSigned-off-by: Jens Freimann <jfreimann@redhat.com>\n---\n drivers/net/virtio/virtio_ring.h | 26 ++++++++++++++++++++++++++\n drivers/net/virtio/virtqueue.h | 11 +++++++++++\n 2 files changed, 37 insertions(+)", "diff": "diff --git a/drivers/net/virtio/virtio_ring.h b/drivers/net/virtio/virtio_ring.h\nindex 36a65f9b3..b9e63d4d4 100644\n--- a/drivers/net/virtio/virtio_ring.h\n+++ b/drivers/net/virtio/virtio_ring.h\n@@ -78,6 +78,8 @@ struct vring_packed_desc_event {\n \n struct vring {\n \tunsigned int num;\n+\tunsigned int avail_wrap_counter;\n+\tunsigned int used_wrap_counter;\n \tunion {\n \t\tstruct vring_desc_packed *desc_packed;\n \t\tstruct vring_desc *desc;\n@@ -92,6 +94,30 @@ struct vring {\n \t};\n };\n \n+static inline void\n+_set_desc_avail(struct vring_desc_packed *desc, int wrap_counter)\n+{\n+\tdesc->flags |= VRING_DESC_F_AVAIL(wrap_counter) |\n+\t\t VRING_DESC_F_USED(!wrap_counter);\n+}\n+\n+static inline void\n+set_desc_avail(struct vring *vr, struct vring_desc_packed *desc)\n+{\n+\t_set_desc_avail(desc, vr->avail_wrap_counter);\n+}\n+\n+static inline int\n+desc_is_used(struct vring_desc_packed *desc, struct vring *vr)\n+{\n+\tuint16_t used, avail;\n+\n+\tused = !!(desc->flags & VRING_DESC_F_USED(1));\n+\tavail = !!(desc->flags & VRING_DESC_F_AVAIL(1));\n+\n+\treturn used == avail && used == vr->used_wrap_counter;\n+}\n+\n /* The standard layout for the ring is a continuous chunk of memory which\n * looks like this. We assume num is a power of 2.\n *\ndiff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h\nindex 6a4f92b79..b55ace958 100644\n--- a/drivers/net/virtio/virtqueue.h\n+++ b/drivers/net/virtio/virtqueue.h\n@@ -246,6 +246,17 @@ struct virtio_tx_region {\n \t\t\t __attribute__((__aligned__(16)));\n };\n \n+static inline uint16_t\n+update_pq_avail_index(struct virtqueue *vq)\n+{\n+\tif (++vq->vq_avail_idx >= vq->vq_nentries) {\n+\t\tvq->vq_avail_idx = 0;\n+\t\tvq->vq_ring.avail_wrap_counter ^= 1;\n+\t}\n+\n+\treturn vq->vq_avail_idx;\n+}\n+\n static inline void\n vring_desc_init_packed(struct vring *vr, int n)\n {\n", "prefixes": [ "v7", "3/8" ] }{ "id": 45945, "url": "