get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/17016/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 17016,
    "url": "https://patches.dpdk.org/api/patches/17016/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1479194120-6917-4-git-send-email-remy.horton@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": "<1479194120-6917-4-git-send-email-remy.horton@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1479194120-6917-4-git-send-email-remy.horton@intel.com",
    "date": "2016-11-15T07:15:20",
    "name": "[dpdk-dev,v4,3/3] app/test-pmd: add support for bitrate statistics",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "dcb15377408bbe81d8059e4c2baf31eb5759d2c8",
    "submitter": {
        "id": 326,
        "url": "https://patches.dpdk.org/api/people/326/?format=api",
        "name": "Remy Horton",
        "email": "remy.horton@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1479194120-6917-4-git-send-email-remy.horton@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/17016/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/17016/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 7DD5E47D1;\n\tTue, 15 Nov 2016 08:15:56 +0100 (CET)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby dpdk.org (Postfix) with ESMTP id EA1F23772\n\tfor <dev@dpdk.org>; Tue, 15 Nov 2016 08:15:25 +0100 (CET)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga104.jf.intel.com with ESMTP; 14 Nov 2016 23:15:25 -0800",
            "from rhorton-mobl.ger.corp.intel.com (HELO VM.sh.intel.com)\n\t([10.239.205.185])\n\tby orsmga003.jf.intel.com with ESMTP; 14 Nov 2016 23:15:24 -0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.31,641,1473145200\"; d=\"scan'208\";a=\"901497641\"",
        "From": "Remy Horton <remy.horton@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas.monjalon@6wind.com",
        "Date": "Tue, 15 Nov 2016 15:15:20 +0800",
        "Message-Id": "<1479194120-6917-4-git-send-email-remy.horton@intel.com>",
        "X-Mailer": "git-send-email 2.5.5",
        "In-Reply-To": "<1479194120-6917-1-git-send-email-remy.horton@intel.com>",
        "References": "<1479194120-6917-1-git-send-email-remy.horton@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v4 3/3] app/test-pmd: add support for bitrate\n\tstatistics",
        "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": "Signed-off-by: Remy Horton <remy.horton@intel.com>\n---\n app/test-pmd/testpmd.c | 36 ++++++++++++++++++++++++++++++++++++\n 1 file changed, 36 insertions(+)",
    "diff": "diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex a0332c2..60c635f 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -78,6 +78,10 @@\n #ifdef RTE_LIBRTE_PDUMP\n #include <rte_pdump.h>\n #endif\n+#include <rte_metrics.h>\n+#ifdef RTE_LIBRTE_BITRATE\n+#include <rte_bitrate.h>\n+#endif\n \n #include \"testpmd.h\"\n \n@@ -322,6 +326,9 @@ uint16_t nb_rx_queue_stats_mappings = 0;\n \n unsigned max_socket = 0;\n \n+/* Bitrate statistics */\n+struct rte_stats_bitrates_s *bitrate_data;\n+\n /* Forward function declarations */\n static void map_port_queue_stats_mapping_registers(uint8_t pi, struct rte_port *port);\n static void check_all_ports_link_status(uint32_t port_mask);\n@@ -921,12 +928,32 @@ run_pkt_fwd_on_lcore(struct fwd_lcore *fc, packet_fwd_t pkt_fwd)\n \tstruct fwd_stream **fsm;\n \tstreamid_t nb_fs;\n \tstreamid_t sm_id;\n+#ifdef RTE_LIBRTE_BITRATE\n+\tuint64_t tics_per_1sec;\n+\tuint64_t tics_datum;\n+\tuint64_t tics_current;\n+\tuint8_t idx_port, cnt_ports;\n+#endif\n \n+#ifdef RTE_LIBRTE_BITRATE\n+\tcnt_ports = rte_eth_dev_count();\n+\ttics_datum = rte_rdtsc();\n+\ttics_per_1sec = rte_get_timer_hz();\n+#endif\n \tfsm = &fwd_streams[fc->stream_idx];\n \tnb_fs = fc->stream_nb;\n \tdo {\n \t\tfor (sm_id = 0; sm_id < nb_fs; sm_id++)\n \t\t\t(*pkt_fwd)(fsm[sm_id]);\n+#ifdef RTE_LIBRTE_BITRATE\n+\t\ttics_current = rte_rdtsc();\n+\t\tif (tics_current - tics_datum >= tics_per_1sec) {\n+\t\t\t/* Periodic bitrate calculation */\n+\t\t\tfor (idx_port = 0; idx_port < cnt_ports; idx_port++)\n+\t\t\t\trte_stats_bitrate_calc(bitrate_data, idx_port);\n+\t\t\ttics_datum = tics_current;\n+\t\t}\n+#endif\n \t} while (! fc->stopped);\n }\n \n@@ -2133,6 +2160,15 @@ main(int argc, char** argv)\n \tFOREACH_PORT(port_id, ports)\n \t\trte_eth_promiscuous_enable(port_id);\n \n+\t/* Setup bitrate stats */\n+#ifdef RTE_LIBRTE_BITRATE\n+\tbitrate_data = rte_stats_bitrate_create();\n+\tif (bitrate_data == NULL)\n+\t\trte_exit(EXIT_FAILURE, \"Could not allocate bitrate data.\\n\");\n+\trte_stats_bitrate_reg(bitrate_data);\n+#endif\n+\n+\n #ifdef RTE_LIBRTE_CMDLINE\n \tif (interactive == 1) {\n \t\tif (auto_start) {\n",
    "prefixes": [
        "dpdk-dev",
        "v4",
        "3/3"
    ]
}