get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 78865,
    "url": "http://patchwork.dpdk.org/api/patches/78865/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200925174340.10014-6-steven.lariau@arm.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20200925174340.10014-6-steven.lariau@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200925174340.10014-6-steven.lariau@arm.com",
    "date": "2020-09-25T17:43:39",
    "name": "[v2,5/5] lib/stack: remove pop cas release ordering",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "8a6c25d73a2057dcefc8e9424d1841e7e6eec03b",
    "submitter": {
        "id": 1862,
        "url": "http://patchwork.dpdk.org/api/people/1862/?format=api",
        "name": "Steven Lariau",
        "email": "steven.lariau@arm.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patchwork.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20200925174340.10014-6-steven.lariau@arm.com/mbox/",
    "series": [
        {
            "id": 12516,
            "url": "http://patchwork.dpdk.org/api/series/12516/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=12516",
            "date": "2020-09-25T17:43:34",
            "name": "lib/stack: improve lockfree C11 implementation",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/12516/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/78865/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/78865/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 83BA6A04C0;\n\tFri, 25 Sep 2020 19:45:50 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 43AFC1EA16;\n\tFri, 25 Sep 2020 19:44:31 +0200 (CEST)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by dpdk.org (Postfix) with ESMTP id E2FEE1E9F5\n for <dev@dpdk.org>; Fri, 25 Sep 2020 19:44:18 +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 CBB9A1396;\n Fri, 25 Sep 2020 10:44:16 -0700 (PDT)",
            "from localhost.localdomain (unknown [10.57.54.55])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EEBCA3F718;\n Fri, 25 Sep 2020 10:44:15 -0700 (PDT)"
        ],
        "From": "Steven Lariau <steven.lariau@arm.com>",
        "To": "Gage Eads <gage.eads@intel.com>,\n\tOlivier Matz <olivier.matz@6wind.com>",
        "Cc": "dev@dpdk.org,\n\tnd@arm.com,\n\tSteven Lariau <steven.lariau@arm.com>",
        "Date": "Fri, 25 Sep 2020 18:43:39 +0100",
        "Message-Id": "<20200925174340.10014-6-steven.lariau@arm.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20200925174340.10014-1-steven.lariau@arm.com>",
        "References": "<20200911152938.8019-1-steven.lariau@arm.com>\n <20200925174340.10014-1-steven.lariau@arm.com>",
        "Subject": "[dpdk-dev] [PATCH v2 5/5] lib/stack: remove pop cas release ordering",
        "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": "Replace the store-release by relaxed for the CAS success at the end of\npop. Release isn't needed, because there is not write to data that need\nto be synchronized.\nThe only preceding write is when the length is decreased, but the length\nCAS loop already ensures the right synchronization.\nThe situation to avoid is when a thread sees the old length but the new\nlist, that doesn't have enough items for pop to success.\nBut the CAS success on length before the pop loop ensures any core reads\nand updates the latest length, preventing this situation.\n\nThe store-release is also used to make sure that the items are read\nbefore the head is updated, in order to prevent a core in pop to read an\nincorrect value because another core rewrites it with push.\nBut this isn't needed, because items are read only when removed from the\nused list. Right after this, they are pushed to the free list, and the\nstore-release in push makes sure the items are read before they are\nvisible in the free list.\n\nSigned-off-by: Steven Lariau <steven.lariau@arm.com>\nReviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>\nReviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>\n---\n lib/librte_stack/rte_stack_lf_c11.h | 16 +++++++++++++++-\n 1 file changed, 15 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/librte_stack/rte_stack_lf_c11.h b/lib/librte_stack/rte_stack_lf_c11.h\nindex adb9f590d..8403196d5 100644\n--- a/lib/librte_stack/rte_stack_lf_c11.h\n+++ b/lib/librte_stack/rte_stack_lf_c11.h\n@@ -141,11 +141,25 @@ __rte_stack_lf_pop_elems(struct rte_stack_lf_list *list,\n \t\tnew_head.top = tmp;\n \t\tnew_head.cnt = old_head.cnt + 1;\n \n+\t\t/*\n+\t\t * The CAS should have release semantics to ensure that\n+\t\t * items are read before the head is updated.\n+\t\t * But this function is internal, and items are read\n+\t\t * only when __rte_stack_lf_pop calls this function to\n+\t\t * pop items from used list.\n+\t\t * Then, those items are pushed to the free list.\n+\t\t * Push uses a CAS store-release on head, which makes\n+\t\t * sure that items are read before they are pushed to\n+\t\t * the free list, without need for a CAS release here.\n+\t\t * This CAS could also be used to ensure that the new\n+\t\t * length is visible before the head update, but\n+\t\t * acquire semantics on the length update is enough.\n+\t\t */\n \t\tsuccess = rte_atomic128_cmp_exchange(\n \t\t\t\t(rte_int128_t *)&list->head,\n \t\t\t\t(rte_int128_t *)&old_head,\n \t\t\t\t(rte_int128_t *)&new_head,\n-\t\t\t\t0, __ATOMIC_RELEASE,\n+\t\t\t\t0, __ATOMIC_RELAXED,\n \t\t\t\t__ATOMIC_RELAXED);\n \t} while (success == 0);\n \n",
    "prefixes": [
        "v2",
        "5/5"
    ]
}