get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 125016,
    "url": "http://patches.dpdk.org/api/patches/125016/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1678486530-20688-3-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-3-git-send-email-roretzla@linux.microsoft.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1678486530-20688-3-git-send-email-roretzla@linux.microsoft.com",
    "date": "2023-03-10T22:15:16",
    "name": "[02/16] common/cnxk: use previous value atomic fetch operations",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4aad66fe6694401793b2015ce9d7143f094e1177",
    "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-3-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/125016/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/125016/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 2E7ED41E6D;\n\tFri, 10 Mar 2023 23:15:38 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 0E89040A8B;\n\tFri, 10 Mar 2023 23:15:38 +0100 (CET)",
            "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id 424F140685\n for <dev@dpdk.org>; Fri, 10 Mar 2023 23:15:36 +0100 (CET)",
            "by linux.microsoft.com (Postfix, from userid 1086)\n id 94B3E2044726; Fri, 10 Mar 2023 14:15:35 -0800 (PST)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com 94B3E2044726",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1678486535;\n bh=hi8YITqo1Uqxht/1HZMWpeLbSbs5ROLyhI26l6ovbtI=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=BTZ1KOzFLGc5woGqxFkaiihdpgQz4nhB9Vq0AZz8NBglMElBcsB96rorHjpp/XS3f\n /KyDpbLDgmQg6nTmsDo77hBEmTeht7Bun2gwduVyHCg4EFNK6n15cR3G6vs7FjsREn\n UuSD2ETbwyTV4Sjy6Q7eobmrhH338G70yMEYyJuk=",
        "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 02/16] common/cnxk: use previous value atomic fetch operations",
        "Date": "Fri, 10 Mar 2023 14:15:16 -0800",
        "Message-Id": "<1678486530-20688-3-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/cnxk/roc_ae.c            | 2 +-\n drivers/common/cnxk/roc_ae_fpm_tables.c | 2 +-\n drivers/common/cnxk/roc_npa.c           | 2 +-\n 3 files changed, 3 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/common/cnxk/roc_ae.c b/drivers/common/cnxk/roc_ae.c\nindex 929da05..336b927 100644\n--- a/drivers/common/cnxk/roc_ae.c\n+++ b/drivers/common/cnxk/roc_ae.c\n@@ -203,6 +203,6 @@ struct ae_ec_grp_tbl {\n \n \tec_grp = mz->addr;\n \t/* Decrement number of devices using EC grp table */\n-\tif (__atomic_sub_fetch(&ec_grp->refcount, 1, __ATOMIC_SEQ_CST) == 0)\n+\tif (__atomic_fetch_sub(&ec_grp->refcount, 1, __ATOMIC_SEQ_CST) - 1 == 0)\n \t\tplt_memzone_free(mz);\n }\ndiff --git a/drivers/common/cnxk/roc_ae_fpm_tables.c b/drivers/common/cnxk/roc_ae_fpm_tables.c\nindex afb2a50..f915702 100644\n--- a/drivers/common/cnxk/roc_ae_fpm_tables.c\n+++ b/drivers/common/cnxk/roc_ae_fpm_tables.c\n@@ -1135,6 +1135,6 @@ struct ae_fpm_tbl {\n \n \tfpm = (struct ae_fpm_tbl *)mz->addr;\n \t/* Decrement number of devices using FPM table */\n-\tif (__atomic_sub_fetch(&fpm->refcount, 1, __ATOMIC_SEQ_CST) == 0)\n+\tif (__atomic_fetch_sub(&fpm->refcount, 1, __ATOMIC_SEQ_CST) - 1 == 0)\n \t\tplt_memzone_free(mz);\n }\ndiff --git a/drivers/common/cnxk/roc_npa.c b/drivers/common/cnxk/roc_npa.c\nindex 69c3d8d..20637fb 100644\n--- a/drivers/common/cnxk/roc_npa.c\n+++ b/drivers/common/cnxk/roc_npa.c\n@@ -946,7 +946,7 @@\n \t\treturn NPA_ERR_ALLOC;\n \n \t/* Not the last PCI device */\n-\tif (__atomic_sub_fetch(&idev->npa_refcnt, 1, __ATOMIC_SEQ_CST) != 0)\n+\tif (__atomic_fetch_sub(&idev->npa_refcnt, 1, __ATOMIC_SEQ_CST) - 1 != 0)\n \t\treturn 0;\n \n \tnpa_unregister_irqs(idev->npa);\n",
    "prefixes": [
        "02/16"
    ]
}