get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 88423,
    "url": "http://patches.dpdk.org/api/patches/88423/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210303105643.2552378-1-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": "<20210303105643.2552378-1-harry.van.haaren@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210303105643.2552378-1-harry.van.haaren@intel.com",
    "date": "2021-03-03T10:56:43",
    "name": "[v4] event/sw: add xstats to expose progress details",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9f91737e2b6a86a40b434985794348d508ce5182",
    "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/20210303105643.2552378-1-harry.van.haaren@intel.com/mbox/",
    "series": [
        {
            "id": 15475,
            "url": "http://patches.dpdk.org/api/series/15475/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=15475",
            "date": "2021-03-03T10:56:43",
            "name": "[v4] event/sw: add xstats to expose progress details",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/15475/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/88423/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/88423/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 5CAB7A0561;\n\tWed,  3 Mar 2021 11:57:02 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D96C740683;\n\tWed,  3 Mar 2021 11:57:01 +0100 (CET)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n by mails.dpdk.org (Postfix) with ESMTP id 878324067B\n for <dev@dpdk.org>; Wed,  3 Mar 2021 11:57:00 +0100 (CET)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 03 Mar 2021 02:56:59 -0800",
            "from silpixa00400633.ir.intel.com ([10.237.213.44])\n by fmsmga001.fm.intel.com with ESMTP; 03 Mar 2021 02:56:57 -0800"
        ],
        "IronPort-SDR": [
            "\n 0ynk5aBOUMp7EKy3fuxLWWxBirP4K0BxS2MZj6G1z5qIOJjD6cmVbQWYhorjUVZ8dE77ZPLU2s\n he+vdElrdaqw==",
            "\n ky9MDBKs0JfGEVKAGsQucnijMBVnd8UkrKIx4DA9kFmOdThRtTvLF061q1eHT88T064RzJDWN3\n k417YjWvnQuw=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9911\"; a=\"248573984\"",
            "E=Sophos;i=\"5.81,219,1610438400\"; d=\"scan'208\";a=\"248573984\"",
            "E=Sophos;i=\"5.81,219,1610438400\"; d=\"scan'208\";a=\"506750884\""
        ],
        "X-ExtLoop1": "1",
        "From": "Harry van Haaren <harry.van.haaren@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "david.marchand@redhat.com, mattias.ronnblom@ericcson.com,\n jerinj@marvell.com, Harry van Haaren <harry.van.haaren@intel.com>",
        "Date": "Wed,  3 Mar 2021 10:56:43 +0000",
        "Message-Id": "<20210303105643.2552378-1-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 v4] event/sw: add xstats to expose progress\n details",
        "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 if the SW Eventdev PMD is making\nforward progress when it runs an iteration of its service. This\ncommit adds two xstats to give better visibility to the application.\n\nThe new xstats provide an application with which Eventdev ports\nrecieved work in the last iteration of scheduling, as well if\nforward progress was made by the scheduler.\n\nThis patch implements an xstat for the SW PMD that exposes a\nbitmask of ports that were scheduled to. In the unlikely case\nthat the SW PMD instance has 64 or more ports, return UINT64_MAX.\n\nSigned-off-by: Harry van Haaren <harry.van.haaren@intel.com>\n\n---\n\nv3:\n- Simplify all metrics to Event SW PMD\n\nv2:\n- Fixup printf() %ld to PRIu64\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.\n\n---\n drivers/event/sw/sw_evdev.h           |  2 ++\n drivers/event/sw/sw_evdev_scheduler.c | 15 ++++++++++++++\n drivers/event/sw/sw_evdev_selftest.c  | 28 ++++++++++++++-------------\n drivers/event/sw/sw_evdev_xstats.c    |  9 ++++++++-\n 4 files changed, 40 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/drivers/event/sw/sw_evdev.h b/drivers/event/sw/sw_evdev.h\nindex 5ab6465c83..33645bd1df 100644\n--- a/drivers/event/sw/sw_evdev.h\n+++ b/drivers/event/sw/sw_evdev.h\n@@ -259,6 +259,8 @@ 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+\tuint8_t sched_progress_last_iter;\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 f747b3c6d4..d3a6bd5cda 100644\n--- a/drivers/event/sw/sw_evdev_scheduler.c\n+++ b/drivers/event/sw/sw_evdev_scheduler.c\n@@ -559,6 +559,11 @@ sw_event_schedule(struct rte_eventdev *dev)\n \tsw->sched_no_iq_enqueues += (in_pkts_total == 0);\n \tsw->sched_no_cq_enqueues += (out_pkts_total == 0);\n \n+\tuint64_t work_done = (in_pkts_total + out_pkts_total) != 0;\n+\tsw->sched_progress_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@@ -578,6 +583,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@@ -597,4 +603,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..d53e903129 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 != 8) {\n+\t\tprintf(\"%d: expected 8 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 != 8) {\n+\t\tprintf(\"%d: expected 8 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, 1};\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, 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 8\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,10 @@ 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\t\"dev_sched_progress_last_iter\"\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, 1};\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 +1520,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 %\"PRIu64\"\\n\", __LINE__,\n+\t\t\t\tdev_names[i], dev_expected[i], val);\n \t\t\tgoto fail;\n \t\t}\n \t\t/* reset to zero */\n@@ -1542,11 +1544,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 50\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 +1672,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 92\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..c2647d7da2 100644\n--- a/drivers/event/sw/sw_evdev_xstats.c\n+++ b/drivers/event/sw/sw_evdev_xstats.c\n@@ -17,6 +17,8 @@ enum xstats_type {\n \t/* device instance specific */\n \tno_iq_enq,\n \tno_cq_enq,\n+\tsched_last_iter_bitmask,\n+\tsched_progress_last_iter,\n \t/* port_specific */\n \trx_used,\n \trx_free,\n@@ -57,6 +59,9 @@ 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+\tcase sched_progress_last_iter: return sw->sched_progress_last_iter;\n+\n \tdefault: return -1;\n \t}\n }\n@@ -177,9 +182,11 @@ 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\", \"sched_progress_last_iter\",\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\t\tsched_progress_last_iter,\n \t};\n \t/* all device stats are allowed to be reset */\n \n",
    "prefixes": [
        "v4"
    ]
}