Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/125020/?format=api
http://patches.dpdk.org/api/patches/125020/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1678486530-20688-4-git-send-email-roretzla@linux.microsoft.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": "<1678486530-20688-4-git-send-email-roretzla@linux.microsoft.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1678486530-20688-4-git-send-email-roretzla@linux.microsoft.com", "date": "2023-03-10T22:15:17", "name": "[03/16] common/mlx5: use previous value atomic fetch operations", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "c7f6417f113d0f0dfb113b7e2cdaa2bc22be0e14", "submitter": { "id": 2077, "url": "http://patches.dpdk.org/api/people/2077/?format=api", "name": "Tyler Retzlaff", "email": "roretzla@linux.microsoft.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1678486530-20688-4-git-send-email-roretzla@linux.microsoft.com/mbox/", "series": [ { "id": 27337, "url": "http://patches.dpdk.org/api/series/27337/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27337", "date": "2023-03-10T22:15:16", "name": "use __atomic operations returning new value", "version": 1, "mbox": "http://patches.dpdk.org/series/27337/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/125020/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/125020/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 A8DCE41E6D;\n\tFri, 10 Mar 2023 23:16:04 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 51B8142B7E;\n\tFri, 10 Mar 2023 23:15:42 +0100 (CET)", "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id 58E4F40ED9\n for <dev@dpdk.org>; Fri, 10 Mar 2023 23:15:36 +0100 (CET)", "by linux.microsoft.com (Postfix, from userid 1086)\n id A11432044728; Fri, 10 Mar 2023 14:15:35 -0800 (PST)" ], "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com A11432044728", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1678486535;\n bh=AiPSJbJTqUPb8O0FYv4kyX/7isrZ/oFbFet8HdS1saE=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=hztNO+v8q6YFzUTrlLQhi8r36wivr38Y0k14oUgnDbk943h1cuuXup9/v2l8ASO3V\n hJ0QZi1uaF7eNl37RIE96LMvrhYsupPPc81lZJHya1chL+qdFtABXP3pmgPVAjG5t7\n 9i3yLZF7EFZHvKinJMfJ8/jEc0A3g1bSB8nHKjv8=", "From": "Tyler Retzlaff <roretzla@linux.microsoft.com>", "To": "dev@dpdk.org", "Cc": "Honnappa.Nagarahalli@arm.com, Ruifeng.Wang@arm.com, thomas@monjalon.net,\n Tyler Retzlaff <roretzla@linux.microsoft.com>", "Subject": "[PATCH 03/16] common/mlx5: use previous value atomic fetch operations", "Date": "Fri, 10 Mar 2023 14:15:17 -0800", "Message-Id": "<1678486530-20688-4-git-send-email-roretzla@linux.microsoft.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1678486530-20688-1-git-send-email-roretzla@linux.microsoft.com>", "References": "<1678486530-20688-1-git-send-email-roretzla@linux.microsoft.com>", "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": "Use __atomic_fetch_{add,and,or,sub,xor} instead of\n__atomic_{add,and,or,sub,xor}_fetch adding the necessary code to\nallow consumption of the resulting value.\n\nSigned-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\n---\n drivers/common/mlx5/linux/mlx5_nl.c | 2 +-\n drivers/common/mlx5/mlx5_common_mr.c | 8 ++++----\n drivers/common/mlx5/mlx5_common_utils.c | 8 ++++----\n 3 files changed, 9 insertions(+), 9 deletions(-)", "diff": "diff --git a/drivers/common/mlx5/linux/mlx5_nl.c b/drivers/common/mlx5/linux/mlx5_nl.c\nindex 5d04857..33670bb 100644\n--- a/drivers/common/mlx5/linux/mlx5_nl.c\n+++ b/drivers/common/mlx5/linux/mlx5_nl.c\n@@ -178,7 +178,7 @@ struct mlx5_nl_port_info {\n uint32_t atomic_sn;\n \n /* Generate Netlink sequence number. */\n-#define MLX5_NL_SN_GENERATE __atomic_add_fetch(&atomic_sn, 1, __ATOMIC_RELAXED)\n+#define MLX5_NL_SN_GENERATE (__atomic_fetch_add(&atomic_sn, 1, __ATOMIC_RELAXED) + 1)\n \n /**\n * Opens a Netlink socket.\ndiff --git a/drivers/common/mlx5/mlx5_common_mr.c b/drivers/common/mlx5/mlx5_common_mr.c\nindex 0e1d243..037a4d8 100644\n--- a/drivers/common/mlx5/mlx5_common_mr.c\n+++ b/drivers/common/mlx5/mlx5_common_mr.c\n@@ -58,8 +58,8 @@ struct mlx5_mempool_reg {\n \n \tif (__atomic_load_n(&buf->refcnt, __ATOMIC_RELAXED) == 1) {\n \t\trte_mempool_put(buf->mp, buf);\n-\t} else if (unlikely(__atomic_sub_fetch(&buf->refcnt, 1,\n-\t\t\t\t\t __ATOMIC_RELAXED) == 0)) {\n+\t} else if (unlikely(__atomic_fetch_sub(&buf->refcnt, 1,\n+\t\t\t\t\t __ATOMIC_RELAXED) - 1 == 0)) {\n \t\t__atomic_store_n(&buf->refcnt, 1, __ATOMIC_RELAXED);\n \t\trte_mempool_put(buf->mp, buf);\n \t}\n@@ -1665,8 +1665,8 @@ struct mlx5_mempool_get_extmem_data {\n \tbool ret = false;\n \n \tfor (i = 0; i < mpr->mrs_n; i++)\n-\t\tret |= __atomic_sub_fetch(&mpr->mrs[i].refcnt, 1,\n-\t\t\t\t\t __ATOMIC_RELAXED) == 0;\n+\t\tret |= __atomic_fetch_sub(&mpr->mrs[i].refcnt, 1,\n+\t\t\t\t\t __ATOMIC_RELAXED) - 1 == 0;\n \treturn ret;\n }\n \ndiff --git a/drivers/common/mlx5/mlx5_common_utils.c b/drivers/common/mlx5/mlx5_common_utils.c\nindex 58d744b..06b5b9b 100644\n--- a/drivers/common/mlx5/mlx5_common_utils.c\n+++ b/drivers/common/mlx5/mlx5_common_utils.c\n@@ -81,8 +81,8 @@ struct mlx5_list *\n \twhile (entry != NULL) {\n \t\tif (l_const->cb_match(l_const->ctx, entry, ctx) == 0) {\n \t\t\tif (reuse) {\n-\t\t\t\tret = __atomic_add_fetch(&entry->ref_cnt, 1,\n-\t\t\t\t\t\t\t __ATOMIC_RELAXED) - 1;\n+\t\t\t\tret = __atomic_fetch_add(&entry->ref_cnt, 1,\n+\t\t\t\t\t\t\t __ATOMIC_RELAXED);\n \t\t\t\tDRV_LOG(DEBUG, \"mlx5 list %s entry %p ref: %u.\",\n \t\t\t\t\tl_const->name, (void *)entry,\n \t\t\t\t\tentry->ref_cnt);\n@@ -285,7 +285,7 @@ struct mlx5_list_entry *\n {\n \tstruct mlx5_list_entry *gentry = entry->gentry;\n \n-\tif (__atomic_sub_fetch(&entry->ref_cnt, 1, __ATOMIC_RELAXED) != 0)\n+\tif (__atomic_fetch_sub(&entry->ref_cnt, 1, __ATOMIC_RELAXED) - 1 != 0)\n \t\treturn 1;\n \tif (entry->lcore_idx == (uint32_t)lcore_idx) {\n \t\tLIST_REMOVE(entry, next);\n@@ -303,7 +303,7 @@ struct mlx5_list_entry *\n \t\t\tl_const->name, (void *)entry);\n \t\treturn 0;\n \t}\n-\tif (__atomic_sub_fetch(&gentry->ref_cnt, 1, __ATOMIC_RELAXED) != 0)\n+\tif (__atomic_fetch_sub(&gentry->ref_cnt, 1, __ATOMIC_RELAXED) - 1 != 0)\n \t\treturn 1;\n \trte_rwlock_write_lock(&l_inconst->lock);\n \tif (likely(gentry->ref_cnt == 0)) {\n", "prefixes": [ "03/16" ] }{ "id": 125020, "url": "