Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/123276/?format=api
http://patches.dpdk.org/api/patches/123276/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230207151747.245808-9-maxime.coquelin@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": "<20230207151747.245808-9-maxime.coquelin@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230207151747.245808-9-maxime.coquelin@redhat.com", "date": "2023-02-07T15:17:34", "name": "[v2,08/21] net/virtio: move vring memzone to virtqueue struct", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "c53ccfa724fc342ce3b1e0266e8488387063597c", "submitter": { "id": 512, "url": "http://patches.dpdk.org/api/people/512/?format=api", "name": "Maxime Coquelin", "email": "maxime.coquelin@redhat.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/20230207151747.245808-9-maxime.coquelin@redhat.com/mbox/", "series": [ { "id": 26854, "url": "http://patches.dpdk.org/api/series/26854/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=26854", "date": "2023-02-07T15:17:33", "name": "Add control queue & MQ support to Virtio-user vDPA", "version": 2, "mbox": "http://patches.dpdk.org/series/26854/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/123276/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/123276/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 0161F41C30;\n\tTue, 7 Feb 2023 16:18:40 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id AF6D242D38;\n\tTue, 7 Feb 2023 16:18:35 +0100 (CET)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by mails.dpdk.org (Postfix) with ESMTP id 77AC342D0C\n for <dev@dpdk.org>; Tue, 7 Feb 2023 16:18:33 +0100 (CET)", "from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com\n [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n us-mta-461-9s7x40WuPBWGQLFpLvcAuw-1; Tue, 07 Feb 2023 10:18:32 -0500", "from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com\n [10.11.54.7])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2D65A8A4ED4;\n Tue, 7 Feb 2023 15:18:07 +0000 (UTC)", "from max-t490s.redhat.com (unknown [10.39.208.26])\n by smtp.corp.redhat.com (Postfix) with ESMTP id D3F00140EBF4;\n Tue, 7 Feb 2023 15:18:05 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1675783113;\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=25j+IiKVa+T71muVgwew+0dRsRBNzJUauIwyenoYRKs=;\n b=Z9/B/IdgEyXwZQftelbtXlSlzMf69pdQh4d3W1GUNpHNGf0bMl5CzJ62FfqxAdhzwtibTH\n S87xntrCAqnbjvva9472b6YTtwLx9OHAp79GugSFR+Qht57FOWHqLBxi89RatH5krPoobE\n PpWGwHCCEdZJe3PvQ1c5ZUXqVDtOFsU=", "X-MC-Unique": "9s7x40WuPBWGQLFpLvcAuw-1", "From": "Maxime Coquelin <maxime.coquelin@redhat.com>", "To": "dev@dpdk.org, chenbo.xia@intel.com, david.marchand@redhat.com,\n eperezma@redhat.com, stephen@networkplumber.org", "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>", "Subject": "[PATCH v2 08/21] net/virtio: move vring memzone to virtqueue struct", "Date": "Tue, 7 Feb 2023 16:17:34 +0100", "Message-Id": "<20230207151747.245808-9-maxime.coquelin@redhat.com>", "In-Reply-To": "<20230207151747.245808-1-maxime.coquelin@redhat.com>", "References": "<20230207151747.245808-1-maxime.coquelin@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.1 on 10.11.54.7", "X-Mimecast-Spam-Score": "0", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true", "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" }, "content": "Whatever its type (Rx, Tx or Ctl), all the virtqueue\nrequire a memzone for the vrings. This patch moves its\npointer to the virtqueue struct, simplifying the code.\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\nReviewed-by: Chenbo Xia <chenbo.xia@intel.com>\n---\n drivers/net/virtio/virtio_cvq.h | 1 -\n drivers/net/virtio/virtio_ethdev.c | 11 ++---------\n drivers/net/virtio/virtio_rxtx.h | 4 ----\n drivers/net/virtio/virtqueue.c | 6 ++----\n drivers/net/virtio/virtqueue.h | 1 +\n 5 files changed, 5 insertions(+), 18 deletions(-)", "diff": "diff --git a/drivers/net/virtio/virtio_cvq.h b/drivers/net/virtio/virtio_cvq.h\nindex 0ff326b063..70739ae04b 100644\n--- a/drivers/net/virtio/virtio_cvq.h\n+++ b/drivers/net/virtio/virtio_cvq.h\n@@ -108,7 +108,6 @@ typedef uint8_t virtio_net_ctrl_ack;\n struct virtnet_ctl {\n \tconst struct rte_memzone *hdr_mz; /**< memzone to populate hdr. */\n \trte_iova_t hdr_mem; /**< hdr for each xmit packet */\n-\tconst struct rte_memzone *mz; /**< mem zone to populate CTL ring. */\n \trte_spinlock_t lock; /**< spinlock for control queue. */\n \tvoid (*notify_queue)(struct virtqueue *vq, void *cookie); /**< notify ops. */\n \tvoid *notify_cookie; /**< cookie for notify ops */\ndiff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c\nindex 56395f79c3..4f6d777951 100644\n--- a/drivers/net/virtio/virtio_ethdev.c\n+++ b/drivers/net/virtio/virtio_ethdev.c\n@@ -423,6 +423,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t queue_idx)\n \n \tmemset(mz->addr, 0, mz->len);\n \n+\tvq->mz = mz;\n \tif (hw->use_va)\n \t\tvq->vq_ring_mem = (uintptr_t)mz->addr;\n \telse\n@@ -462,14 +463,11 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t queue_idx)\n \n \t\tvq->sw_ring = sw_ring;\n \t\trxvq = &vq->rxq;\n-\t\trxvq->mz = mz;\n \t\trxvq->fake_mbuf = fake_mbuf;\n \t} else if (queue_type == VTNET_TQ) {\n \t\ttxvq = &vq->txq;\n-\t\ttxvq->mz = mz;\n \t} else if (queue_type == VTNET_CQ) {\n \t\tcvq = &vq->cq;\n-\t\tcvq->mz = mz;\n \t\thw->cvq = cvq;\n \t\tvq->cq.notify_queue = &virtio_control_queue_notify;\n \t}\n@@ -550,15 +548,10 @@ virtio_free_queues(struct virtio_hw *hw)\n \t\tif (queue_type == VTNET_RQ) {\n \t\t\trte_free(vq->rxq.fake_mbuf);\n \t\t\trte_free(vq->sw_ring);\n-\t\t\trte_memzone_free(vq->rxq.mz);\n-\t\t} else if (queue_type == VTNET_TQ) {\n-\t\t\trte_memzone_free(vq->txq.mz);\n-\t\t} else {\n-\t\t\trte_memzone_free(vq->cq.mz);\n \t\t}\n \n \t\tvirtio_free_queue_headers(vq);\n-\n+\t\trte_memzone_free(vq->mz);\n \t\trte_free(vq);\n \t\thw->vqs[i] = NULL;\n \t}\ndiff --git a/drivers/net/virtio/virtio_rxtx.h b/drivers/net/virtio/virtio_rxtx.h\nindex a5fe3ea95c..57af630110 100644\n--- a/drivers/net/virtio/virtio_rxtx.h\n+++ b/drivers/net/virtio/virtio_rxtx.h\n@@ -25,8 +25,6 @@ struct virtnet_rx {\n \n \t/* Statistics */\n \tstruct virtnet_stats stats;\n-\n-\tconst struct rte_memzone *mz; /**< mem zone to populate RX ring. */\n };\n \n struct virtnet_tx {\n@@ -34,8 +32,6 @@ struct virtnet_tx {\n \trte_iova_t hdr_mem; /**< hdr for each xmit packet */\n \n \tstruct virtnet_stats stats; /* Statistics */\n-\n-\tconst struct rte_memzone *mz; /**< mem zone to populate TX ring. */\n };\n \n int virtio_rxq_vec_setup(struct virtnet_rx *rxvq);\ndiff --git a/drivers/net/virtio/virtqueue.c b/drivers/net/virtio/virtqueue.c\nindex 3b174a5923..41e3529546 100644\n--- a/drivers/net/virtio/virtqueue.c\n+++ b/drivers/net/virtio/virtqueue.c\n@@ -148,7 +148,6 @@ virtqueue_rxvq_reset_packed(struct virtqueue *vq)\n {\n \tint size = vq->vq_nentries;\n \tstruct vq_desc_extra *dxp;\n-\tstruct virtnet_rx *rxvq;\n \tuint16_t desc_idx;\n \n \tvq->vq_used_cons_idx = 0;\n@@ -162,8 +161,7 @@ virtqueue_rxvq_reset_packed(struct virtqueue *vq)\n \tvq->vq_packed.event_flags_shadow = 0;\n \tvq->vq_packed.cached_flags |= VRING_DESC_F_WRITE;\n \n-\trxvq = &vq->rxq;\n-\tmemset(rxvq->mz->addr, 0, rxvq->mz->len);\n+\tmemset(vq->mz->addr, 0, vq->mz->len);\n \n \tfor (desc_idx = 0; desc_idx < vq->vq_nentries; desc_idx++) {\n \t\tdxp = &vq->vq_descx[desc_idx];\n@@ -201,7 +199,7 @@ virtqueue_txvq_reset_packed(struct virtqueue *vq)\n \n \ttxvq = &vq->txq;\n \ttxr = txvq->hdr_mz->addr;\n-\tmemset(txvq->mz->addr, 0, txvq->mz->len);\n+\tmemset(vq->mz->addr, 0, vq->mz->len);\n \tmemset(txvq->hdr_mz->addr, 0, txvq->hdr_mz->len);\n \n \tfor (desc_idx = 0; desc_idx < vq->vq_nentries; desc_idx++) {\ndiff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h\nindex f5058f362c..8b7bfae643 100644\n--- a/drivers/net/virtio/virtqueue.h\n+++ b/drivers/net/virtio/virtqueue.h\n@@ -201,6 +201,7 @@ struct virtqueue {\n \t\tstruct virtnet_ctl cq;\n \t};\n \n+\tconst struct rte_memzone *mz; /**< mem zone to populate ring. */\n \trte_iova_t vq_ring_mem; /**< physical address of vring,\n \t * or virtual address for virtio_user. */\n \n", "prefixes": [ "v2", "08/21" ] }{ "id": 123276, "url": "