Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/124492/?format=api
https://patches.dpdk.org/api/patches/124492/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230224081642.2566619-4-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": "<20230224081642.2566619-4-david.marchand@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230224081642.2566619-4-david.marchand@redhat.com", "date": "2023-02-24T08:16:31", "name": "[03/14] mem: annotate shared memory config locks", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "4b5001a56b3d18f69a852f66ec5df92d61a8fe83", "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/20230224081642.2566619-4-david.marchand@redhat.com/mbox/", "series": [ { "id": 27167, "url": "https://patches.dpdk.org/api/series/27167/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=27167", "date": "2023-02-24T08:16:28", "name": "Enable lock annotations on most libraries and drivers", "version": 1, "mbox": "https://patches.dpdk.org/series/27167/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/124492/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/124492/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 22F5E41D5D;\n\tFri, 24 Feb 2023 09:17:07 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7B22A410F1;\n\tFri, 24 Feb 2023 09:17:04 +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 30795410F1\n for <dev@dpdk.org>; Fri, 24 Feb 2023 09:17:03 +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-208-WR9MZYMnN1GsLgdxjCdpow-1; Fri, 24 Feb 2023 03:17:01 -0500", "from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com\n [10.11.54.10])\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 E5C063C02527;\n Fri, 24 Feb 2023 08:17:00 +0000 (UTC)", "from dmarchan.redhat.com (unknown [10.45.224.55])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 50376492B12;\n Fri, 24 Feb 2023 08:17:00 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1677226622;\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=gQ5HUTQpfDDrIZYwaCxEkd4HqKlqmxIwNPnv2uQQzBc=;\n b=G6qiKOUcYasllJwUoCqmQRuY6XeERQcWdpTgIGNiho4BaJUBK4j7qtJIXl5NZsKBh0BCrl\n y6ZIL89HwXiXqrX7CEAYdamd4sw2CjOx6prnGa80O8leIqbQJGwTfDaAgbyBjHlPNFJunc\n XB0ATlOq5cnotTv6nmbFoeXj28f2HGs=", "X-MC-Unique": "WR9MZYMnN1GsLgdxjCdpow-1", "From": "David Marchand <david.marchand@redhat.com>", "To": "dev@dpdk.org", "Cc": "thomas@monjalon.net", "Subject": "[PATCH 03/14] mem: annotate shared memory config locks", "Date": "Fri, 24 Feb 2023 09:16:31 +0100", "Message-Id": "<20230224081642.2566619-4-david.marchand@redhat.com>", "In-Reply-To": "<20230224081642.2566619-1-david.marchand@redhat.com>", "References": "<20230224081642.2566619-1-david.marchand@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.1 on 10.11.54.10", "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": "Expose internal locks via some internal accessors.\nThen annotate rte_mcfg_xxx_(read|write)_(|un)lock.\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\n---\n lib/eal/common/eal_common_mcfg.c | 66 +++++++++++++++++------------\n lib/eal/include/rte_eal_memconfig.h | 63 +++++++++++++++++++++------\n lib/eal/version.map | 4 ++\n 3 files changed, 91 insertions(+), 42 deletions(-)", "diff": "diff --git a/lib/eal/common/eal_common_mcfg.c b/lib/eal/common/eal_common_mcfg.c\nindex cf4a279905..b60d41f7b6 100644\n--- a/lib/eal/common/eal_common_mcfg.c\n+++ b/lib/eal/common/eal_common_mcfg.c\n@@ -69,102 +69,112 @@ eal_mcfg_update_from_internal(void)\n \tmcfg->version = RTE_VERSION;\n }\n \n+rte_rwlock_t *\n+rte_mcfg_mem_get_lock(void)\n+{\n+\treturn &rte_eal_get_configuration()->mem_config->memory_hotplug_lock;\n+}\n+\n void\n rte_mcfg_mem_read_lock(void)\n {\n-\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n-\trte_rwlock_read_lock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_read_lock(rte_mcfg_mem_get_lock());\n }\n \n void\n rte_mcfg_mem_read_unlock(void)\n {\n-\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n-\trte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_read_unlock(rte_mcfg_mem_get_lock());\n }\n \n void\n rte_mcfg_mem_write_lock(void)\n {\n-\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n-\trte_rwlock_write_lock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_write_lock(rte_mcfg_mem_get_lock());\n }\n \n void\n rte_mcfg_mem_write_unlock(void)\n {\n-\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n-\trte_rwlock_write_unlock(&mcfg->memory_hotplug_lock);\n+\trte_rwlock_write_unlock(rte_mcfg_mem_get_lock());\n+}\n+\n+rte_rwlock_t *\n+rte_mcfg_tailq_get_lock(void)\n+{\n+\treturn &rte_eal_get_configuration()->mem_config->qlock;\n }\n \n void\n rte_mcfg_tailq_read_lock(void)\n {\n-\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n-\trte_rwlock_read_lock(&mcfg->qlock);\n+\trte_rwlock_read_lock(rte_mcfg_tailq_get_lock());\n }\n \n void\n rte_mcfg_tailq_read_unlock(void)\n {\n-\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n-\trte_rwlock_read_unlock(&mcfg->qlock);\n+\trte_rwlock_read_unlock(rte_mcfg_tailq_get_lock());\n }\n \n void\n rte_mcfg_tailq_write_lock(void)\n {\n-\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n-\trte_rwlock_write_lock(&mcfg->qlock);\n+\trte_rwlock_write_lock(rte_mcfg_tailq_get_lock());\n }\n \n void\n rte_mcfg_tailq_write_unlock(void)\n {\n-\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n-\trte_rwlock_write_unlock(&mcfg->qlock);\n+\trte_rwlock_write_unlock(rte_mcfg_tailq_get_lock());\n+}\n+\n+rte_rwlock_t *\n+rte_mcfg_mempool_get_lock(void)\n+{\n+\treturn &rte_eal_get_configuration()->mem_config->mplock;\n }\n \n void\n rte_mcfg_mempool_read_lock(void)\n {\n-\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n-\trte_rwlock_read_lock(&mcfg->mplock);\n+\trte_rwlock_read_lock(rte_mcfg_mempool_get_lock());\n }\n \n void\n rte_mcfg_mempool_read_unlock(void)\n {\n-\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n-\trte_rwlock_read_unlock(&mcfg->mplock);\n+\trte_rwlock_read_unlock(rte_mcfg_mempool_get_lock());\n }\n \n void\n rte_mcfg_mempool_write_lock(void)\n {\n-\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n-\trte_rwlock_write_lock(&mcfg->mplock);\n+\trte_rwlock_write_lock(rte_mcfg_mempool_get_lock());\n }\n \n void\n rte_mcfg_mempool_write_unlock(void)\n {\n-\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n-\trte_rwlock_write_unlock(&mcfg->mplock);\n+\trte_rwlock_write_unlock(rte_mcfg_mempool_get_lock());\n+}\n+\n+rte_spinlock_t *\n+rte_mcfg_timer_get_lock(void)\n+{\n+\treturn &rte_eal_get_configuration()->mem_config->tlock;\n }\n \n void\n rte_mcfg_timer_lock(void)\n {\n-\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n-\trte_spinlock_lock(&mcfg->tlock);\n+\trte_spinlock_lock(rte_mcfg_timer_get_lock());\n }\n \n void\n rte_mcfg_timer_unlock(void)\n {\n-\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n-\trte_spinlock_unlock(&mcfg->tlock);\n+\trte_spinlock_unlock(rte_mcfg_timer_get_lock());\n }\n \n bool\ndiff --git a/lib/eal/include/rte_eal_memconfig.h b/lib/eal/include/rte_eal_memconfig.h\nindex e175564647..c527f9aa29 100644\n--- a/lib/eal/include/rte_eal_memconfig.h\n+++ b/lib/eal/include/rte_eal_memconfig.h\n@@ -7,6 +7,8 @@\n \n #include <stdbool.h>\n \n+#include <rte_rwlock.h>\n+#include <rte_spinlock.h>\n \n /**\n * @file\n@@ -18,89 +20,122 @@\n extern \"C\" {\n #endif\n \n+/**\n+ * Internal helpers used for lock annotations.\n+ */\n+__rte_internal\n+rte_rwlock_t *\n+rte_mcfg_mem_get_lock(void);\n+\n+__rte_internal\n+rte_rwlock_t *\n+rte_mcfg_tailq_get_lock(void);\n+\n+__rte_internal\n+rte_rwlock_t *\n+rte_mcfg_mempool_get_lock(void);\n+\n+__rte_internal\n+rte_spinlock_t *\n+rte_mcfg_timer_get_lock(void);\n+\n /**\n * Lock the internal EAL shared memory configuration for shared access.\n */\n void\n-rte_mcfg_mem_read_lock(void);\n+rte_mcfg_mem_read_lock(void)\n+\t__rte_shared_lock_function(rte_mcfg_mem_get_lock());\n \n /**\n * Unlock the internal EAL shared memory configuration for shared access.\n */\n void\n-rte_mcfg_mem_read_unlock(void);\n+rte_mcfg_mem_read_unlock(void)\n+\t__rte_unlock_function(rte_mcfg_mem_get_lock());\n \n /**\n * Lock the internal EAL shared memory configuration for exclusive access.\n */\n void\n-rte_mcfg_mem_write_lock(void);\n+rte_mcfg_mem_write_lock(void)\n+\t__rte_exclusive_lock_function(rte_mcfg_mem_get_lock());\n \n /**\n * Unlock the internal EAL shared memory configuration for exclusive access.\n */\n void\n-rte_mcfg_mem_write_unlock(void);\n+rte_mcfg_mem_write_unlock(void)\n+\t__rte_unlock_function(rte_mcfg_mem_get_lock());\n \n /**\n * Lock the internal EAL TAILQ list for shared access.\n */\n void\n-rte_mcfg_tailq_read_lock(void);\n+rte_mcfg_tailq_read_lock(void)\n+\t__rte_shared_lock_function(rte_mcfg_tailq_get_lock());\n \n /**\n * Unlock the internal EAL TAILQ list for shared access.\n */\n void\n-rte_mcfg_tailq_read_unlock(void);\n+rte_mcfg_tailq_read_unlock(void)\n+\t__rte_unlock_function(rte_mcfg_tailq_get_lock());\n \n /**\n * Lock the internal EAL TAILQ list for exclusive access.\n */\n void\n-rte_mcfg_tailq_write_lock(void);\n+rte_mcfg_tailq_write_lock(void)\n+\t__rte_exclusive_lock_function(rte_mcfg_tailq_get_lock());\n \n /**\n * Unlock the internal EAL TAILQ list for exclusive access.\n */\n void\n-rte_mcfg_tailq_write_unlock(void);\n+rte_mcfg_tailq_write_unlock(void)\n+\t__rte_unlock_function(rte_mcfg_tailq_get_lock());\n \n /**\n * Lock the internal EAL Mempool list for shared access.\n */\n void\n-rte_mcfg_mempool_read_lock(void);\n+rte_mcfg_mempool_read_lock(void)\n+\t__rte_shared_lock_function(rte_mcfg_mempool_get_lock());\n \n /**\n * Unlock the internal EAL Mempool list for shared access.\n */\n void\n-rte_mcfg_mempool_read_unlock(void);\n+rte_mcfg_mempool_read_unlock(void)\n+\t__rte_unlock_function(rte_mcfg_mempool_get_lock());\n \n /**\n * Lock the internal EAL Mempool list for exclusive access.\n */\n void\n-rte_mcfg_mempool_write_lock(void);\n+rte_mcfg_mempool_write_lock(void)\n+\t__rte_exclusive_lock_function(rte_mcfg_mempool_get_lock());\n \n /**\n * Unlock the internal EAL Mempool list for exclusive access.\n */\n void\n-rte_mcfg_mempool_write_unlock(void);\n+rte_mcfg_mempool_write_unlock(void)\n+\t__rte_unlock_function(rte_mcfg_mempool_get_lock());\n \n /**\n * Lock the internal EAL Timer Library lock for exclusive access.\n */\n void\n-rte_mcfg_timer_lock(void);\n+rte_mcfg_timer_lock(void)\n+\t__rte_exclusive_lock_function(rte_mcfg_timer_get_lock());\n \n /**\n * Unlock the internal EAL Timer Library lock for exclusive access.\n */\n void\n-rte_mcfg_timer_unlock(void);\n+rte_mcfg_timer_unlock(void)\n+\t__rte_unlock_function(rte_mcfg_timer_get_lock());\n \n /**\n * If true, pages are put in single files (per memseg list),\ndiff --git a/lib/eal/version.map b/lib/eal/version.map\nindex 6d6978f108..51a820d829 100644\n--- a/lib/eal/version.map\n+++ b/lib/eal/version.map\n@@ -469,6 +469,10 @@ INTERNAL {\n \trte_intr_vec_list_free;\n \trte_intr_vec_list_index_get;\n \trte_intr_vec_list_index_set;\n+\trte_mcfg_mem_get_lock;\n+\trte_mcfg_mempool_get_lock;\n+\trte_mcfg_tailq_get_lock;\n+\trte_mcfg_timer_get_lock;\n \trte_mem_lock;\n \trte_mem_map;\n \trte_mem_page_size;\n", "prefixes": [ "03/14" ] }{ "id": 124492, "url": "