Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/16224/?format=api
http://patches.dpdk.org/api/patches/16224/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1475152549-12295-2-git-send-email-zhiyong.yang@intel.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": "<1475152549-12295-2-git-send-email-zhiyong.yang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1475152549-12295-2-git-send-email-zhiyong.yang@intel.com", "date": "2016-09-29T12:35:48", "name": "[dpdk-dev,v8,1/2] net/vhost: add a new defined stats struct", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "562f08250e6eef389592fb2c216ad68c1e1c86a7", "submitter": { "id": 540, "url": "http://patches.dpdk.org/api/people/540/?format=api", "name": "Yang, Zhiyong", "email": "zhiyong.yang@intel.com" }, "delegate": { "id": 355, "url": "http://patches.dpdk.org/api/users/355/?format=api", "username": "yliu", "first_name": "Yuanhan", "last_name": "Liu", "email": "yuanhan.liu@linux.intel.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1475152549-12295-2-git-send-email-zhiyong.yang@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/16224/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/16224/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 36F355687;\n\tThu, 29 Sep 2016 14:38:16 +0200 (CEST)", "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby dpdk.org (Postfix) with ESMTP id 3A1351C52\n\tfor <dev@dpdk.org>; Thu, 29 Sep 2016 14:38:09 +0200 (CEST)", "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga104.jf.intel.com with ESMTP; 29 Sep 2016 05:38:08 -0700", "from dpdk2.bj.intel.com ([172.16.182.65])\n\tby orsmga003.jf.intel.com with ESMTP; 29 Sep 2016 05:38:07 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.30,415,1470726000\"; d=\"scan'208\";a=\"885063284\"", "From": "Zhiyong Yang <zhiyong.yang@intel.com>", "To": "dev@dpdk.org", "Cc": "yuanhan.liu@linux.intel.com, ciara.loftus@intel.com,\n\tZhiyong Yang <zhiyong.yang@intel.com>", "Date": "Thu, 29 Sep 2016 20:35:48 +0800", "Message-Id": "<1475152549-12295-2-git-send-email-zhiyong.yang@intel.com>", "X-Mailer": "git-send-email 2.5.5", "In-Reply-To": "<1475152549-12295-1-git-send-email-zhiyong.yang@intel.com>", "References": "<1475069208-137698-2-git-send-email-zhiyong.yang@intel.com>\n\t<1475152549-12295-1-git-send-email-zhiyong.yang@intel.com>", "Subject": "[dpdk-dev] [PATCH v8 1/2] net/vhost: add a new defined stats struct", "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": "The patch moves all stats counters to a new defined struct vhost_stats\nas follows, in order to manage all stats counters in a unified way and\nsimplify the subsequent function implementation(vhost_dev_xstats_reset).\n\nSigned-off-by: Zhiyong Yang <zhiyong.yang@intel.com>\n---\n\nChanges in v4:\nA queue can be only used as TX or RX, So, we can use pkts instead of\nrx_pkts and tx_pkts, the same to rx_bytes and tx_bytes.\nbefore modification:\nstruct vhost_stats {\n\tuint64_t rx_pkts;\n\tuint64_t tx_pkts;\n\tuint64_t missed_pkts;\n\tuint64_t rx_bytes;\n\tuint64_t tx_bytes;\n};\nNew struct vhost_stats definition as follows:\nstruct vhost_stats {\n\tuint64_t pkts;\n\tuint64_t bytes;\n\tuint64_t missed_pkts;\n};\n\n drivers/net/vhost/rte_eth_vhost.c | 42 ++++++++++++++++++++-------------------\n 1 file changed, 22 insertions(+), 20 deletions(-)", "diff": "diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c\nindex 7539cd4..c4af0f7 100644\n--- a/drivers/net/vhost/rte_eth_vhost.c\n+++ b/drivers/net/vhost/rte_eth_vhost.c\n@@ -72,6 +72,12 @@ static struct ether_addr base_eth_addr = {\n \t}\n };\n \n+struct vhost_stats {\n+\tuint64_t pkts;\n+\tuint64_t bytes;\n+\tuint64_t missed_pkts;\n+};\n+\n struct vhost_queue {\n \tint vid;\n \trte_atomic32_t allow_queuing;\n@@ -80,11 +86,7 @@ struct vhost_queue {\n \tstruct rte_mempool *mb_pool;\n \tuint8_t port;\n \tuint16_t virtqueue_id;\n-\tuint64_t rx_pkts;\n-\tuint64_t tx_pkts;\n-\tuint64_t missed_pkts;\n-\tuint64_t rx_bytes;\n-\tuint64_t tx_bytes;\n+\tstruct vhost_stats stats;\n };\n \n struct pmd_internal {\n@@ -145,11 +147,11 @@ eth_vhost_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)\n \tnb_rx = rte_vhost_dequeue_burst(r->vid,\n \t\t\tr->virtqueue_id, r->mb_pool, bufs, nb_bufs);\n \n-\tr->rx_pkts += nb_rx;\n+\tr->stats.pkts += nb_rx;\n \n \tfor (i = 0; likely(i < nb_rx); i++) {\n \t\tbufs[i]->port = r->port;\n-\t\tr->rx_bytes += bufs[i]->pkt_len;\n+\t\tr->stats.bytes += bufs[i]->pkt_len;\n \t}\n \n out:\n@@ -176,11 +178,11 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)\n \tnb_tx = rte_vhost_enqueue_burst(r->vid,\n \t\t\tr->virtqueue_id, bufs, nb_bufs);\n \n-\tr->tx_pkts += nb_tx;\n-\tr->missed_pkts += nb_bufs - nb_tx;\n+\tr->stats.pkts += nb_tx;\n+\tr->stats.missed_pkts += nb_bufs - nb_tx;\n \n \tfor (i = 0; likely(i < nb_tx); i++)\n-\t\tr->tx_bytes += bufs[i]->pkt_len;\n+\t\tr->stats.bytes += bufs[i]->pkt_len;\n \n \tfor (i = 0; likely(i < nb_tx); i++)\n \t\trte_pktmbuf_free(bufs[i]);\n@@ -582,10 +584,10 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)\n \t\tif (dev->data->rx_queues[i] == NULL)\n \t\t\tcontinue;\n \t\tvq = dev->data->rx_queues[i];\n-\t\tstats->q_ipackets[i] = vq->rx_pkts;\n+\t\tstats->q_ipackets[i] = vq->stats.pkts;\n \t\trx_total += stats->q_ipackets[i];\n \n-\t\tstats->q_ibytes[i] = vq->rx_bytes;\n+\t\tstats->q_ibytes[i] = vq->stats.bytes;\n \t\trx_total_bytes += stats->q_ibytes[i];\n \t}\n \n@@ -594,11 +596,11 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)\n \t\tif (dev->data->tx_queues[i] == NULL)\n \t\t\tcontinue;\n \t\tvq = dev->data->tx_queues[i];\n-\t\tstats->q_opackets[i] = vq->tx_pkts;\n-\t\ttx_missed_total += vq->missed_pkts;\n+\t\tstats->q_opackets[i] = vq->stats.pkts;\n+\t\ttx_missed_total += vq->stats.missed_pkts;\n \t\ttx_total += stats->q_opackets[i];\n \n-\t\tstats->q_obytes[i] = vq->tx_bytes;\n+\t\tstats->q_obytes[i] = vq->stats.bytes;\n \t\ttx_total_bytes += stats->q_obytes[i];\n \t}\n \n@@ -619,16 +621,16 @@ eth_stats_reset(struct rte_eth_dev *dev)\n \t\tif (dev->data->rx_queues[i] == NULL)\n \t\t\tcontinue;\n \t\tvq = dev->data->rx_queues[i];\n-\t\tvq->rx_pkts = 0;\n-\t\tvq->rx_bytes = 0;\n+\t\tvq->stats.pkts = 0;\n+\t\tvq->stats.bytes = 0;\n \t}\n \tfor (i = 0; i < dev->data->nb_tx_queues; i++) {\n \t\tif (dev->data->tx_queues[i] == NULL)\n \t\t\tcontinue;\n \t\tvq = dev->data->tx_queues[i];\n-\t\tvq->tx_pkts = 0;\n-\t\tvq->tx_bytes = 0;\n-\t\tvq->missed_pkts = 0;\n+\t\tvq->stats.pkts = 0;\n+\t\tvq->stats.bytes = 0;\n+\t\tvq->stats.missed_pkts = 0;\n \t}\n }\n \n", "prefixes": [ "dpdk-dev", "v8", "1/2" ] }{ "id": 16224, "url": "