Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/100737/?format=api
https://patches.dpdk.org/api/patches/100737/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20211007220013.355530-12-maxime.coquelin@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": "<20211007220013.355530-12-maxime.coquelin@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20211007220013.355530-12-maxime.coquelin@redhat.com", "date": "2021-10-07T22:00:10", "name": "[RFC,11/14] vhost: simplify getting the first in-flight index", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "ee8b21389e6994d39f2dc856d7e52382203692d4", "submitter": { "id": 512, "url": "https://patches.dpdk.org/api/people/512/?format=api", "name": "Maxime Coquelin", "email": "maxime.coquelin@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/20211007220013.355530-12-maxime.coquelin@redhat.com/mbox/", "series": [ { "id": 19439, "url": "https://patches.dpdk.org/api/series/19439/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=19439", "date": "2021-10-07T22:00:01", "name": "vhost: clean-up and simplify async implementation", "version": 1, "mbox": "https://patches.dpdk.org/series/19439/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/100737/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/100737/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 85D75A0C43;\n\tFri, 8 Oct 2021 00:14:42 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6FF9E4144A;\n\tFri, 8 Oct 2021 00:14:42 +0200 (CEST)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [216.205.24.124])\n by mails.dpdk.org (Postfix) with ESMTP id 42F43413D1\n for <dev@dpdk.org>; Fri, 8 Oct 2021 00:14:41 +0200 (CEST)", "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-571-9uPjsHj8Oeq9PnTI71Rjuw-1; Thu, 07 Oct 2021 18:14:37 -0400", "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 AD6408CE093;\n Thu, 7 Oct 2021 22:00:56 +0000 (UTC)", "from max-t490s.redhat.com (unknown [10.39.208.18])\n by smtp.corp.redhat.com (Postfix) with ESMTP id C75725C1A3;\n Thu, 7 Oct 2021 22:00:54 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1633644880;\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=2SOIUIjyy+S/caL7rnP5/rff1qUzjFXRF68rt+evcZc=;\n b=hVjuyFINzqItG/owQnaXE8Jc2s03c+lW9Cd1Gev+jAZPFhIySjZ6DKJalgDinf9XzJD3FA\n P+YjSh8lpnNaaVxbXFl39rWqbr5H+41u59G5i4Ku9RvjKfqn55v1ZYzQ18RcnzY1ZB5blJ\n pCrqxku4nNBSR6fyOXqAlQ5Z8c7HBKY=", "X-MC-Unique": "9uPjsHj8Oeq9PnTI71Rjuw-1", "From": "Maxime Coquelin <maxime.coquelin@redhat.com>", "To": "dev@dpdk.org, chenbo.xia@intel.com, jiayu.hu@intel.com,\n yuanx.wang@intel.com, wenwux.ma@intel.com, bruce.richardson@intel.com,\n john.mcnamara@intel.com", "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>", "Date": "Fri, 8 Oct 2021 00:00:10 +0200", "Message-Id": "<20211007220013.355530-12-maxime.coquelin@redhat.com>", "In-Reply-To": "<20211007220013.355530-1-maxime.coquelin@redhat.com>", "References": "<20211007220013.355530-1-maxime.coquelin@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.16", "Authentication-Results": "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com", "X-Mimecast-Spam-Score": "0", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain; charset=\"US-ASCII\"", "Subject": "[dpdk-dev] [RFC 11/14] vhost: simplify getting the first in-flight\n index", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "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": "This patch reworks the function getting the index\nfor the first packet in-flight.\n\nWhen this index turns out to be zero, let's use the simple\npath. Doing that avoid having to do a modulo with the\nvirtqueue size.\n\nThe patch also rename the function for better clarifty,\nand only pass the virtqueue metadata pointer, as all the\nneeded information are stored there.\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n lib/vhost/virtio_net.c | 16 +++++++++-------\n 1 file changed, 9 insertions(+), 7 deletions(-)", "diff": "diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c\nindex c5651f1e0f..2aa06a958c 100644\n--- a/lib/vhost/virtio_net.c\n+++ b/lib/vhost/virtio_net.c\n@@ -1489,11 +1489,14 @@ rte_vhost_enqueue_burst(int vid, uint16_t queue_id,\n }\n \n static __rte_always_inline uint16_t\n-virtio_dev_rx_async_get_info_idx(uint16_t pkts_idx,\n-\tuint16_t vq_size, uint16_t n_inflight)\n+async_get_first_inflight_pkt_idx(struct vhost_virtqueue *vq)\n {\n-\treturn pkts_idx > n_inflight ? (pkts_idx - n_inflight) :\n-\t\t(vq_size - n_inflight + pkts_idx) % vq_size;\n+\tstruct vhost_async *async = vq->async;\n+\n+\tif (async->pkts_idx >= async->pkts_inflight_n)\n+\t\treturn async->pkts_idx - async->pkts_inflight_n;\n+\telse\n+\t\treturn vq->size - async->pkts_inflight_n + async->pkts_idx;\n }\n \n static __rte_always_inline void\n@@ -1931,9 +1934,6 @@ vhost_poll_enqueue_completed(struct virtio_net *dev, uint16_t queue_id,\n \tuint16_t n_descs = 0, n_buffers = 0;\n \tuint16_t start_idx, from, i;\n \n-\tstart_idx = virtio_dev_rx_async_get_info_idx(async->pkts_idx,\n-\t\tvq->size, async->pkts_inflight_n);\n-\n \tn_cpl = async->ops.check_completed_copies(dev->vid, queue_id, 0, count);\n \tif (unlikely(n_cpl < 0)) {\n \t\tVHOST_LOG_DATA(ERR, \"(%d) %s: failed to check completed copies for queue id %d.\\n\",\n@@ -1944,6 +1944,8 @@ vhost_poll_enqueue_completed(struct virtio_net *dev, uint16_t queue_id,\n \tif (n_cpl == 0)\n \t\treturn 0;\n \n+\tstart_idx = async_get_first_inflight_pkt_idx(vq);\n+\n \tfor (i = 0; i < n_cpl; i++) {\n \t\tfrom = (start_idx + i) % vq->size;\n \t\t/* Only used with packed ring */\n", "prefixes": [ "RFC", "11/14" ] }{ "id": 100737, "url": "