get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 87892,
    "url": "http://patches.dpdk.org/api/patches/87892/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210212165814.2189305-3-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": "<20210212165814.2189305-3-harry.van.haaren@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210212165814.2189305-3-harry.van.haaren@intel.com",
    "date": "2021-02-12T16:58:14",
    "name": "[v3,3/3] event/sw: add xstat for work done in last iteration",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "781803ac51ed973764ef8437d218c76305028ebf",
    "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/20210212165814.2189305-3-harry.van.haaren@intel.com/mbox/",
    "series": [
        {
            "id": 15254,
            "url": "http://patches.dpdk.org/api/series/15254/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=15254",
            "date": "2021-02-12T16:58:12",
            "name": "[v3,1/3] service: add component useful work attribute",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/15254/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/87892/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/87892/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id CB861A0547;\n\tFri, 12 Feb 2021 17:58:40 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id BB0BF22A2BC;\n\tFri, 12 Feb 2021 17:58:28 +0100 (CET)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n by mails.dpdk.org (Postfix) with ESMTP id 1A1A722A2B8\n for <dev@dpdk.org>; Fri, 12 Feb 2021 17:58:25 +0100 (CET)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 12 Feb 2021 08:58:25 -0800",
            "from silpixa00400633.ir.intel.com ([10.237.213.44])\n by orsmga003.jf.intel.com with ESMTP; 12 Feb 2021 08:58:24 -0800"
        ],
        "IronPort-SDR": [
            "\n yncuD85GOA49GxNkulVdo5HvqbD3UdOoR7EoP6n/t4yGWWrRQKg7T9qz1ZQ2qKlK0tysa4GgFE\n 3euucRb5y8/w==",
            "\n GYi78azw4NcIVKImxVkoGSIu9QqfTaIhdH9CqWuD41LK+LsekTRSWj7P3J0jx0iVk/qqj/0yWp\n ht6Rd0FYk6IA=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9893\"; a=\"182511463\"",
            "E=Sophos;i=\"5.81,174,1610438400\"; d=\"scan'208\";a=\"182511463\"",
            "E=Sophos;i=\"5.81,174,1610438400\"; d=\"scan'208\";a=\"360466465\""
        ],
        "X-ExtLoop1": "1",
        "From": "Harry van Haaren <harry.van.haaren@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "david.marchand@redhat.com, mattias.ronnblom@ericsson.com,\n honnappa.nagarahalli@arm.com, Harry van Haaren <harry.van.haaren@intel.com>",
        "Date": "Fri, 12 Feb 2021 16:58:14 +0000",
        "Message-Id": "<20210212165814.2189305-3-harry.van.haaren@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210212165814.2189305-1-harry.van.haaren@intel.com>",
        "References": "<20210212165814.2189305-1-harry.van.haaren@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 3/3] event/sw: add xstat for work done in last\n iteration",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "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>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@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>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Today it is difficult to know what Eventdev ports recieved work\nfrom the scheduling core. Sometimes it is useful to know where\nwork has been scheduled.\n\nThis patch implements an xstat for the SW PMD, which provides a\nbitmask of ports that were scheduled to. If the SW PMD instance\nhas more than 64 ports, always report that a port got an event.\n\nSigned-off-by: Harry van Haaren <harry.van.haaren@intel.com>\n\n---\n\nNote most of the changes here are unit-test changes to add\na statistic to the PMD. The actual \"useful code\" is a mere\nhandful of lines in a lot of noise.. could split into 2 patches?\n---\n drivers/event/sw/sw_evdev.h           |  1 +\n drivers/event/sw/sw_evdev_scheduler.c | 12 ++++++++++++\n drivers/event/sw/sw_evdev_selftest.c  | 27 ++++++++++++++-------------\n drivers/event/sw/sw_evdev_xstats.c    |  6 +++++-\n 4 files changed, 32 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/drivers/event/sw/sw_evdev.h b/drivers/event/sw/sw_evdev.h\nindex 5ab6465c83..5dfa4508b3 100644\n--- a/drivers/event/sw/sw_evdev.h\n+++ b/drivers/event/sw/sw_evdev.h\n@@ -259,6 +259,7 @@ struct sw_evdev {\n \tuint64_t sched_no_iq_enqueues;\n \tuint64_t sched_no_cq_enqueues;\n \tuint64_t sched_cq_qid_called;\n+\tuint64_t sched_last_iter_bitmask;\n \n \tuint8_t started;\n \tuint32_t credit_update_quanta;\ndiff --git a/drivers/event/sw/sw_evdev_scheduler.c b/drivers/event/sw/sw_evdev_scheduler.c\nindex c78f687446..3ee1188be0 100644\n--- a/drivers/event/sw/sw_evdev_scheduler.c\n+++ b/drivers/event/sw/sw_evdev_scheduler.c\n@@ -566,6 +566,8 @@ sw_event_schedule(struct rte_eventdev *dev)\n \trte_service_component_attr_set(sw->service_id,\n \t\t\tRTE_SERVICE_ATTR_USEFUL_WORK_LAST_ITER, work_done);\n \n+\tuint64_t cqs_scheds_last_iter = 0;\n+\n \t/* push all the internal buffered QEs in port->cq_ring to the\n \t * worker cores: aka, do the ring transfers batched.\n \t */\n@@ -585,6 +587,7 @@ sw_event_schedule(struct rte_eventdev *dev)\n \t\t\t\t\t&sw->cq_ring_space[i]);\n \t\t\tport->cq_buf_count = 0;\n \t\t\tno_enq = 0;\n+\t\t\tcqs_scheds_last_iter |= (1ULL << i);\n \t\t} else {\n \t\t\tsw->cq_ring_space[i] =\n \t\t\t\t\trte_event_ring_free_count(worker) -\n@@ -604,4 +607,13 @@ sw_event_schedule(struct rte_eventdev *dev)\n \t\t\tsw->sched_min_burst = sw->sched_min_burst_size;\n \t}\n \n+\t/* Provide stats on what eventdev ports were scheduled to this\n+\t * iteration. If more than 64 ports are active, always report that\n+\t * all Eventdev ports have been scheduled events.\n+\t */\n+\tif (likely(sw->port_count < 64)) {\n+\t\tsw->sched_last_iter_bitmask = cqs_scheds_last_iter;\n+\t} else {\n+\t\tsw->sched_last_iter_bitmask = UINT64_MAX;\n+\t}\n }\ndiff --git a/drivers/event/sw/sw_evdev_selftest.c b/drivers/event/sw/sw_evdev_selftest.c\nindex e4bfb3a0f1..7dd35cb22e 100644\n--- a/drivers/event/sw/sw_evdev_selftest.c\n+++ b/drivers/event/sw/sw_evdev_selftest.c\n@@ -873,15 +873,15 @@ xstats_tests(struct test *t)\n \tint ret = rte_event_dev_xstats_names_get(evdev,\n \t\t\t\t\tRTE_EVENT_DEV_XSTATS_DEVICE,\n \t\t\t\t\t0, xstats_names, ids, XSTATS_MAX);\n-\tif (ret != 6) {\n-\t\tprintf(\"%d: expected 6 stats, got return %d\\n\", __LINE__, ret);\n+\tif (ret != 7) {\n+\t\tprintf(\"%d: expected 7 stats, got return %d\\n\", __LINE__, ret);\n \t\treturn -1;\n \t}\n \tret = rte_event_dev_xstats_get(evdev,\n \t\t\t\t\tRTE_EVENT_DEV_XSTATS_DEVICE,\n \t\t\t\t\t0, ids, values, ret);\n-\tif (ret != 6) {\n-\t\tprintf(\"%d: expected 6 stats, got return %d\\n\", __LINE__, ret);\n+\tif (ret != 7) {\n+\t\tprintf(\"%d: expected 7 stats, got return %d\\n\", __LINE__, ret);\n \t\treturn -1;\n \t}\n \n@@ -959,7 +959,7 @@ xstats_tests(struct test *t)\n \tret = rte_event_dev_xstats_get(evdev,\n \t\t\t\t\tRTE_EVENT_DEV_XSTATS_DEVICE,\n \t\t\t\t\t0, ids, values, num_stats);\n-\tstatic const uint64_t expected[] = {3, 3, 0, 1, 0, 0};\n+\tstatic const uint64_t expected[] = {3, 3, 0, 1, 0, 0, 4};\n \tfor (i = 0; (signed int)i < ret; i++) {\n \t\tif (expected[i] != values[i]) {\n \t\t\tprintf(\n@@ -975,7 +975,7 @@ xstats_tests(struct test *t)\n \t\t\t\t\t0, NULL, 0);\n \n \t/* ensure reset statistics are zero-ed */\n-\tstatic const uint64_t expected_zero[] = {0, 0, 0, 0, 0, 0};\n+\tstatic const uint64_t expected_zero[] = {0, 0, 0, 0, 0, 0, 0};\n \tret = rte_event_dev_xstats_get(evdev,\n \t\t\t\t\tRTE_EVENT_DEV_XSTATS_DEVICE,\n \t\t\t\t\t0, ids, values, num_stats);\n@@ -1460,7 +1460,7 @@ xstats_id_reset_tests(struct test *t)\n \tfor (i = 0; i < XSTATS_MAX; i++)\n \t\tids[i] = i;\n \n-#define NUM_DEV_STATS 6\n+#define NUM_DEV_STATS 7\n \t/* Device names / values */\n \tint num_stats = rte_event_dev_xstats_names_get(evdev,\n \t\t\t\t\tRTE_EVENT_DEV_XSTATS_DEVICE,\n@@ -1504,8 +1504,9 @@ xstats_id_reset_tests(struct test *t)\n \tstatic const char * const dev_names[] = {\n \t\t\"dev_rx\", \"dev_tx\", \"dev_drop\", \"dev_sched_calls\",\n \t\t\"dev_sched_no_iq_enq\", \"dev_sched_no_cq_enq\",\n+\t\t\"dev_sched_last_iter_bitmask\",\n \t};\n-\tuint64_t dev_expected[] = {NPKTS, NPKTS, 0, 1, 0, 0};\n+\tuint64_t dev_expected[] = {NPKTS, NPKTS, 0, 1, 0, 0, 4};\n \tfor (i = 0; (int)i < ret; i++) {\n \t\tunsigned int id;\n \t\tuint64_t val = rte_event_dev_xstats_by_name_get(evdev,\n@@ -1518,8 +1519,8 @@ xstats_id_reset_tests(struct test *t)\n \t\t}\n \t\tif (val != dev_expected[i]) {\n \t\t\tprintf(\"%d: %s value incorrect, expected %\"\n-\t\t\t\tPRIu64\" got %d\\n\", __LINE__, dev_names[i],\n-\t\t\t\tdev_expected[i], id);\n+\t\t\t\tPRIu64\" got %ld\\n\", __LINE__, dev_names[i],\n+\t\t\t\tdev_expected[i], val);\n \t\t\tgoto fail;\n \t\t}\n \t\t/* reset to zero */\n@@ -1542,11 +1543,11 @@ xstats_id_reset_tests(struct test *t)\n \t\t}\n \t};\n \n-/* 48 is stat offset from start of the devices whole xstats.\n+/* 49 is stat offset from start of the devices whole xstats.\n  * This WILL break every time we add a statistic to a port\n  * or the device, but there is no other way to test\n  */\n-#define PORT_OFF 48\n+#define PORT_OFF 49\n /* num stats for the tested port. CQ size adds more stats to a port */\n #define NUM_PORT_STATS 21\n /* the port to test. */\n@@ -1670,7 +1671,7 @@ xstats_id_reset_tests(struct test *t)\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-#define QUEUE_OFF 90\n+#define QUEUE_OFF 91\n \tconst uint32_t queue = 0;\n \tnum_stats = rte_event_dev_xstats_names_get(evdev,\n \t\t\t\t\tRTE_EVENT_DEV_XSTATS_QUEUE, queue,\ndiff --git a/drivers/event/sw/sw_evdev_xstats.c b/drivers/event/sw/sw_evdev_xstats.c\nindex 02f7874180..1b0ad68414 100644\n--- a/drivers/event/sw/sw_evdev_xstats.c\n+++ b/drivers/event/sw/sw_evdev_xstats.c\n@@ -17,6 +17,7 @@ enum xstats_type {\n \t/* device instance specific */\n \tno_iq_enq,\n \tno_cq_enq,\n+\tsched_last_iter_bitmask,\n \t/* port_specific */\n \trx_used,\n \trx_free,\n@@ -57,6 +58,8 @@ get_dev_stat(const struct sw_evdev *sw, uint16_t obj_idx __rte_unused,\n \tcase calls: return sw->sched_called;\n \tcase no_iq_enq: return sw->sched_no_iq_enqueues;\n \tcase no_cq_enq: return sw->sched_no_cq_enqueues;\n+\tcase sched_last_iter_bitmask: return sw->sched_last_iter_bitmask;\n+\n \tdefault: return -1;\n \t}\n }\n@@ -177,9 +180,10 @@ sw_xstats_init(struct sw_evdev *sw)\n \t */\n \tstatic const char * const dev_stats[] = { \"rx\", \"tx\", \"drop\",\n \t\t\t\"sched_calls\", \"sched_no_iq_enq\", \"sched_no_cq_enq\",\n+\t\t\t\"sched_last_iter_bitmask\",\n \t};\n \tstatic const enum xstats_type dev_types[] = { rx, tx, dropped,\n-\t\t\tcalls, no_iq_enq, no_cq_enq,\n+\t\t\tcalls, no_iq_enq, no_cq_enq, sched_last_iter_bitmask,\n \t};\n \t/* all device stats are allowed to be reset */\n \n",
    "prefixes": [
        "v3",
        "3/3"
    ]
}