Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/122565/?format=api
http://patchwork.dpdk.org/api/patches/122565/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230126152045.1036904-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": "<20230126152045.1036904-6-rjarry@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230126152045.1036904-6-rjarry@redhat.com", "date": "2023-01-26T15:20:45", "name": "[v7,5/5] eal: add lcore usage telemetry endpoint", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "c450c8982264b639ea42e52c1dd38b1808b2b01f", "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/20230126152045.1036904-6-rjarry@redhat.com/mbox/", "series": [ { "id": 26659, "url": "http://patchwork.dpdk.org/api/series/26659/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=26659", "date": "2023-01-26T15:20:40", "name": "lcore telemetry improvements", "version": 7, "mbox": "http://patchwork.dpdk.org/series/26659/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/122565/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/122565/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 8E61C42493;\n\tThu, 26 Jan 2023 16:21:15 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5F20E42D6C;\n\tThu, 26 Jan 2023 16:21:02 +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 1454042D66\n for <dev@dpdk.org>; Thu, 26 Jan 2023 16:21:00 +0100 (CET)", "from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com\n [66.187.233.73]) 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-590-BYagIHh_PxK_l96l4QTMLw-1; Thu, 26 Jan 2023 10:20:57 -0500", "from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com\n [10.11.54.4])\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 CD0F22999B36;\n Thu, 26 Jan 2023 15:20:56 +0000 (UTC)", "from ringo.redhat.com (unknown [10.39.208.33])\n by smtp.corp.redhat.com (Postfix) with ESMTP id C890C2026D76;\n Thu, 26 Jan 2023 15:20:55 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1674746460;\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=qwhcxyevgxU1Jf1aoDqkpOOUWE4mIYv35INWPJr6RSk=;\n b=b0kks1/7iH0eAnovyTUnKAnEVbrAfUFCyuq2nt2vrK61wF6q/qJaaPPpxFZQcm0QLx1i6F\n 95SxHVIbr8uy7a3uysaZ8xB0eR0xVdUPV6/tdPDyTIKUQ2MXASMiG7QbvDkCc1HfuWDylO\n BZvYZTrdFkqmJAtY/0Ztbf/y5sfy9d4=", "X-MC-Unique": "BYagIHh_PxK_l96l4QTMLw-1", "From": "Robin Jarry <rjarry@redhat.com>", "To": "dev@dpdk.org", "Cc": "Robin Jarry <rjarry@redhat.com>,\n =?utf-8?q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com>,\n Kevin Laatz <kevin.laatz@intel.com>", "Subject": "[PATCH v7 5/5] eal: add lcore usage telemetry endpoint", "Date": "Thu, 26 Jan 2023 16:20:45 +0100", "Message-Id": "<20230126152045.1036904-6-rjarry@redhat.com>", "In-Reply-To": "<20230126152045.1036904-1-rjarry@redhat.com>", "References": "<20230126152045.1036904-1-rjarry@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.1 on 10.11.54.4", "X-Mimecast-Spam-Score": "0", "X-Mimecast-Originator": "redhat.com", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "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\nCc: Morten Brørup <mb@smartsharesystems.com>\nSigned-off-by: Robin Jarry <rjarry@redhat.com>\nReviewed-by: Kevin Laatz <kevin.laatz@intel.com>\n---\n\nNotes:\n v7:\n \n * Indentation fix\n * Added release notes entry\n\n doc/guides/rel_notes/release_23_03.rst | 5 +-\n lib/eal/common/eal_common_lcore.c | 64 ++++++++++++++++++++++++++\n 2 files changed, 67 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 4c84d16a5f7e..3da483cf65f3 100644\n--- a/doc/guides/rel_notes/release_23_03.rst\n+++ b/doc/guides/rel_notes/release_23_03.rst\n@@ -71,8 +71,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 4cc29ea6272f..d84852a23d68 100644\n--- a/lib/eal/common/eal_common_lcore.c\n+++ b/lib/eal/common/eal_common_lcore.c\n@@ -573,6 +573,67 @@ 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/*\n+\t * Guard against concurrent modification of lcore_usage_cb.\n+\t * rte_lcore_register_usage_cb() should only be called once at application init\n+\t * but nothing prevents and application to reset the callback to NULL.\n+\t */\n+\tusage_cb = lcore_usage_cb;\n+\tif (usage_cb != NULL && usage_cb(lcore_id, &usage) == 0) {\n+\t\trte_tel_data_add_array_int(u->lcore_ids, lcore_id);\n+\t\trte_tel_data_add_array_u64(u->total_cycles, usage.total_cycles);\n+\t\trte_tel_data_add_array_u64(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_INT_VAL);\n+\trte_tel_data_start_array(total_cycles, RTE_TEL_U64_VAL);\n+\trte_tel_data_start_array(busy_cycles, RTE_TEL_U64_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@@ -581,5 +642,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": [ "v7", "5/5" ] }{ "id": 122565, "url": "