Show a patch.

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

{
    "id": 73352,
    "url": "https://patches.dpdk.org/api/patches/73352/",
    "web_url": "https://patches.dpdk.org/patch/73352/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<20200706233231.25881-3-honnappa.nagarahalli@arm.com>",
    "date": "2020-07-06T23:32:31",
    "name": "[v3,3/3] app/testpmd: enable empty polls in burst stats",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "0f346511466216a22fc8416c4c21affcb62b2647",
    "submitter": {
        "id": 1045,
        "url": "https://patches.dpdk.org/api/people/1045/",
        "name": "Honnappa Nagarahalli",
        "email": "honnappa.nagarahalli@arm.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@intel.com"
    },
    "mbox": "https://patches.dpdk.org/patch/73352/mbox/",
    "series": [
        {
            "id": 10827,
            "url": "https://patches.dpdk.org/api/series/10827/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10827",
            "date": "2020-07-06T23:32:29",
            "name": "[v3,1/3] app/testpmd: clock gettime call in throughput calculation",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/10827/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/73352/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/73352/checks/",
    "tags": {},
    "headers": {
        "X-Mailman-Version": "2.1.15",
        "In-Reply-To": "<20200706233231.25881-1-honnappa.nagarahalli@arm.com>",
        "Errors-To": "dev-bounces@dpdk.org",
        "X-Mailer": "git-send-email 2.17.1",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 56EBBA00C5;\n\tTue,  7 Jul 2020 01:32:59 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 89AEF1DC8B;\n\tTue,  7 Jul 2020 01:32:47 +0200 (CEST)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by dpdk.org (Postfix) with ESMTP id 09D801DC93\n for <dev@dpdk.org>; Tue,  7 Jul 2020 01:32:46 +0200 (CEST)",
            "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7D20BC0A;\n Mon,  6 Jul 2020 16:32:45 -0700 (PDT)",
            "from qc2400f-1.austin.arm.com (qc2400f-1.austin.arm.com\n [10.118.12.27])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 669323F718;\n Mon,  6 Jul 2020 16:32:45 -0700 (PDT)"
        ],
        "References": "<20200617144307.9961-1-honnappa.nagarahalli@arm.com>\n <20200706233231.25881-1-honnappa.nagarahalli@arm.com>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<20200706233231.25881-3-honnappa.nagarahalli@arm.com>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Precedence": "list",
        "From": "Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "To": "dev@dpdk.org, honnappa.nagarahalli@arm.com, alialnu@mellanox.com,\n orgerlitz@mellanox.com, wenzhuo.lu@intel.com, beilei.xing@intel.com,\n bernard.iremonger@intel.com, ferruh.yigit@intel.com",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "Date": "Mon,  6 Jul 2020 18:32:31 -0500",
        "Cc": "hemant.agrawal@nxp.com, jerinj@marvell.com, viacheslavo@mellanox.com,\n thomas@monjalon.net, ruifeng.wang@arm.com, phil.yang@arm.com, nd@arm.com",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Subject": "[dpdk-dev] [PATCH v3 3/3] app/testpmd: enable empty polls in burst\n\tstats"
    },
    "content": "The number of empty polls provides information about available\nCPU head room in the presence of continuous polling.\n\nSigned-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>\nReviewed-by: Phil Yang <phil.yang@arm.com>\nReviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>\nReviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>\nTested-by: Phil Yang <phil.yang@arm.com>\nTested-by: Ali Alnubani <alialnu@mellanox.com>\n---\n app/test-pmd/csumonly.c |  5 +--\n app/test-pmd/icmpecho.c |  6 ++--\n app/test-pmd/iofwd.c    |  6 ++--\n app/test-pmd/macfwd.c   |  6 ++--\n app/test-pmd/macswap.c  |  6 ++--\n app/test-pmd/rxonly.c   |  6 ++--\n app/test-pmd/testpmd.c  | 77 +++++++++++++++++++++++------------------\n 7 files changed, 62 insertions(+), 50 deletions(-)",
    "diff": "diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c\nindex 862622379..0a96b24eb 100644\n--- a/app/test-pmd/csumonly.c\n+++ b/app/test-pmd/csumonly.c\n@@ -802,11 +802,12 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)\n \t/* receive a burst of packet */\n \tnb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue, pkts_burst,\n \t\t\t\t nb_pkt_per_burst);\n-\tif (unlikely(nb_rx == 0))\n-\t\treturn;\n #ifdef RTE_TEST_PMD_RECORD_BURST_STATS\n \tfs->rx_burst_stats.pkt_burst_spread[nb_rx]++;\n #endif\n+\tif (unlikely(nb_rx == 0))\n+\t\treturn;\n+\n \tfs->rx_packets += nb_rx;\n \trx_bad_ip_csum = 0;\n \trx_bad_l4_csum = 0;\ndiff --git a/app/test-pmd/icmpecho.c b/app/test-pmd/icmpecho.c\nindex 65aece16c..78e3adf2c 100644\n--- a/app/test-pmd/icmpecho.c\n+++ b/app/test-pmd/icmpecho.c\n@@ -308,12 +308,12 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)\n \t */\n \tnb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue, pkts_burst,\n \t\t\t\t nb_pkt_per_burst);\n-\tif (unlikely(nb_rx == 0))\n-\t\treturn;\n-\n #ifdef RTE_TEST_PMD_RECORD_BURST_STATS\n \tfs->rx_burst_stats.pkt_burst_spread[nb_rx]++;\n #endif\n+\tif (unlikely(nb_rx == 0))\n+\t\treturn;\n+\n \tfs->rx_packets += nb_rx;\n \tnb_replies = 0;\n \tfor (i = 0; i < nb_rx; i++) {\ndiff --git a/app/test-pmd/iofwd.c b/app/test-pmd/iofwd.c\nindex 9dce76efe..22b59bbda 100644\n--- a/app/test-pmd/iofwd.c\n+++ b/app/test-pmd/iofwd.c\n@@ -66,13 +66,13 @@ pkt_burst_io_forward(struct fwd_stream *fs)\n \t */\n \tnb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue,\n \t\t\tpkts_burst, nb_pkt_per_burst);\n+#ifdef RTE_TEST_PMD_RECORD_BURST_STATS\n+\tfs->rx_burst_stats.pkt_burst_spread[nb_rx]++;\n+#endif\n \tif (unlikely(nb_rx == 0))\n \t\treturn;\n \tfs->rx_packets += nb_rx;\n \n-#ifdef RTE_TEST_PMD_RECORD_BURST_STATS\n-\tfs->rx_burst_stats.pkt_burst_spread[nb_rx]++;\n-#endif\n \tnb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue,\n \t\t\tpkts_burst, nb_rx);\n \t/*\ndiff --git a/app/test-pmd/macfwd.c b/app/test-pmd/macfwd.c\nindex d2ebb1105..0a89d94be 100644\n--- a/app/test-pmd/macfwd.c\n+++ b/app/test-pmd/macfwd.c\n@@ -71,12 +71,12 @@ pkt_burst_mac_forward(struct fwd_stream *fs)\n \t */\n \tnb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue, pkts_burst,\n \t\t\t\t nb_pkt_per_burst);\n-\tif (unlikely(nb_rx == 0))\n-\t\treturn;\n-\n #ifdef RTE_TEST_PMD_RECORD_BURST_STATS\n \tfs->rx_burst_stats.pkt_burst_spread[nb_rx]++;\n #endif\n+\tif (unlikely(nb_rx == 0))\n+\t\treturn;\n+\n \tfs->rx_packets += nb_rx;\n \ttxp = &ports[fs->tx_port];\n \ttx_offloads = txp->dev_conf.txmode.offloads;\ndiff --git a/app/test-pmd/macswap.c b/app/test-pmd/macswap.c\nindex 8428c26d8..fbe8cb39e 100644\n--- a/app/test-pmd/macswap.c\n+++ b/app/test-pmd/macswap.c\n@@ -72,12 +72,12 @@ pkt_burst_mac_swap(struct fwd_stream *fs)\n \t */\n \tnb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue, pkts_burst,\n \t\t\t\t nb_pkt_per_burst);\n-\tif (unlikely(nb_rx == 0))\n-\t\treturn;\n-\n #ifdef RTE_TEST_PMD_RECORD_BURST_STATS\n \tfs->rx_burst_stats.pkt_burst_spread[nb_rx]++;\n #endif\n+\tif (unlikely(nb_rx == 0))\n+\t\treturn;\n+\n \tfs->rx_packets += nb_rx;\n \ttxp = &ports[fs->tx_port];\n \ndiff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c\nindex 5c65fc42d..18d59a68d 100644\n--- a/app/test-pmd/rxonly.c\n+++ b/app/test-pmd/rxonly.c\n@@ -63,12 +63,12 @@ pkt_burst_receive(struct fwd_stream *fs)\n \t */\n \tnb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue, pkts_burst,\n \t\t\t\t nb_pkt_per_burst);\n-\tif (unlikely(nb_rx == 0))\n-\t\treturn;\n-\n #ifdef RTE_TEST_PMD_RECORD_BURST_STATS\n \tfs->rx_burst_stats.pkt_burst_spread[nb_rx]++;\n #endif\n+\tif (unlikely(nb_rx == 0))\n+\t\treturn;\n+\n \tfs->rx_packets += nb_rx;\n \tfor (i = 0; i < nb_rx; i++)\n \t\trte_pktmbuf_free(pkts_burst[i]);\ndiff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex 2e1493da2..dc93fd5d2 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -1692,57 +1692,68 @@ init_fwd_streams(void)\n static void\n pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs)\n {\n-\tuint64_t total_burst;\n+\tuint64_t total_burst, sburst;\n \tuint64_t nb_burst;\n-\tuint64_t burst_stats[3];\n-\tuint16_t pktnb_stats[3];\n+\tuint64_t burst_stats[4];\n+\tuint16_t pktnb_stats[4];\n \tuint16_t nb_pkt;\n-\tint burst_percent[3];\n+\tint burst_percent[4], sburstp;\n+\tint i;\n \n \t/*\n \t * First compute the total number of packet bursts and the\n \t * two highest numbers of bursts of the same number of packets.\n \t */\n-\ttotal_burst = 0;\n-\tburst_stats[0] = burst_stats[1] = burst_stats[2] = 0;\n-\tpktnb_stats[0] = pktnb_stats[1] = pktnb_stats[2] = 0;\n-\tfor (nb_pkt = 0; nb_pkt < MAX_PKT_BURST; nb_pkt++) {\n+\tmemset(&burst_stats, 0x0, sizeof(burst_stats));\n+\tmemset(&pktnb_stats, 0x0, sizeof(pktnb_stats));\n+\n+\t/* Show stats for 0 burst size always */\n+\ttotal_burst = pbs->pkt_burst_spread[0];\n+\tburst_stats[0] = pbs->pkt_burst_spread[0];\n+\tpktnb_stats[0] = 0;\n+\n+\t/* Find the next 2 burst sizes with highest occurances. */\n+\tfor (nb_pkt = 1; nb_pkt < MAX_PKT_BURST; nb_pkt++) {\n \t\tnb_burst = pbs->pkt_burst_spread[nb_pkt];\n+\n \t\tif (nb_burst == 0)\n \t\t\tcontinue;\n+\n \t\ttotal_burst += nb_burst;\n-\t\tif (nb_burst > burst_stats[0]) {\n-\t\t\tburst_stats[1] = burst_stats[0];\n-\t\t\tpktnb_stats[1] = pktnb_stats[0];\n-\t\t\tburst_stats[0] = nb_burst;\n-\t\t\tpktnb_stats[0] = nb_pkt;\n-\t\t} else if (nb_burst > burst_stats[1]) {\n+\n+\t\tif (nb_burst > burst_stats[1]) {\n+\t\t\tburst_stats[2] = burst_stats[1];\n+\t\t\tpktnb_stats[2] = pktnb_stats[1];\n \t\t\tburst_stats[1] = nb_burst;\n \t\t\tpktnb_stats[1] = nb_pkt;\n+\t\t} else if (nb_burst > burst_stats[2]) {\n+\t\t\tburst_stats[2] = nb_burst;\n+\t\t\tpktnb_stats[2] = nb_pkt;\n \t\t}\n \t}\n \tif (total_burst == 0)\n \t\treturn;\n-\tburst_percent[0] = (double)burst_stats[0] / total_burst * 100;\n-\tprintf(\"  %s-bursts : %\"PRIu64\" [%d%% of %d pkts\", rx_tx, total_burst,\n-\t       burst_percent[0], (int) pktnb_stats[0]);\n-\tif (burst_stats[0] == total_burst) {\n-\t\tprintf(\"]\\n\");\n-\t\treturn;\n-\t}\n-\tif (burst_stats[0] + burst_stats[1] == total_burst) {\n-\t\tprintf(\" + %d%% of %d pkts]\\n\",\n-\t\t       100 - burst_percent[0], pktnb_stats[1]);\n-\t\treturn;\n-\t}\n-\tburst_percent[1] = (double)burst_stats[1] / total_burst * 100;\n-\tburst_percent[2] = 100 - (burst_percent[0] + burst_percent[1]);\n-\tif ((burst_percent[1] == 0) || (burst_percent[2] == 0)) {\n-\t\tprintf(\" + %d%% of others]\\n\", 100 - burst_percent[0]);\n-\t\treturn;\n+\n+\tprintf(\"  %s-bursts : %\"PRIu64\" [\", rx_tx, total_burst);\n+\tfor (i = 0, sburst = 0, sburstp = 0; i < 4; i++) {\n+\t\tif (i == 3) {\n+\t\t\tprintf(\"%d%% of other]\\n\", 100 - sburstp);\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tsburst += burst_stats[i];\n+\t\tif (sburst == total_burst) {\n+\t\t\tprintf(\"%d%% of %d pkts]\\n\",\n+\t\t\t\t100 - sburstp, (int) pktnb_stats[i]);\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tburst_percent[i] =\n+\t\t\t(double)burst_stats[i] / total_burst * 100;\n+\t\tprintf(\"%d%% of %d pkts + \",\n+\t\t\tburst_percent[i], (int) pktnb_stats[i]);\n+\t\tsburstp += burst_percent[i];\n \t}\n-\tprintf(\" + %d%% of %d pkts + %d%% of others]\\n\",\n-\t       burst_percent[1], (int) pktnb_stats[1], burst_percent[2]);\n }\n #endif /* RTE_TEST_PMD_RECORD_BURST_STATS */\n \n",
    "prefixes": [
        "v3",
        "3/3"
    ]
}