get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 124629,
    "url": "http://patches.dpdk.org/api/patches/124629/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1677718068-2412-8-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": "<1677718068-2412-8-git-send-email-roretzla@linux.microsoft.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1677718068-2412-8-git-send-email-roretzla@linux.microsoft.com",
    "date": "2023-03-02T00:47:38",
    "name": "[07/17] examples/vhost: use previous value atomic fetch operations",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "80eaa17f75746b376c40b447713be2c14d4ad86e",
    "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/1677718068-2412-8-git-send-email-roretzla@linux.microsoft.com/mbox/",
    "series": [
        {
            "id": 27214,
            "url": "http://patches.dpdk.org/api/series/27214/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27214",
            "date": "2023-03-02T00:47:32",
            "name": "use __atomic operations returning previous value",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/27214/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/124629/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/124629/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 E505E41DAF;\n\tThu,  2 Mar 2023 01:48:59 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2C38542C76;\n\tThu,  2 Mar 2023 01:48:14 +0100 (CET)",
            "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id 6F15C40EE3\n for <dev@dpdk.org>; Thu,  2 Mar 2023 01:48:03 +0100 (CET)",
            "by linux.microsoft.com (Postfix, from userid 1086)\n id 4076A20B4713; Wed,  1 Mar 2023 16:48:02 -0800 (PST)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com 4076A20B4713",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1677718082;\n bh=EKUNywuXkHOLDgzd/JggM6Tbd1lb5BvKgrQTR+G7GSs=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=i28Mepm0qAz4WJvqfQ5eDc4BV0MmIGbpmewxRn987YrRlowKMQKwhvSynaBjdLJMk\n J8w2b7557+12CGaTgmu1A0dSiFJwoKGV+gTj+OH+GxWGsn49v3CpU+GFUKbD0O340I\n LkwzwJa+hS/VGGl3fBXtd+9R1p4gWvxb010ciCN8=",
        "From": "Tyler Retzlaff <roretzla@linux.microsoft.com>",
        "To": "dev@dpdk.org",
        "Cc": "Honnappa.Nagarahalli@arm.com, thomas@monjalon.net,\n Tyler Retzlaff <roretzla@linux.microsoft.com>",
        "Subject": "[PATCH 07/17] examples/vhost: use previous value atomic fetch\n operations",
        "Date": "Wed,  1 Mar 2023 16:47:38 -0800",
        "Message-Id": "<1677718068-2412-8-git-send-email-roretzla@linux.microsoft.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1677718068-2412-1-git-send-email-roretzla@linux.microsoft.com>",
        "References": "<1677718068-2412-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 when we have no interest in the\nresult of the operation.\n\nReduces unnecessary codegen that provided the result of the atomic\noperation that was not used.\n\nChange brings closer alignment with atomics available in C11 standard\nand will reduce review effort when they are integrated.\n\nSigned-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\n---\n examples/vhost/main.c       | 12 ++++++------\n examples/vhost/virtio_net.c |  4 ++--\n 2 files changed, 8 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/examples/vhost/main.c b/examples/vhost/main.c\nindex 42e53a0..bfe466f 100644\n--- a/examples/vhost/main.c\n+++ b/examples/vhost/main.c\n@@ -1048,9 +1048,9 @@ static unsigned check_ports_num(unsigned nb_ports)\n \t}\n \n \tif (enable_stats) {\n-\t\t__atomic_add_fetch(&dst_vdev->stats.rx_total_atomic, 1,\n+\t\t__atomic_fetch_add(&dst_vdev->stats.rx_total_atomic, 1,\n \t\t\t\t__ATOMIC_SEQ_CST);\n-\t\t__atomic_add_fetch(&dst_vdev->stats.rx_atomic, ret,\n+\t\t__atomic_fetch_add(&dst_vdev->stats.rx_atomic, ret,\n \t\t\t\t__ATOMIC_SEQ_CST);\n \t\tsrc_vdev->stats.tx_total++;\n \t\tsrc_vdev->stats.tx += ret;\n@@ -1068,9 +1068,9 @@ static unsigned check_ports_num(unsigned nb_ports)\n \tret = vdev_queue_ops[vdev->vid].enqueue_pkt_burst(vdev, VIRTIO_RXQ, m, nr_xmit);\n \n \tif (enable_stats) {\n-\t\t__atomic_add_fetch(&vdev->stats.rx_total_atomic, nr_xmit,\n+\t\t__atomic_fetch_add(&vdev->stats.rx_total_atomic, nr_xmit,\n \t\t\t\t__ATOMIC_SEQ_CST);\n-\t\t__atomic_add_fetch(&vdev->stats.rx_atomic, ret,\n+\t\t__atomic_fetch_add(&vdev->stats.rx_atomic, ret,\n \t\t\t\t__ATOMIC_SEQ_CST);\n \t}\n \n@@ -1400,9 +1400,9 @@ static void virtio_tx_offload(struct rte_mbuf *m)\n \t}\n \n \tif (enable_stats) {\n-\t\t__atomic_add_fetch(&vdev->stats.rx_total_atomic, rx_count,\n+\t\t__atomic_fetch_add(&vdev->stats.rx_total_atomic, rx_count,\n \t\t\t\t__ATOMIC_SEQ_CST);\n-\t\t__atomic_add_fetch(&vdev->stats.rx_atomic, enqueue_count,\n+\t\t__atomic_fetch_add(&vdev->stats.rx_atomic, enqueue_count,\n \t\t\t\t__ATOMIC_SEQ_CST);\n \t}\n \ndiff --git a/examples/vhost/virtio_net.c b/examples/vhost/virtio_net.c\nindex 1d4737f..514c8e0 100644\n--- a/examples/vhost/virtio_net.c\n+++ b/examples/vhost/virtio_net.c\n@@ -231,7 +231,7 @@\n \t\t\trte_prefetch0(&vr->desc[desc_indexes[i+1]]);\n \t}\n \n-\t__atomic_add_fetch(&vr->used->idx, count, __ATOMIC_RELEASE);\n+\t__atomic_fetch_add(&vr->used->idx, count, __ATOMIC_RELEASE);\n \tqueue->last_used_idx += count;\n \n \trte_vhost_vring_call(dev->vid, queue_id);\n@@ -442,7 +442,7 @@\n \tqueue->last_avail_idx += i;\n \tqueue->last_used_idx += i;\n \n-\t__atomic_add_fetch(&vr->used->idx, i, __ATOMIC_ACQ_REL);\n+\t__atomic_fetch_add(&vr->used->idx, i, __ATOMIC_ACQ_REL);\n \n \trte_vhost_vring_call(dev->vid, queue_id);\n \n",
    "prefixes": [
        "07/17"
    ]
}