Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/8516/?format=api
https://patches.dpdk.org/api/patches/8516/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1446459547-1754-3-git-send-email-harry.van.haaren@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": "<1446459547-1754-3-git-send-email-harry.van.haaren@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1446459547-1754-3-git-send-email-harry.van.haaren@intel.com", "date": "2015-11-02T10:18:59", "name": "[dpdk-dev,v5,02/10] ethdev: update xstats_get() strings and Q handling", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "690a94156b1fb7633216c127831b5b91f4bea5a9", "submitter": { "id": 317, "url": "https://patches.dpdk.org/api/people/317/?format=api", "name": "Van Haaren, Harry", "email": "harry.van.haaren@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1446459547-1754-3-git-send-email-harry.van.haaren@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/8516/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/8516/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 197AE8E7F;\n\tMon, 2 Nov 2015 11:19:22 +0100 (CET)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id C981D8DA2\n\tfor <dev@dpdk.org>; Mon, 2 Nov 2015 11:19:19 +0100 (CET)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga101.jf.intel.com with ESMTP; 02 Nov 2015 02:19:20 -0800", "from sie-lab-212-222.ir.intel.com (HELO\n\tsilpixa00366884.ir.intel.com) ([10.237.212.222])\n\tby orsmga002.jf.intel.com with ESMTP; 02 Nov 2015 02:19:18 -0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.20,234,1444719600\"; d=\"scan'208\";a=\"840505386\"", "From": "Harry van Haaren <harry.van.haaren@intel.com>", "To": "dev@dpdk.org", "Date": "Mon, 2 Nov 2015 10:18:59 +0000", "Message-Id": "<1446459547-1754-3-git-send-email-harry.van.haaren@intel.com>", "X-Mailer": "git-send-email 1.9.1", "In-Reply-To": "<1446459547-1754-1-git-send-email-harry.van.haaren@intel.com>", "References": "<1446204998-17151-2-git-send-email-harry.van.haaren@intel.com>\n\t<1446459547-1754-1-git-send-email-harry.van.haaren@intel.com>", "Subject": "[dpdk-dev] [PATCH v5 02/10] ethdev: update xstats_get() strings and\n\tQ handling", "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": "Update the strings used for presenting stats to adhere\nto the scheme previously presented. Updated xstats_get()\nfunction to handle Q information only if xstats() is not\nimplemented in the PMD, providing the PMD with the needed\nflexibility to expose its extended Q stats.\n\nSigned-off-by: Harry van Haaren <harry.van.haaren@intel.com>\n---\n lib/librte_ether/rte_ethdev.c | 38 +++++++++++++++++++++++---------------\n 1 file changed, 23 insertions(+), 15 deletions(-)", "diff": "diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex f593f6e..07f0c26 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -137,27 +137,30 @@ struct rte_eth_xstats_name_off {\n };\n \n static const struct rte_eth_xstats_name_off rte_stats_strings[] = {\n-\t{\"rx_packets\", offsetof(struct rte_eth_stats, ipackets)},\n-\t{\"tx_packets\", offsetof(struct rte_eth_stats, opackets)},\n-\t{\"rx_bytes\", offsetof(struct rte_eth_stats, ibytes)},\n-\t{\"tx_bytes\", offsetof(struct rte_eth_stats, obytes)},\n-\t{\"tx_errors\", offsetof(struct rte_eth_stats, oerrors)},\n+\t{\"rx_good_packets\", offsetof(struct rte_eth_stats, ipackets)},\n+\t{\"tx_good_packets\", offsetof(struct rte_eth_stats, opackets)},\n+\t{\"rx_good_bytes\", offsetof(struct rte_eth_stats, ibytes)},\n+\t{\"tx_good_bytes\", offsetof(struct rte_eth_stats, obytes)},\n \t{\"rx_errors\", offsetof(struct rte_eth_stats, ierrors)},\n-\t{\"alloc_rx_buff_failed\", offsetof(struct rte_eth_stats, rx_nombuf)},\n+\t{\"tx_errors\", offsetof(struct rte_eth_stats, oerrors)},\n+\t{\"rx_mbuf_allocation_errors\", offsetof(struct rte_eth_stats,\n+\t\trx_nombuf)},\n };\n+\n #define RTE_NB_STATS (sizeof(rte_stats_strings) / sizeof(rte_stats_strings[0]))\n \n static const struct rte_eth_xstats_name_off rte_rxq_stats_strings[] = {\n-\t{\"rx_packets\", offsetof(struct rte_eth_stats, q_ipackets)},\n-\t{\"rx_bytes\", offsetof(struct rte_eth_stats, q_ibytes)},\n+\t{\"packets\", offsetof(struct rte_eth_stats, q_ipackets)},\n+\t{\"bytes\", offsetof(struct rte_eth_stats, q_ibytes)},\n+\t{\"errors\", offsetof(struct rte_eth_stats, q_errors)},\n };\n+\n #define RTE_NB_RXQ_STATS (sizeof(rte_rxq_stats_strings) /\t\\\n \t\tsizeof(rte_rxq_stats_strings[0]))\n \n static const struct rte_eth_xstats_name_off rte_txq_stats_strings[] = {\n-\t{\"tx_packets\", offsetof(struct rte_eth_stats, q_opackets)},\n-\t{\"tx_bytes\", offsetof(struct rte_eth_stats, q_obytes)},\n-\t{\"tx_errors\", offsetof(struct rte_eth_stats, q_errors)},\n+\t{\"packets\", offsetof(struct rte_eth_stats, q_opackets)},\n+\t{\"bytes\", offsetof(struct rte_eth_stats, q_obytes)},\n };\n #define RTE_NB_TXQ_STATS (sizeof(rte_txq_stats_strings) /\t\\\n \t\tsizeof(rte_txq_stats_strings[0]))\n@@ -1666,8 +1669,6 @@ rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstats *xstats,\n \n \t/* Return generic statistics */\n \tcount = RTE_NB_STATS;\n-\tcount += dev->data->nb_rx_queues * RTE_NB_RXQ_STATS;\n-\tcount += dev->data->nb_tx_queues * RTE_NB_TXQ_STATS;\n \n \t/* implemented by the driver */\n \tif (dev->dev_ops->xstats_get != NULL) {\n@@ -1679,6 +1680,9 @@ rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstats *xstats,\n \n \t\tif (xcount < 0)\n \t\t\treturn xcount;\n+\t} else {\n+\t\tcount += dev->data->nb_rx_queues * RTE_NB_RXQ_STATS;\n+\t\tcount += dev->data->nb_tx_queues * RTE_NB_TXQ_STATS;\n \t}\n \n \tif (n < count + xcount)\n@@ -1698,6 +1702,10 @@ rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstats *xstats,\n \t\txstats[count++].value = val;\n \t}\n \n+\t/* if xstats_get() is implemented by the PMD, the Q stats are done */\n+\tif (dev->dev_ops->xstats_get != NULL)\n+\t\treturn count + xcount;\n+\n \t/* per-rxq stats */\n \tfor (q = 0; q < dev->data->nb_rx_queues; q++) {\n \t\tfor (i = 0; i < RTE_NB_RXQ_STATS; i++) {\n@@ -1706,7 +1714,7 @@ rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstats *xstats,\n \t\t\t\t\tq * sizeof(uint64_t));\n \t\t\tval = *stats_ptr;\n \t\t\tsnprintf(xstats[count].name, sizeof(xstats[count].name),\n-\t\t\t\t\"rx_queue_%u_%s\", q,\n+\t\t\t\t\"rx_q%u_%s\", q,\n \t\t\t\trte_rxq_stats_strings[i].name);\n \t\t\txstats[count++].value = val;\n \t\t}\n@@ -1720,7 +1728,7 @@ rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstats *xstats,\n \t\t\t\t\tq * sizeof(uint64_t));\n \t\t\tval = *stats_ptr;\n \t\t\tsnprintf(xstats[count].name, sizeof(xstats[count].name),\n-\t\t\t\t\"tx_queue_%u_%s\", q,\n+\t\t\t\t\"tx_q%u_%s\", q,\n \t\t\t\trte_txq_stats_strings[i].name);\n \t\t\txstats[count++].value = val;\n \t\t}\n", "prefixes": [ "dpdk-dev", "v5", "02/10" ] }{ "id": 8516, "url": "