get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 24229,
    "url": "http://patches.dpdk.org/api/patches/24229/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1494496586-57161-1-git-send-email-harry.van.haaren@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": "<1494496586-57161-1-git-send-email-harry.van.haaren@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1494496586-57161-1-git-send-email-harry.van.haaren@intel.com",
    "date": "2017-05-11T09:56:26",
    "name": "[dpdk-dev] event/sw: add queue-to-port stats",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "37e43ce7a5f6cc334ff86931164f85897570840a",
    "submitter": {
        "id": 317,
        "url": "http://patches.dpdk.org/api/people/317/?format=api",
        "name": "Van Haaren, Harry",
        "email": "harry.van.haaren@intel.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1494496586-57161-1-git-send-email-harry.van.haaren@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/24229/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/24229/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 BC8EE2E83;\n\tThu, 11 May 2017 11:56:27 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 28E4D282\n\tfor <dev@dpdk.org>; Thu, 11 May 2017 11:56:25 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t11 May 2017 02:56:24 -0700",
            "from silpixa00398672.ir.intel.com ([10.237.223.128])\n\tby fmsmga001.fm.intel.com with ESMTP; 11 May 2017 02:56:23 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.38,323,1491289200\"; d=\"scan'208\";\n\ta=\"1146558226\"",
        "From": "Harry van Haaren <harry.van.haaren@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "jerin.jacob@caviumnetworks.com,\n\tHarry van Haaren <harry.van.haaren@intel.com>",
        "Date": "Thu, 11 May 2017 10:56:26 +0100",
        "Message-Id": "<1494496586-57161-1-git-send-email-harry.van.haaren@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "Subject": "[dpdk-dev] [PATCH] event/sw: add queue-to-port stats",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <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": "This patch targets the next-eventdev tree.\n\nThis commit adds a new statistic to the SW eventdev PMD.\nThe statistic shows how many packets were sent from a\nqueue to a port. This provides information on how traffic\nfrom a specific queue is being load-balanced to worker cores.\n\nNote that these numbers should be compared across all queue\nstages - the load-balancing does not try to perfectly share\neach queue's traffic, rather it balances the overall traffic\nfrom all queues to the ports.\n\nThe statistic is printed from the rte_eventdev_dump() function,\nas well as being made available via the xstats API.\n\nUnit tests have been updated to expect more per-queue statistics,\nand the correctness of counts and counts after reset is verified.\n\nSigned-off-by: Harry van Haaren <harry.van.haaren@intel.com>\n---\n drivers/event/sw/sw_evdev.c           | 13 ++++-----\n drivers/event/sw/sw_evdev.h           |  1 +\n drivers/event/sw/sw_evdev_scheduler.c |  1 +\n drivers/event/sw/sw_evdev_xstats.c    | 13 ++++++---\n test/test/test_eventdev_sw.c          | 51 ++++++++++++++++++++++-------------\n 5 files changed, 52 insertions(+), 27 deletions(-)",
    "diff": "diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c\nindex a31aaa6..7f69e38 100644\n--- a/drivers/event/sw/sw_evdev.c\n+++ b/drivers/event/sw/sw_evdev.c\n@@ -559,12 +559,13 @@ sw_dump(struct rte_eventdev *dev, FILE *f)\n \t\t\t\tinflights += qid->fids[flow].pcount;\n \t\t\t}\n \n-\t\tuint32_t cq;\n-\t\tfprintf(f, \"\\tInflights: %u\\tFlows pinned per port: \",\n-\t\t\t\tinflights);\n-\t\tfor (cq = 0; cq < sw->port_count; cq++)\n-\t\t\tfprintf(f, \"%d \", affinities_per_port[cq]);\n-\t\tfprintf(f, \"\\n\");\n+\t\tuint32_t port;\n+\t\tfprintf(f, \"\\tPer Port Stats:\\n\");\n+\t\tfor (port = 0; port < sw->port_count; port++) {\n+\t\t\tfprintf(f, \"\\t  Port %d: Pkts: %\"PRIu64, port,\n+\t\t\t\t\tqid->to_port[port]);\n+\t\t\tfprintf(f, \"\\tFlows: %d\\n\", affinities_per_port[port]);\n+\t\t}\n \n \t\tuint32_t iq;\n \t\tuint32_t iq_printed = 0;\ndiff --git a/drivers/event/sw/sw_evdev.h b/drivers/event/sw/sw_evdev.h\nindex 61c671d..b3929f4 100644\n--- a/drivers/event/sw/sw_evdev.h\n+++ b/drivers/event/sw/sw_evdev.h\n@@ -149,6 +149,7 @@ struct sw_qid {\n \tuint32_t cq_num_mapped_cqs;\n \tuint32_t cq_next_tx; /* cq to write next (non-atomic) packet */\n \tuint32_t cq_map[SW_PORTS_MAX];\n+\tuint64_t to_port[SW_PORTS_MAX];\n \n \t/* Track flow ids for atomic load balancing */\n \tstruct sw_fid_t fids[SW_QID_NUM_FIDS];\ndiff --git a/drivers/event/sw/sw_evdev_scheduler.c b/drivers/event/sw/sw_evdev_scheduler.c\nindex a333a6f..4688652 100644\n--- a/drivers/event/sw/sw_evdev_scheduler.c\n+++ b/drivers/event/sw/sw_evdev_scheduler.c\n@@ -119,6 +119,7 @@ sw_schedule_atomic_to_cq(struct sw_evdev *sw, struct sw_qid * const qid,\n \n \t\tp->stats.tx_pkts++;\n \t\tqid->stats.tx_pkts++;\n+\t\tqid->to_port[cq]++;\n \n \t\t/* if we just filled in the last slot, flush the buffer */\n \t\tif (sw->cq_ring_space[cq] == 0) {\ndiff --git a/drivers/event/sw/sw_evdev_xstats.c b/drivers/event/sw/sw_evdev_xstats.c\nindex c7b1abe..7b66fbb 100644\n--- a/drivers/event/sw/sw_evdev_xstats.c\n+++ b/drivers/event/sw/sw_evdev_xstats.c\n@@ -57,6 +57,7 @@ enum xstats_type {\n \tiq_used,\n \t/* qid port mapping specific */\n \tpinned,\n+\tpkts, /* note: qid-to-port pkts */\n };\n \n typedef uint64_t (*xstats_fn)(const struct sw_evdev *dev,\n@@ -179,6 +180,8 @@ get_qid_port_stat(const struct sw_evdev *sw, uint16_t obj_idx,\n \t\t\treturn pin;\n \t\t} while (0);\n \t\tbreak;\n+\tcase pkts:\n+\t\treturn qid->to_port[port];\n \tdefault: return -1;\n \t}\n }\n@@ -246,8 +249,11 @@ sw_xstats_init(struct sw_evdev *sw)\n \tstatic const enum xstats_type qid_iq_types[] = { iq_used };\n \t/* reset allowed */\n \n-\tstatic const char * const qid_port_stats[] = { \"pinned_flows\" };\n-\tstatic const enum xstats_type qid_port_types[] = { pinned };\n+\tstatic const char * const qid_port_stats[] = { \"pinned_flows\",\n+\t\t\"packets\"\n+\t};\n+\tstatic const enum xstats_type qid_port_types[] = { pinned, pkts };\n+\tstatic const uint8_t qid_port_reset_allowed[] = {0, 1};\n \t/* reset allowed */\n \t/* ---- end of stat definitions ---- */\n \n@@ -376,7 +382,8 @@ sw_xstats_init(struct sw_evdev *sw)\n \t\t\t\t\t.stat = qid_port_types[i],\n \t\t\t\t\t.mode = RTE_EVENT_DEV_XSTATS_QUEUE,\n \t\t\t\t\t.extra_arg = port,\n-\t\t\t\t\t.reset_allowed = 0,\n+\t\t\t\t\t.reset_allowed =\n+\t\t\t\t\t\tqid_port_reset_allowed[i],\n \t\t\t\t};\n \t\t\t\tsnprintf(sname, sizeof(sname),\n \t\t\t\t\t\t\"qid_%u_port_%u_%s\",\ndiff --git a/test/test/test_eventdev_sw.c b/test/test/test_eventdev_sw.c\nindex b187d02..c37e345 100644\n--- a/test/test/test_eventdev_sw.c\n+++ b/test/test/test_eventdev_sw.c\n@@ -877,8 +877,8 @@ xstats_tests(struct test *t)\n \tret = rte_event_dev_xstats_names_get(evdev,\n \t\t\t\t\tRTE_EVENT_DEV_XSTATS_QUEUE,\n \t\t\t\t\t0, xstats_names, ids, XSTATS_MAX);\n-\tif (ret != 13) {\n-\t\tprintf(\"%d: expected 13 stats, got return %d\\n\", __LINE__, ret);\n+\tif (ret != 17) {\n+\t\tprintf(\"%d: expected 17 stats, got return %d\\n\", __LINE__, ret);\n \t\treturn -1;\n \t}\n \n@@ -894,8 +894,8 @@ xstats_tests(struct test *t)\n \tret = rte_event_dev_xstats_get(evdev,\n \t\t\t\t\tRTE_EVENT_DEV_XSTATS_QUEUE,\n \t\t\t\t\t0, ids, values, ret);\n-\tif (ret != 13) {\n-\t\tprintf(\"%d: expected 13 stats, got return %d\\n\", __LINE__, ret);\n+\tif (ret != 17) {\n+\t\tprintf(\"%d: expected 17 stats, got return %d\\n\", __LINE__, ret);\n \t\treturn -1;\n \t}\n \n@@ -1059,7 +1059,11 @@ xstats_tests(struct test *t)\n \t\t3 /* inflights */,\n \t\t512 /* iq size */,\n \t\t0, 0, 0, 0, /* iq 0, 1, 2, 3 used */\n-\t\t0, 0, 1, 0, /* qid_0_port_X_pinned_flows */\n+\t\t/* QID-to-Port: pinned_flows, packets */\n+\t\t0, 0,\n+\t\t0, 0,\n+\t\t1, 3,\n+\t\t0, 0,\n \t};\n \tfor (i = 0; (signed int)i < ret; i++) {\n \t\tif (queue_expected[i] != values[i]) {\n@@ -1086,7 +1090,11 @@ xstats_tests(struct test *t)\n \t\t3 /* inflight */,\n \t\t512 /* iq size */,\n \t\t0, 0, 0, 0, /* 4 iq used */\n-\t\t0, 0, 1, 0, /* qid to port pinned flows */\n+\t\t/* QID-to-Port: pinned_flows, packets */\n+\t\t0, 0,\n+\t\t0, 0,\n+\t\t1, 0,\n+\t\t0, 0,\n \t};\n \n \tret = rte_event_dev_xstats_get(evdev, RTE_EVENT_DEV_XSTATS_QUEUE, 0,\n@@ -1634,7 +1642,7 @@ xstats_id_reset_tests(struct test *t)\n \t\tgoto fail;\n \n /* num queue stats */\n-#define NUM_Q_STATS 13\n+#define NUM_Q_STATS 17\n /* queue offset from start of the devices whole xstats.\n  * This will break every time we add a statistic to a device/port/queue\n  */\n@@ -1665,9 +1673,13 @@ xstats_id_reset_tests(struct test *t)\n \t\t\"qid_0_iq_2_used\",\n \t\t\"qid_0_iq_3_used\",\n \t\t\"qid_0_port_0_pinned_flows\",\n+\t\t\"qid_0_port_0_packets\",\n \t\t\"qid_0_port_1_pinned_flows\",\n+\t\t\"qid_0_port_1_packets\",\n \t\t\"qid_0_port_2_pinned_flows\",\n+\t\t\"qid_0_port_2_packets\",\n \t\t\"qid_0_port_3_pinned_flows\",\n+\t\t\"qid_0_port_3_packets\",\n \t};\n \tuint64_t queue_expected[] = {\n \t\t7, /* rx */\n@@ -1679,10 +1691,11 @@ xstats_id_reset_tests(struct test *t)\n \t\t0, /* iq 1 used */\n \t\t0, /* iq 2 used */\n \t\t0, /* iq 3 used */\n-\t\t0, /* qid 0 port 0 pinned flows */\n-\t\t0, /* qid 0 port 1 pinned flows */\n-\t\t1, /* qid 0 port 2 pinned flows */\n-\t\t0, /* qid 0 port 4 pinned flows */\n+\t\t/* QID-to-Port: pinned_flows, packets */\n+\t\t0, 0,\n+\t\t0, 0,\n+\t\t1, 7,\n+\t\t0, 0,\n \t};\n \tuint64_t queue_expected_zero[] = {\n \t\t0, /* rx */\n@@ -1694,12 +1707,14 @@ xstats_id_reset_tests(struct test *t)\n \t\t0, /* iq 1 used */\n \t\t0, /* iq 2 used */\n \t\t0, /* iq 3 used */\n-\t\t0, /* qid 0 port 0 pinned flows */\n-\t\t0, /* qid 0 port 1 pinned flows */\n-\t\t1, /* qid 0 port 2 pinned flows */\n-\t\t0, /* qid 0 port 4 pinned flows */\n+\t\t/* QID-to-Port: pinned_flows, packets */\n+\t\t0, 0,\n+\t\t0, 0,\n+\t\t1, 0,\n+\t\t0, 0,\n \t};\n \tif (RTE_DIM(queue_expected) != NUM_Q_STATS ||\n+\t\t\tRTE_DIM(queue_expected_zero) != NUM_Q_STATS ||\n \t\t\tRTE_DIM(queue_names) != NUM_Q_STATS) {\n \t\tprintf(\"%d : queue array of wrong size\\n\", __LINE__);\n \t\tgoto fail;\n@@ -1718,9 +1733,9 @@ xstats_id_reset_tests(struct test *t)\n \t\t\tfailed = 1;\n \t\t}\n \t\tif (val != queue_expected[i]) {\n-\t\t\tprintf(\"%d: %s value incorrect, expected %\"PRIu64\n-\t\t\t\t\" got %d\\n\", __LINE__, queue_names[i],\n-\t\t\t\tqueue_expected[i], id);\n+\t\t\tprintf(\"%d: %d: %s value , expected %\"PRIu64\n+\t\t\t\t\" got %\"PRIu64\"\\n\", i, __LINE__,\n+\t\t\t\tqueue_names[i], queue_expected[i], val);\n \t\t\tfailed = 1;\n \t\t}\n \t\t/* reset to zero */\n",
    "prefixes": [
        "dpdk-dev"
    ]
}