get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 73347,
    "url": "https://patches.dpdk.org/api/patches/73347/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200706205234.8040-9-david.marchand@redhat.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20200706205234.8040-9-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200706205234.8040-9-david.marchand@redhat.com",
    "date": "2020-07-06T20:52:32",
    "name": "[v6,08/10] eal: add lcore iterators",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "bd473e456d823e5dceaa3a2835b65b0252e8d06f",
    "submitter": {
        "id": 1173,
        "url": "https://patches.dpdk.org/api/people/1173/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@redhat.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200706205234.8040-9-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 10826,
            "url": "https://patches.dpdk.org/api/series/10826/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10826",
            "date": "2020-07-06T20:52:25",
            "name": "Register non-EAL threads as lcore",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/10826/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/73347/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/73347/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id E6906A00C5;\n\tMon,  6 Jul 2020 22:54:13 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C28911DDE0;\n\tMon,  6 Jul 2020 22:53:38 +0200 (CEST)",
            "from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com\n [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 5D0691DDC9\n for <dev@dpdk.org>; Mon,  6 Jul 2020 22:53:37 +0200 (CEST)",
            "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id\n us-mta-244-kEaT6eYBMiaahPznRIzMMQ-1; Mon, 06 Jul 2020 16:53:33 -0400",
            "from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com\n [10.5.11.22])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6FEA380040C;\n Mon,  6 Jul 2020 20:53:31 +0000 (UTC)",
            "from dmarchan.remote.csb (unknown [10.40.195.188])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 9C57B10013D7;\n Mon,  6 Jul 2020 20:53:26 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1594068816;\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=lP/RlyO0gO14dK15+pFMq13vKAYGtDwpOmN5W2Dopxc=;\n b=ap4Twm/LnpNY6EWJlEodnaQNt8tgrXkq9F0/9ShtQAVM9EIc6+lIXqTOmYMDVi5ugctmsZ\n uqfC2iMxbl13L/cfl/tEzjloLg5+tsuk4LzVUojVwLKKsrsohY9W/L+oLYdbjZvggOu+Uf\n WsuduMlpdC7DdUPEU5torI1mzGMROqM=",
        "X-MC-Unique": "kEaT6eYBMiaahPznRIzMMQ-1",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "jerinjacobk@gmail.com, bruce.richardson@intel.com, mdr@ashroe.eu,\n thomas@monjalon.net, arybchenko@solarflare.com, ktraynor@redhat.com,\n ian.stokes@intel.com, i.maximets@ovn.org, olivier.matz@6wind.com,\n konstantin.ananyev@intel.com, Neil Horman <nhorman@tuxdriver.com>",
        "Date": "Mon,  6 Jul 2020 22:52:32 +0200",
        "Message-Id": "<20200706205234.8040-9-david.marchand@redhat.com>",
        "In-Reply-To": "<20200706205234.8040-1-david.marchand@redhat.com>",
        "References": "<20200610144506.30505-1-david.marchand@redhat.com>\n <20200706205234.8040-1-david.marchand@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.84 on 10.5.11.22",
        "Authentication-Results": "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Type": "text/plain; charset=US-ASCII",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v6 08/10] eal: add lcore iterators",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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": "Add a helper to iterate all lcores.\nThe iterator callback is read-only wrt the lcores list.\n\nImplement a dump function on top of this for debugging.\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\nReviewed-by: Olivier Matz <olivier.matz@6wind.com>\n---\nChanges since v2:\n- added rte_lcore_dump calls in unit test, for basic check,\n\nChanges since v1:\n- introduced lcore iterators and implemented rte_lcore_dump,\n  this iterator mechanism can then be used outside of EAL,\n\n---\n app/test/test_lcores.c                    |  3 +\n lib/librte_eal/common/eal_common_lcore.c  | 77 ++++++++++++++++++++---\n lib/librte_eal/common/eal_common_thread.c | 16 +++--\n lib/librte_eal/common/eal_thread.h        | 13 +++-\n lib/librte_eal/freebsd/eal.c              |  2 +-\n lib/librte_eal/freebsd/eal_thread.c       |  2 +-\n lib/librte_eal/include/rte_lcore.h        | 47 +++++++++++++-\n lib/librte_eal/linux/eal.c                |  2 +-\n lib/librte_eal/linux/eal_thread.c         |  2 +-\n lib/librte_eal/rte_eal_version.map        |  2 +\n 10 files changed, 143 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/app/test/test_lcores.c b/app/test/test_lcores.c\nindex 7df827b4e8..19a7ab9fce 100644\n--- a/app/test/test_lcores.c\n+++ b/app/test/test_lcores.c\n@@ -303,6 +303,7 @@ test_non_eal_lcores_callback(unsigned int eal_threads_count)\n \t\t\tl[0].uninit, l[1].uninit);\n \t\tgoto cleanup_threads;\n \t}\n+\trte_lcore_dump(stdout);\n \t/* Release all threads, and check their states. */\n \t__atomic_store_n(&registered_count, 0, __ATOMIC_RELEASE);\n \tret = 0;\n@@ -314,6 +315,7 @@ test_non_eal_lcores_callback(unsigned int eal_threads_count)\n \t}\n \tif (ret < 0)\n \t\tgoto error;\n+\trte_lcore_dump(stdout);\n \tif (l[0].uninit != 2 || l[1].uninit != 1) {\n \t\tprintf(\"Error: threads reported having successfully registered and unregistered, but incorrect uninit calls, expected 2, 1, got %u, %u\\n\",\n \t\t\tl[0].uninit, l[1].uninit);\n@@ -354,6 +356,7 @@ test_lcores(void)\n \t}\n \tprintf(\"EAL threads count: %u, RTE_MAX_LCORE=%u\\n\", eal_threads_count,\n \t\tRTE_MAX_LCORE);\n+\trte_lcore_dump(stdout);\n \n \tif (test_non_eal_lcores(eal_threads_count) < 0)\n \t\treturn TEST_FAILED;\ndiff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/common/eal_common_lcore.c\nindex 90139c77ff..f2bd30c70a 100644\n--- a/lib/librte_eal/common/eal_common_lcore.c\n+++ b/lib/librte_eal/common/eal_common_lcore.c\n@@ -12,7 +12,7 @@\n #include <rte_errno.h>\n #include <rte_lcore.h>\n #include <rte_log.h>\n-#include <rte_spinlock.h>\n+#include <rte_rwlock.h>\n \n #include \"eal_memcfg.h\"\n #include \"eal_private.h\"\n@@ -223,7 +223,7 @@ rte_socket_id_by_idx(unsigned int idx)\n \treturn config->numa_nodes[idx];\n }\n \n-static rte_spinlock_t lcore_lock = RTE_SPINLOCK_INITIALIZER;\n+static rte_rwlock_t lcore_lock = RTE_RWLOCK_INITIALIZER;\n struct lcore_callback {\n \tTAILQ_ENTRY(lcore_callback) next;\n \tchar *name;\n@@ -281,7 +281,7 @@ rte_lcore_callback_register(const char *name, rte_lcore_init_cb init,\n \tcallback->init = init;\n \tcallback->uninit = uninit;\n \tcallback->arg = arg;\n-\trte_spinlock_lock(&lcore_lock);\n+\trte_rwlock_write_lock(&lcore_lock);\n \tif (callback->init == NULL)\n \t\tgoto no_init;\n \tfor (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {\n@@ -307,7 +307,7 @@ rte_lcore_callback_register(const char *name, rte_lcore_init_cb init,\n \t\tcallback->name, callback->init == NULL ? \"NO \" : \"\",\n \t\tcallback->uninit == NULL ? \"NO \" : \"\");\n out:\n-\trte_spinlock_unlock(&lcore_lock);\n+\trte_rwlock_write_unlock(&lcore_lock);\n \treturn callback;\n }\n \n@@ -318,7 +318,7 @@ rte_lcore_callback_unregister(void *handle)\n \tstruct lcore_callback *callback = handle;\n \tunsigned int lcore_id;\n \n-\trte_spinlock_lock(&lcore_lock);\n+\trte_rwlock_write_lock(&lcore_lock);\n \tif (callback->uninit == NULL)\n \t\tgoto no_uninit;\n \tfor (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {\n@@ -328,7 +328,7 @@ rte_lcore_callback_unregister(void *handle)\n \t}\n no_uninit:\n \tTAILQ_REMOVE(&lcore_callbacks, callback, next);\n-\trte_spinlock_unlock(&lcore_lock);\n+\trte_rwlock_write_unlock(&lcore_lock);\n \tRTE_LOG(DEBUG, EAL, \"Unregistered lcore callback %s-%p.\\n\",\n \t\tcallback->name, callback->arg);\n \tfree_callback(callback);\n@@ -342,7 +342,7 @@ eal_lcore_non_eal_allocate(void)\n \tstruct lcore_callback *prev;\n \tunsigned int lcore_id;\n \n-\trte_spinlock_lock(&lcore_lock);\n+\trte_rwlock_write_lock(&lcore_lock);\n \tfor (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {\n \t\tif (cfg->lcore_role[lcore_id] != ROLE_OFF)\n \t\t\tcontinue;\n@@ -373,7 +373,7 @@ eal_lcore_non_eal_allocate(void)\n \t\tgoto out;\n \t}\n out:\n-\trte_spinlock_unlock(&lcore_lock);\n+\trte_rwlock_write_unlock(&lcore_lock);\n \treturn lcore_id;\n }\n \n@@ -383,7 +383,7 @@ eal_lcore_non_eal_release(unsigned int lcore_id)\n \tstruct rte_config *cfg = rte_eal_get_configuration();\n \tstruct lcore_callback *callback;\n \n-\trte_spinlock_lock(&lcore_lock);\n+\trte_rwlock_write_lock(&lcore_lock);\n \tif (cfg->lcore_role[lcore_id] != ROLE_NON_EAL)\n \t\tgoto out;\n \tTAILQ_FOREACH(callback, &lcore_callbacks, next)\n@@ -391,5 +391,62 @@ eal_lcore_non_eal_release(unsigned int lcore_id)\n \tcfg->lcore_role[lcore_id] = ROLE_OFF;\n \tcfg->lcore_count--;\n out:\n-\trte_spinlock_unlock(&lcore_lock);\n+\trte_rwlock_write_unlock(&lcore_lock);\n+}\n+\n+int\n+rte_lcore_iterate(rte_lcore_iterate_cb cb, void *arg)\n+{\n+\tstruct rte_config *cfg = rte_eal_get_configuration();\n+\tunsigned int lcore_id;\n+\tint ret = 0;\n+\n+\trte_rwlock_read_lock(&lcore_lock);\n+\tfor (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {\n+\t\tif (cfg->lcore_role[lcore_id] == ROLE_OFF)\n+\t\t\tcontinue;\n+\t\tret = cb(lcore_id, arg);\n+\t\tif (ret != 0)\n+\t\t\tbreak;\n+\t}\n+\trte_rwlock_read_unlock(&lcore_lock);\n+\treturn ret;\n+}\n+\n+static int\n+lcore_dump_cb(unsigned int lcore_id, void *arg)\n+{\n+\tstruct rte_config *cfg = rte_eal_get_configuration();\n+\tchar cpuset[RTE_CPU_AFFINITY_STR_LEN];\n+\tconst char *role;\n+\tFILE *f = arg;\n+\tint ret;\n+\n+\tswitch (cfg->lcore_role[lcore_id]) {\n+\tcase ROLE_RTE:\n+\t\trole = \"RTE\";\n+\t\tbreak;\n+\tcase ROLE_SERVICE:\n+\t\trole = \"SERVICE\";\n+\t\tbreak;\n+\tcase ROLE_NON_EAL:\n+\t\trole = \"NON_EAL\";\n+\t\tbreak;\n+\tdefault:\n+\t\trole = \"UNKNOWN\";\n+\t\tbreak;\n+\t}\n+\n+\tret = eal_thread_dump_affinity(&lcore_config[lcore_id].cpuset, cpuset,\n+\t\tsizeof(cpuset));\n+\tfprintf(f, \"lcore %u, socket %u, role %s, cpuset %s%s\\n\", lcore_id,\n+\t\trte_lcore_to_socket_id(lcore_id), role, cpuset,\n+\t\tret == 0 ? \"\" : \"...\");\n+\treturn 0;\n+}\n+\n+void\n+rte_lcore_dump(FILE *f)\n+{\n+\trte_lcore_iterate(lcore_dump_cb, f);\n }\ndiff --git a/lib/librte_eal/common/eal_common_thread.c b/lib/librte_eal/common/eal_common_thread.c\nindex cead8ea5cf..ea09a4f3e0 100644\n--- a/lib/librte_eal/common/eal_common_thread.c\n+++ b/lib/librte_eal/common/eal_common_thread.c\n@@ -105,17 +105,14 @@ rte_thread_get_affinity(rte_cpuset_t *cpusetp)\n }\n \n int\n-eal_thread_dump_affinity(char *str, unsigned size)\n+eal_thread_dump_affinity(rte_cpuset_t *cpuset, char *str, unsigned int size)\n {\n-\trte_cpuset_t cpuset;\n \tunsigned cpu;\n \tint ret;\n \tunsigned int out = 0;\n \n-\trte_thread_get_affinity(&cpuset);\n-\n \tfor (cpu = 0; cpu < CPU_SETSIZE; cpu++) {\n-\t\tif (!CPU_ISSET(cpu, &cpuset))\n+\t\tif (!CPU_ISSET(cpu, cpuset))\n \t\t\tcontinue;\n \n \t\tret = snprintf(str + out,\n@@ -138,6 +135,15 @@ eal_thread_dump_affinity(char *str, unsigned size)\n \treturn ret;\n }\n \n+int\n+eal_thread_dump_current_affinity(char *str, unsigned int size)\n+{\n+\trte_cpuset_t cpuset;\n+\n+\trte_thread_get_affinity(&cpuset);\n+\treturn eal_thread_dump_affinity(&cpuset, str, size);\n+}\n+\n void\n __rte_thread_init(unsigned int lcore_id, rte_cpuset_t *cpuset)\n {\ndiff --git a/lib/librte_eal/common/eal_thread.h b/lib/librte_eal/common/eal_thread.h\nindex dc1fc6eb99..4a49117be8 100644\n--- a/lib/librte_eal/common/eal_thread.h\n+++ b/lib/librte_eal/common/eal_thread.h\n@@ -32,13 +32,15 @@ unsigned eal_cpu_socket_id(unsigned cpu_id);\n #define RTE_CPU_AFFINITY_STR_LEN            256\n \n /**\n- * Dump the current pthread cpuset.\n+ * Dump the cpuset as a human readable string.\n  * This function is private to EAL.\n  *\n  * Note:\n  *   If the dump size is greater than the size of given buffer,\n  *   the string will be truncated and with '\\0' at the end.\n  *\n+ * @param cpuset\n+ *   The CPU affinity object to dump.\n  * @param str\n  *   The string buffer the cpuset will dump to.\n  * @param size\n@@ -47,6 +49,13 @@ unsigned eal_cpu_socket_id(unsigned cpu_id);\n  *   0 for success, -1 if truncation happens.\n  */\n int\n-eal_thread_dump_affinity(char *str, unsigned size);\n+eal_thread_dump_affinity(rte_cpuset_t *cpuset, char *str, unsigned int size);\n+\n+/**\n+ * Dump the current thread cpuset.\n+ * This is a wrapper on eal_thread_dump_affinity().\n+ */\n+int\n+eal_thread_dump_current_affinity(char *str, unsigned int size);\n \n #endif /* EAL_THREAD_H */\ndiff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c\nindex 7e5001a864..7d6f4aa09b 100644\n--- a/lib/librte_eal/freebsd/eal.c\n+++ b/lib/librte_eal/freebsd/eal.c\n@@ -858,7 +858,7 @@ rte_eal_init(int argc, char **argv)\n \t__rte_thread_init(config->master_lcore,\n \t\t&lcore_config[config->master_lcore].cpuset);\n \n-\tret = eal_thread_dump_affinity(cpuset, sizeof(cpuset));\n+\tret = eal_thread_dump_current_affinity(cpuset, sizeof(cpuset));\n \n \tRTE_LOG(DEBUG, EAL, \"Master lcore %u is ready (tid=%p;cpuset=[%s%s])\\n\",\n \t\tconfig->master_lcore, thread_id, cpuset,\ndiff --git a/lib/librte_eal/freebsd/eal_thread.c b/lib/librte_eal/freebsd/eal_thread.c\nindex 0788a54fe6..99b5fefc4c 100644\n--- a/lib/librte_eal/freebsd/eal_thread.c\n+++ b/lib/librte_eal/freebsd/eal_thread.c\n@@ -92,7 +92,7 @@ eal_thread_loop(__rte_unused void *arg)\n \n \t__rte_thread_init(lcore_id, &lcore_config[lcore_id].cpuset);\n \n-\tret = eal_thread_dump_affinity(cpuset, sizeof(cpuset));\n+\tret = eal_thread_dump_current_affinity(cpuset, sizeof(cpuset));\n \tRTE_LOG(DEBUG, EAL, \"lcore %u is ready (tid=%p;cpuset=[%s%s])\\n\",\n \t\tlcore_id, thread_id, cpuset, ret == 0 ? \"\" : \"...\");\n \ndiff --git a/lib/librte_eal/include/rte_lcore.h b/lib/librte_eal/include/rte_lcore.h\nindex 6e7206c79f..b8b64a6252 100644\n--- a/lib/librte_eal/include/rte_lcore.h\n+++ b/lib/librte_eal/include/rte_lcore.h\n@@ -261,8 +261,8 @@ typedef void (*rte_lcore_uninit_cb)(unsigned int lcore_id, void *arg);\n  * If this step succeeds, the callbacks are put in the lcore callbacks list\n  * that will get called for each lcore allocation/release.\n  *\n- * Note: callbacks execution is serialised under a lock protecting the lcores\n- * and callbacks list.\n+ * Note: callbacks execution is serialised under a write lock protecting the\n+ * lcores and callbacks list.\n  *\n  * @param name\n  *   A name serving as a small description for this callback.\n@@ -299,6 +299,49 @@ __rte_experimental\n void\n rte_lcore_callback_unregister(void *handle);\n \n+/**\n+ * Callback prototype for iterating over lcores.\n+ *\n+ * @param lcore_id\n+ *   The lcore to consider.\n+ * @param arg\n+ *   An opaque pointer coming from the caller.\n+ * @return\n+ *   - 0 lets the iteration continue.\n+ *   - !0 makes the iteration stop.\n+ */\n+typedef int (*rte_lcore_iterate_cb)(unsigned int lcore_id, void *arg);\n+\n+/**\n+ * Iterate on all active lcores (ROLE_RTE, ROLE_SERVICE and ROLE_NON_EAL).\n+ * No modification on the lcore states is allowed in the callback.\n+ *\n+ * Note: as opposed to init/uninit callbacks, iteration callbacks can be\n+ * invoked in parallel as they are run under a read lock protecting the lcores\n+ * and callbacks list.\n+ *\n+ * @param cb\n+ *   The callback that gets passed each lcore.\n+ * @param arg\n+ *   An opaque pointer passed to cb.\n+ * @return\n+ *   Same return code as the callback last invocation (see rte_lcore_iterate_cb\n+ *   description).\n+ */\n+__rte_experimental\n+int\n+rte_lcore_iterate(rte_lcore_iterate_cb cb, void *arg);\n+\n+/**\n+ * List all lcores.\n+ *\n+ * @param f\n+ *   The output stream where the dump should be sent.\n+ */\n+__rte_experimental\n+void\n+rte_lcore_dump(FILE *f);\n+\n /**\n  * Set core affinity of the current thread.\n  * Support both EAL and non-EAL thread and update TLS.\ndiff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c\nindex f4daf46c4e..2cce19dd3d 100644\n--- a/lib/librte_eal/linux/eal.c\n+++ b/lib/librte_eal/linux/eal.c\n@@ -1197,7 +1197,7 @@ rte_eal_init(int argc, char **argv)\n \t__rte_thread_init(config->master_lcore,\n \t\t&lcore_config[config->master_lcore].cpuset);\n \n-\tret = eal_thread_dump_affinity(cpuset, sizeof(cpuset));\n+\tret = eal_thread_dump_current_affinity(cpuset, sizeof(cpuset));\n \tRTE_LOG(DEBUG, EAL, \"Master lcore %u is ready (tid=%zx;cpuset=[%s%s])\\n\",\n \t\tconfig->master_lcore, (uintptr_t)thread_id, cpuset,\n \t\tret == 0 ? \"\" : \"...\");\ndiff --git a/lib/librte_eal/linux/eal_thread.c b/lib/librte_eal/linux/eal_thread.c\nindex e0440c0000..48a2c1124b 100644\n--- a/lib/librte_eal/linux/eal_thread.c\n+++ b/lib/librte_eal/linux/eal_thread.c\n@@ -92,7 +92,7 @@ eal_thread_loop(__rte_unused void *arg)\n \n \t__rte_thread_init(lcore_id, &lcore_config[lcore_id].cpuset);\n \n-\tret = eal_thread_dump_affinity(cpuset, sizeof(cpuset));\n+\tret = eal_thread_dump_current_affinity(cpuset, sizeof(cpuset));\n \tRTE_LOG(DEBUG, EAL, \"lcore %u is ready (tid=%zx;cpuset=[%s%s])\\n\",\n \t\tlcore_id, (uintptr_t)thread_id, cpuset, ret == 0 ? \"\" : \"...\");\n \ndiff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map\nindex c3e762c1d9..3aeb5b11ab 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -397,6 +397,8 @@ EXPERIMENTAL {\n \t# added in 20.08\n \trte_lcore_callback_register;\n \trte_lcore_callback_unregister;\n+\trte_lcore_dump;\n+\trte_lcore_iterate;\n \trte_thread_register;\n \trte_thread_unregister;\n };\n",
    "prefixes": [
        "v6",
        "08/10"
    ]
}