Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/7277/?format=api
https://patches.dpdk.org/api/patches/7277/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1443537953-23917-4-git-send-email-huawei.xie@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": "<1443537953-23917-4-git-send-email-huawei.xie@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1443537953-23917-4-git-send-email-huawei.xie@intel.com", "date": "2015-09-29T14:45:48", "name": "[dpdk-dev,3/8] virtio: add software rx ring, fake_buf, simple_rxtx into virtqueue", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "7b09aa275f595d9dfad71e5a4443e44da3d53498", "submitter": { "id": 16, "url": "https://patches.dpdk.org/api/people/16/?format=api", "name": "Huawei Xie", "email": "huawei.xie@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1443537953-23917-4-git-send-email-huawei.xie@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/7277/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/7277/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 0DC398D8A;\n\tTue, 29 Sep 2015 16:46:40 +0200 (CEST)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id EFBEB8DA3\n\tfor <dev@dpdk.org>; Tue, 29 Sep 2015 16:46:37 +0200 (CEST)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga103.jf.intel.com with ESMTP; 29 Sep 2015 07:46:37 -0700", "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga002.jf.intel.com with ESMTP; 29 Sep 2015 07:46:36 -0700", "from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com\n\t[10.239.29.90])\n\tby shvmail01.sh.intel.com with ESMTP id t8TEkYGX024576;\n\tTue, 29 Sep 2015 22:46:34 +0800", "from shecgisg003.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid t8TEkWw7023974; Tue, 29 Sep 2015 22:46:34 +0800", "(from hxie5@localhost)\n\tby shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t8TEkWaR023970; \n\tTue, 29 Sep 2015 22:46:32 +0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.17,608,1437462000\"; d=\"scan'208\";a=\"815499181\"", "From": "Huawei Xie <huawei.xie@intel.com>", "To": "dev@dpdk.org", "Date": "Tue, 29 Sep 2015 22:45:48 +0800", "Message-Id": "<1443537953-23917-4-git-send-email-huawei.xie@intel.com>", "X-Mailer": "git-send-email 1.7.4.1", "In-Reply-To": "<1443537953-23917-1-git-send-email-huawei.xie@intel.com>", "References": "<1443537953-23917-1-git-send-email-huawei.xie@intel.com>", "Subject": "[dpdk-dev] [PATCH 3/8] virtio: add software rx ring, fake_buf,\n\tsimple_rxtx into virtqueue", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/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 software RX ring in virtqueue.\nAdd fake_mbuf in virtqueue for wraparound processing.\nUse simple_rxtx to indicate whether simple rxtx is enabled\n\nSigned-off-by: Huawei Xie <huawei.xie@intel.com>\n---\n drivers/net/virtio/virtio_ethdev.c | 12 ++++++++++++\n drivers/net/virtio/virtio_rxtx.c | 5 +++++\n drivers/net/virtio/virtqueue.h | 6 ++++++\n 3 files changed, 23 insertions(+)", "diff": "diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c\nindex 79a3640..3b7b841 100644\n--- a/drivers/net/virtio/virtio_ethdev.c\n+++ b/drivers/net/virtio/virtio_ethdev.c\n@@ -247,6 +247,9 @@ virtio_dev_queue_release(struct virtqueue *vq) {\n \t\tVIRTIO_WRITE_REG_2(hw, VIRTIO_PCI_QUEUE_SEL, vq->queue_id);\n \t\tVIRTIO_WRITE_REG_4(hw, VIRTIO_PCI_QUEUE_PFN, 0);\n \n+\t\tif (vq->sw_ring)\n+\t\t\trte_free(vq->sw_ring);\n+\n \t\trte_free(vq);\n \t\tvq = NULL;\n \t}\n@@ -292,6 +295,9 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev,\n \t\t\tdev->data->port_id, queue_idx);\n \t\tvq = rte_zmalloc(vq_name, sizeof(struct virtqueue) +\n \t\t\tvq_size * sizeof(struct vq_desc_extra), RTE_CACHE_LINE_SIZE);\n+\t\tvq->sw_ring = rte_zmalloc_socket(\"rxq->sw_ring\",\n+\t\t\t(RTE_PMD_VIRTIO_RX_MAX_BURST + vq_size) *\n+\t\t\tsizeof(vq->sw_ring[0]), RTE_CACHE_LINE_SIZE, socket_id);\n \t} else if (queue_type == VTNET_TQ) {\n \t\tsnprintf(vq_name, sizeof(vq_name), \"port%d_tvq%d\",\n \t\t\tdev->data->port_id, queue_idx);\n@@ -308,6 +314,12 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev,\n \t\tPMD_INIT_LOG(ERR, \"%s: Can not allocate virtqueue\", __func__);\n \t\treturn (-ENOMEM);\n \t}\n+\tif (queue_type == VTNET_RQ && vq->sw_ring == NULL) {\n+\t\tPMD_INIT_LOG(ERR, \"%s: Can not allocate RX soft ring\",\n+\t\t\t__func__);\n+\t\trte_free(vq);\n+\t\treturn -ENOMEM;\n+\t}\n \n \tvq->hw = hw;\n \tvq->port_id = dev->data->port_id;\ndiff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c\nindex 9324f7f..dcc4524 100644\n--- a/drivers/net/virtio/virtio_rxtx.c\n+++ b/drivers/net/virtio/virtio_rxtx.c\n@@ -299,6 +299,11 @@ virtio_dev_vring_start(struct virtqueue *vq, int queue_type)\n \t\t/* Allocate blank mbufs for the each rx descriptor */\n \t\tnbufs = 0;\n \t\terror = ENOSPC;\n+\n+\t\tmemset(&vq->fake_mbuf, 0, sizeof(vq->fake_mbuf));\n+\t\tfor (i = 0; i < RTE_PMD_VIRTIO_RX_MAX_BURST; i++)\n+\t\t\tvq->sw_ring[vq->vq_nentries + i] = &vq->fake_mbuf;\n+\n \t\twhile (!virtqueue_full(vq)) {\n \t\t\tm = rte_rxmbuf_alloc(vq->mpool);\n \t\t\tif (m == NULL)\ndiff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h\nindex 7789411..dd63285 100644\n--- a/drivers/net/virtio/virtqueue.h\n+++ b/drivers/net/virtio/virtqueue.h\n@@ -190,11 +190,17 @@ struct virtqueue {\n \tuint16_t vq_avail_idx;\n \tphys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */\n \n+\tstruct rte_mbuf **sw_ring; /**< RX software ring. */\n+\t/* dummy mbuf, for wraparound when processing RX ring. */\n+\tstruct rte_mbuf fake_mbuf;\n+\n \t/* Statistics */\n \tuint64_t\tpackets;\n \tuint64_t\tbytes;\n \tuint64_t\terrors;\n \n+\tint use_simple_rxtx;\n+\n \tstruct vq_desc_extra {\n \t\tvoid *cookie;\n \t\tuint16_t ndescs;\n", "prefixes": [ "dpdk-dev", "3/8" ] }{ "id": 7277, "url": "