Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/123447/?format=api
http://patchwork.dpdk.org/api/patches/123447/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230208084507.1328625-6-rjarry@redhat.com/", "project": { "id": 1, "url": "http://patchwork.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": "<20230208084507.1328625-6-rjarry@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230208084507.1328625-6-rjarry@redhat.com", "date": "2023-02-08T08:45:07", "name": "[RESEND,v9,5/5] eal: add lcore usage telemetry endpoint", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "653b0df961aa998f1df6f4d26dcfde82e60c1d19", "submitter": { "id": 2850, "url": "http://patchwork.dpdk.org/api/people/2850/?format=api", "name": "Robin Jarry", "email": "rjarry@redhat.com" }, "delegate": { "id": 24651, "url": "http://patchwork.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230208084507.1328625-6-rjarry@redhat.com/mbox/", "series": [ { "id": 26885, "url": "http://patchwork.dpdk.org/api/series/26885/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=26885", "date": "2023-02-08T08:45:02", "name": "lcore telemetry improvements", "version": 9, "mbox": "http://patchwork.dpdk.org/series/26885/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/123447/comments/", "check": "fail", "checks": "http://patchwork.dpdk.org/api/patches/123447/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 8C7E841C3C;\n\tWed, 8 Feb 2023 09:46:05 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5FE7142BD9;\n\tWed, 8 Feb 2023 09:45:58 +0100 (CET)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by mails.dpdk.org (Postfix) with ESMTP id 136A742C4D\n for <dev@dpdk.org>; Wed, 8 Feb 2023 09:45:56 +0100 (CET)", "from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com\n [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n us-mta-592-6mip5m9EPkK9N_oCvnw4tw-1; Wed, 08 Feb 2023 03:45:49 -0500", "from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com\n [10.11.54.9])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 652B7101A521;\n Wed, 8 Feb 2023 08:45:49 +0000 (UTC)", "from ringo.redhat.com (unknown [10.39.208.30])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 8C50A492C3C;\n Wed, 8 Feb 2023 08:45:48 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1675845956;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=sUIaYtxK64a4+Pe43pleFN9m60Ys9Uhyd8DlUAo1V5k=;\n b=NRmRuGoozzI04v1r5JIUiFgLDwizG1kxkrSEiLQANjkRLHCeYXfPxkPuQaiSZPN9H/LoPn\n 2pPGvX4lJwWOq0QK44PrUmxYm7bgAyskgSvST/m//j0Z+GTAebfwV4FK9CIk3yLdO0/9sd\n yenEqF3B1Q4LZHjurfc60a/q0phPnbY=", "X-MC-Unique": "6mip5m9EPkK9N_oCvnw4tw-1", "From": "Robin Jarry <rjarry@redhat.com>", "To": "dev@dpdk.org", "Cc": "Robin Jarry <rjarry@redhat.com>,\n\tKevin Laatz <kevin.laatz@intel.com>", "Subject": "[RESEND PATCH v9 5/5] eal: add lcore usage telemetry endpoint", "Date": "Wed, 8 Feb 2023 09:45:07 +0100", "Message-Id": "<20230208084507.1328625-6-rjarry@redhat.com>", "In-Reply-To": "<20230208084507.1328625-1-rjarry@redhat.com>", "References": "<20221123102612.1688865-1-rjarry@redhat.com>\n <20230208084507.1328625-1-rjarry@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.1 on 10.11.54.9", "X-Mimecast-Spam-Score": "0", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true", "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" }, "content": "Allow fetching CPU cycles usage for all lcores with a single request.\nThis endpoint is intended for repeated and frequent invocations by\nexternal monitoring systems and therefore returns condensed data.\n\nIt consists of a single dictionary with three keys: \"lcore_ids\",\n\"total_cycles\" and \"busy_cycles\" that are mapped to three arrays of\ninteger values. Each array has the same number of values, one per lcore,\nin the same order.\n\nExample:\n\n --> /eal/lcore/usage\n {\n \"/eal/lcore/usage\": {\n \"lcore_ids\": [\n 4,\n 5\n ],\n \"total_cycles\": [\n 23846845590,\n 23900558914\n ],\n \"busy_cycles\": [\n 21043446682,\n 21448837316\n ]\n }\n }\n\nSigned-off-by: Robin Jarry <rjarry@redhat.com>\nReviewed-by: Kevin Laatz <kevin.laatz@intel.com>\n---\n\nNotes:\n v8 -> v9: Updated with 64 bits integer telemetry functions\n\n doc/guides/rel_notes/release_23_03.rst | 5 ++-\n lib/eal/common/eal_common_lcore.c | 60 ++++++++++++++++++++++++++\n 2 files changed, 63 insertions(+), 2 deletions(-)", "diff": "diff --git a/doc/guides/rel_notes/release_23_03.rst b/doc/guides/rel_notes/release_23_03.rst\nindex 17d38d5ea264..4f2878846829 100644\n--- a/doc/guides/rel_notes/release_23_03.rst\n+++ b/doc/guides/rel_notes/release_23_03.rst\n@@ -57,8 +57,9 @@ New Features\n \n * **Added support for reporting lcore usage in applications.**\n \n- * The ``/eal/lcore/list`` and ``/eal/lcore/info`` telemetry endpoints have\n- been added to provide information similar to ``rte_lcore_dump()``.\n+ * The ``/eal/lcore/list``, ``/eal/lcore/usage`` and ``/eal/lcore/info``\n+ telemetry endpoints have been added to provide information similar to\n+ ``rte_lcore_dump()``.\n * Applications can register a callback at startup via\n ``rte_lcore_register_usage_cb()`` to provide lcore usage information.\n \ndiff --git a/lib/eal/common/eal_common_lcore.c b/lib/eal/common/eal_common_lcore.c\nindex fcda7c50119a..088adb14b4b6 100644\n--- a/lib/eal/common/eal_common_lcore.c\n+++ b/lib/eal/common/eal_common_lcore.c\n@@ -569,6 +569,63 @@ handle_lcore_info(const char *cmd __rte_unused, const char *params, struct rte_t\n \treturn rte_lcore_iterate(lcore_telemetry_info_cb, &info);\n }\n \n+struct lcore_telemetry_usage {\n+\tstruct rte_tel_data *lcore_ids;\n+\tstruct rte_tel_data *total_cycles;\n+\tstruct rte_tel_data *busy_cycles;\n+};\n+\n+static int\n+lcore_telemetry_usage_cb(unsigned int lcore_id, void *arg)\n+{\n+\tstruct lcore_telemetry_usage *u = arg;\n+\tstruct rte_lcore_usage usage;\n+\trte_lcore_usage_cb usage_cb;\n+\n+\t/* The callback may not set all the fields in the structure, so clear it here. */\n+\tmemset(&usage, 0, sizeof(usage));\n+\t/* Guard against concurrent modification of lcore_usage_cb. */\n+\tusage_cb = lcore_usage_cb;\n+\tif (usage_cb != NULL && usage_cb(lcore_id, &usage) == 0) {\n+\t\trte_tel_data_add_array_uint(u->lcore_ids, lcore_id);\n+\t\trte_tel_data_add_array_uint(u->total_cycles, usage.total_cycles);\n+\t\trte_tel_data_add_array_uint(u->busy_cycles, usage.busy_cycles);\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+handle_lcore_usage(const char *cmd __rte_unused,\n+\t\tconst char *params __rte_unused,\n+\t\tstruct rte_tel_data *d)\n+{\n+\tstruct lcore_telemetry_usage usage;\n+\tstruct rte_tel_data *lcore_ids = rte_tel_data_alloc();\n+\tstruct rte_tel_data *total_cycles = rte_tel_data_alloc();\n+\tstruct rte_tel_data *busy_cycles = rte_tel_data_alloc();\n+\n+\tif (!lcore_ids || !total_cycles || !busy_cycles) {\n+\t\trte_tel_data_free(lcore_ids);\n+\t\trte_tel_data_free(total_cycles);\n+\t\trte_tel_data_free(busy_cycles);\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\trte_tel_data_start_dict(d);\n+\trte_tel_data_start_array(lcore_ids, RTE_TEL_UINT_VAL);\n+\trte_tel_data_start_array(total_cycles, RTE_TEL_UINT_VAL);\n+\trte_tel_data_start_array(busy_cycles, RTE_TEL_UINT_VAL);\n+\trte_tel_data_add_dict_container(d, \"lcore_ids\", lcore_ids, 0);\n+\trte_tel_data_add_dict_container(d, \"total_cycles\", total_cycles, 0);\n+\trte_tel_data_add_dict_container(d, \"busy_cycles\", busy_cycles, 0);\n+\tusage.lcore_ids = lcore_ids;\n+\tusage.total_cycles = total_cycles;\n+\tusage.busy_cycles = busy_cycles;\n+\n+\treturn rte_lcore_iterate(lcore_telemetry_usage_cb, &usage);\n+}\n+\n RTE_INIT(lcore_telemetry)\n {\n \trte_telemetry_register_cmd(\n@@ -577,5 +634,8 @@ RTE_INIT(lcore_telemetry)\n \trte_telemetry_register_cmd(\n \t\t\"/eal/lcore/info\", handle_lcore_info,\n \t\t\"Returns lcore info. Parameters: int lcore_id\");\n+\trte_telemetry_register_cmd(\n+\t\t\"/eal/lcore/usage\", handle_lcore_usage,\n+\t\t\"Returns lcore cycles usage. Takes no parameters\");\n }\n #endif /* !RTE_EXEC_ENV_WINDOWS */\n", "prefixes": [ "RESEND", "v9", "5/5" ] }{ "id": 123447, "url": "