get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 77314,
    "url": "http://patches.dpdk.org/api/patches/77314/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1599794967-17500-3-git-send-email-phil.yang@arm.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": "<1599794967-17500-3-git-send-email-phil.yang@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1599794967-17500-3-git-send-email-phil.yang@arm.com",
    "date": "2020-09-11T03:29:25",
    "name": "[2/4] bbdev: use C11 atomic builtins for device processing counter",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d7eeb3b999320bb0be1def52a796a7de5025d5ea",
    "submitter": {
        "id": 833,
        "url": "http://patches.dpdk.org/api/people/833/?format=api",
        "name": "Phil Yang",
        "email": "phil.yang@arm.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1599794967-17500-3-git-send-email-phil.yang@arm.com/mbox/",
    "series": [
        {
            "id": 12125,
            "url": "http://patches.dpdk.org/api/series/12125/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12125",
            "date": "2020-09-11T03:29:23",
            "name": "use C11 atomic builtins for libs",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/12125/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/77314/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/77314/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 DD04BA04B5;\n\tFri, 11 Sep 2020 05:29:45 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7F0141C0D4;\n\tFri, 11 Sep 2020 05:29:35 +0200 (CEST)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by dpdk.org (Postfix) with ESMTP id 775B11C0D2\n for <dev@dpdk.org>; Fri, 11 Sep 2020 05:29:34 +0200 (CEST)",
            "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 00C54113E;\n Thu, 10 Sep 2020 20:29:34 -0700 (PDT)",
            "from phil-VirtualBox.shanghai.arm.com\n (phil-VirtualBox.shanghai.arm.com [10.169.182.49])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 234EC3F73C;\n Thu, 10 Sep 2020 20:29:31 -0700 (PDT)"
        ],
        "From": "Phil Yang <phil.yang@arm.com>",
        "To": "dev@dpdk.org",
        "Cc": "Honnappa.Nagarahalli@arm.com, Ruifeng.Wang@arm.com, nd@arm.com,\n Nicolas Chautru <nicolas.chautru@intel.com>",
        "Date": "Fri, 11 Sep 2020 11:29:25 +0800",
        "Message-Id": "<1599794967-17500-3-git-send-email-phil.yang@arm.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1599794967-17500-1-git-send-email-phil.yang@arm.com>",
        "References": "<1599794967-17500-1-git-send-email-phil.yang@arm.com>",
        "Subject": "[dpdk-dev] [PATCH 2/4] bbdev: use C11 atomic builtins for device\n\tprocessing counter",
        "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": "Since rte_atomicXX APIs are not allowed to be used, use C11 atomic builtins\nfor device processing counter.\n\nSigned-off-by: Phil Yang <phil.yang@arm.com>\nReviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>\nReviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>\n---\n lib/librte_bbdev/rte_bbdev.c | 5 +++--\n lib/librte_bbdev/rte_bbdev.h | 4 +---\n 2 files changed, 4 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/lib/librte_bbdev/rte_bbdev.c b/lib/librte_bbdev/rte_bbdev.c\nindex a4fdb69..5ba891c 100644\n--- a/lib/librte_bbdev/rte_bbdev.c\n+++ b/lib/librte_bbdev/rte_bbdev.c\n@@ -210,7 +210,7 @@ rte_bbdev_allocate(const char *name)\n \t\treturn NULL;\n \t}\n \n-\trte_atomic16_inc(&bbdev->data->process_cnt);\n+\t__atomic_add_fetch(&bbdev->data->process_cnt, 1, __ATOMIC_RELAXED);\n \tbbdev->data->dev_id = dev_id;\n \tbbdev->state = RTE_BBDEV_INITIALIZED;\n \n@@ -252,7 +252,8 @@ rte_bbdev_release(struct rte_bbdev *bbdev)\n \t}\n \n \t/* clear shared BBDev Data if no process is using the device anymore */\n-\tif (rte_atomic16_dec_and_test(&bbdev->data->process_cnt))\n+\tif (__atomic_sub_fetch(&bbdev->data->process_cnt, 1,\n+\t\t\t      __ATOMIC_RELAXED) == 0)\n \t\tmemset(bbdev->data, 0, sizeof(*bbdev->data));\n \n \tmemset(bbdev, 0, sizeof(*bbdev));\ndiff --git a/lib/librte_bbdev/rte_bbdev.h b/lib/librte_bbdev/rte_bbdev.h\nindex 5729137..7017124 100644\n--- a/lib/librte_bbdev/rte_bbdev.h\n+++ b/lib/librte_bbdev/rte_bbdev.h\n@@ -33,7 +33,6 @@ extern \"C\" {\n #include <string.h>\n \n #include <rte_compat.h>\n-#include <rte_atomic.h>\n #include <rte_bus.h>\n #include <rte_cpuflags.h>\n #include <rte_memory.h>\n@@ -426,8 +425,7 @@ struct rte_bbdev_data {\n \tuint16_t dev_id;  /**< Device ID */\n \tint socket_id;  /**< NUMA socket that device is on */\n \tbool started;  /**< Device run-time state */\n-\t/** Counter of processes using the device */\n-\trte_atomic16_t process_cnt;\n+\tuint16_t process_cnt;  /** Counter of processes using the device */\n };\n \n /* Forward declarations */\n",
    "prefixes": [
        "2/4"
    ]
}