Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/5297/?format=api
https://patches.dpdk.org/api/patches/5297/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1433775616-6896-9-git-send-email-michalx.k.jastrzebski@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": "<1433775616-6896-9-git-send-email-michalx.k.jastrzebski@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1433775616-6896-9-git-send-email-michalx.k.jastrzebski@intel.com", "date": "2015-06-08T14:59:59", "name": "[dpdk-dev,v4,08/13] port: added port_ring_writer stats", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "714c5a41e193378464c7f0a3e261b0bd27447956", "submitter": { "id": 74, "url": "https://patches.dpdk.org/api/people/74/?format=api", "name": "Michal Jastrzebski", "email": "michalx.k.jastrzebski@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1433775616-6896-9-git-send-email-michalx.k.jastrzebski@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/5297/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/5297/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 F351E5A50;\n\tMon, 8 Jun 2015 17:01:57 +0200 (CEST)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 7E1BC12A8\n\tfor <dev@dpdk.org>; Mon, 8 Jun 2015 17:01:56 +0200 (CEST)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga101.fm.intel.com with ESMTP; 08 Jun 2015 08:00:53 -0700", "from unknown (HELO Sent) ([10.217.248.178])\n\tby orsmga002.jf.intel.com with SMTP; 08 Jun 2015 08:00:51 -0700", "by Sent (sSMTP sendmail emulation); Mon, 08 Jun 2015 17:00:48 +0116" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.13,574,1427785200\"; d=\"scan'208\";a=\"743024765\"", "From": "Michal Jastrzebski <michalx.k.jastrzebski@intel.com>", "To": "dev@dpdk.org", "Date": "Mon, 8 Jun 2015 16:59:59 +0200", "Message-Id": "<1433775616-6896-9-git-send-email-michalx.k.jastrzebski@intel.com>", "X-Mailer": "git-send-email 2.1.1", "In-Reply-To": "<1433775616-6896-1-git-send-email-michalx.k.jastrzebski@intel.com>", "References": "<1433775616-6896-1-git-send-email-michalx.k.jastrzebski@intel.com>", "Subject": "[dpdk-dev] [PATCH v4 08/13] port: added port_ring_writer stats", "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": "From: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>\n\nAdded statistics for port writer port.\n\nSigned-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>\n---\n lib/librte_port/rte_port_ring.c | 38 ++++++++++++++++++++++++++++++++++++++\n 1 file changed, 38 insertions(+)", "diff": "diff --git a/lib/librte_port/rte_port_ring.c b/lib/librte_port/rte_port_ring.c\nindex 091b052..ff58009 100644\n--- a/lib/librte_port/rte_port_ring.c\n+++ b/lib/librte_port/rte_port_ring.c\n@@ -133,7 +133,23 @@ rte_port_ring_reader_stats_read(void *port,\n /*\n * Port RING Writer\n */\n+#ifdef RTE_PORT_STATS_COLLECT\n+\n+#define RTE_PORT_RING_WRITER_STATS_PKTS_IN_ADD(port, val) \\\n+\tport->stats.n_pkts_in += val\n+#define RTE_PORT_RING_WRITER_STATS_PKTS_DROP_ADD(port, val) \\\n+\tport->stats.n_pkts_drop += val\n+\n+#else\n+\n+#define RTE_PORT_RING_WRITER_STATS_PKTS_IN_ADD(port, val)\n+#define RTE_PORT_RING_WRITER_STATS_PKTS_DROP_ADD(port, val)\n+\n+#endif\n+\n struct rte_port_ring_writer {\n+\tstruct rte_port_out_stats stats;\n+\n \tstruct rte_mbuf *tx_buf[RTE_PORT_IN_BURST_SIZE_MAX];\n \tstruct rte_ring *ring;\n \tuint32_t tx_burst_sz;\n@@ -181,6 +197,7 @@ send_burst(struct rte_port_ring_writer *p)\n \tnb_tx = rte_ring_sp_enqueue_burst(p->ring, (void **)p->tx_buf,\n \t\t\tp->tx_buf_count);\n \n+\tRTE_PORT_RING_WRITER_STATS_PKTS_DROP_ADD(p, p->tx_buf_count - nb_tx);\n \tfor ( ; nb_tx < p->tx_buf_count; nb_tx++)\n \t\trte_pktmbuf_free(p->tx_buf[nb_tx]);\n \n@@ -193,6 +210,7 @@ rte_port_ring_writer_tx(void *port, struct rte_mbuf *pkt)\n \tstruct rte_port_ring_writer *p = (struct rte_port_ring_writer *) port;\n \n \tp->tx_buf[p->tx_buf_count++] = pkt;\n+\tRTE_PORT_RING_WRITER_STATS_PKTS_IN_ADD(p, 1);\n \tif (p->tx_buf_count >= p->tx_burst_sz)\n \t\tsend_burst(p);\n \n@@ -219,8 +237,10 @@ rte_port_ring_writer_tx_bulk(void *port,\n \t\tif (tx_buf_count)\n \t\t\tsend_burst(p);\n \n+\t\tRTE_PORT_RING_WRITER_STATS_PKTS_IN_ADD(p, n_pkts);\n \t\tn_pkts_ok = rte_ring_sp_enqueue_burst(p->ring, (void **)pkts, n_pkts);\n \n+\t\tRTE_PORT_RING_WRITER_STATS_PKTS_DROP_ADD(p, n_pkts - n_pkts_ok);\n \t\tfor ( ; n_pkts_ok < n_pkts; n_pkts_ok++) {\n \t\t\tstruct rte_mbuf *pkt = pkts[n_pkts_ok];\n \n@@ -233,6 +253,7 @@ rte_port_ring_writer_tx_bulk(void *port,\n \t\t\tstruct rte_mbuf *pkt = pkts[pkt_index];\n \n \t\t\tp->tx_buf[tx_buf_count++] = pkt;\n+\t\t\tRTE_PORT_RING_WRITER_STATS_PKTS_IN_ADD(p, 1);\n \t\t\tpkts_mask &= ~pkt_mask;\n \t\t}\n \n@@ -269,6 +290,22 @@ rte_port_ring_writer_free(void *port)\n \treturn 0;\n }\n \n+static int\n+rte_port_ring_writer_stats_read(void *port,\n+\t\tstruct rte_port_out_stats *stats, int clear)\n+{\n+\tstruct rte_port_ring_writer *p =\n+\t\t(struct rte_port_ring_writer *) port;\n+\n+\tif (stats != NULL)\n+\t\tmemcpy(stats, &p->stats, sizeof(p->stats));\n+\n+\tif (clear)\n+\t\tmemset(&p->stats, 0, sizeof(p->stats));\n+\n+\treturn 0;\n+}\n+\n /*\n * Port RING Writer Nodrop\n */\n@@ -455,6 +492,7 @@ struct rte_port_out_ops rte_port_ring_writer_ops = {\n \t.f_tx = rte_port_ring_writer_tx,\n \t.f_tx_bulk = rte_port_ring_writer_tx_bulk,\n \t.f_flush = rte_port_ring_writer_flush,\n+\t.f_stats = rte_port_ring_writer_stats_read,\n };\n \n struct rte_port_out_ops rte_port_ring_writer_nodrop_ops = {\n", "prefixes": [ "dpdk-dev", "v4", "08/13" ] }{ "id": 5297, "url": "