get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 139867,
    "url": "http://patchwork.dpdk.org/api/patches/139867/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20240505083737.118649-2-mattias.ronnblom@ericsson.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": "<20240505083737.118649-2-mattias.ronnblom@ericsson.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240505083737.118649-2-mattias.ronnblom@ericsson.com",
    "date": "2024-05-05T08:37:32",
    "name": "[RFC,v7,1/6] eal: extend bit manipulation functionality",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "34aa65182698f05640bce1598d3dbb9b09f31096",
    "submitter": {
        "id": 1077,
        "url": "http://patchwork.dpdk.org/api/people/1077/?format=api",
        "name": "Mattias Rönnblom",
        "email": "mattias.ronnblom@ericsson.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20240505083737.118649-2-mattias.ronnblom@ericsson.com/mbox/",
    "series": [
        {
            "id": 31882,
            "url": "http://patchwork.dpdk.org/api/series/31882/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31882",
            "date": "2024-05-05T08:37:31",
            "name": "Improve EAL bit operations API",
            "version": 7,
            "mbox": "http://patchwork.dpdk.org/series/31882/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/139867/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/139867/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 1740E43FAE;\n\tSun,  5 May 2024 10:48:06 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 17A4D402E2;\n\tSun,  5 May 2024 10:48:01 +0200 (CEST)",
            "from EUR04-HE1-obe.outbound.protection.outlook.com\n (mail-he1eur04on2087.outbound.protection.outlook.com [40.107.7.87])\n by mails.dpdk.org (Postfix) with ESMTP id 79FA84028C\n for <dev@dpdk.org>; Sun,  5 May 2024 10:47:58 +0200 (CEST)",
            "from AM0PR02CA0034.eurprd02.prod.outlook.com (2603:10a6:208:3e::47)\n by DBAPR07MB6567.eurprd07.prod.outlook.com (2603:10a6:10:188::9) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.39; Sun, 5 May\n 2024 08:47:56 +0000",
            "from AM3PEPF00009BA0.eurprd04.prod.outlook.com\n (2603:10a6:208:3e:cafe::b2) by AM0PR02CA0034.outlook.office365.com\n (2603:10a6:208:3e::47) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.40 via Frontend\n Transport; Sun, 5 May 2024 08:47:56 +0000",
            "from oa.msg.ericsson.com (192.176.1.74) by\n AM3PEPF00009BA0.mail.protection.outlook.com (10.167.16.25) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.7544.18 via Frontend Transport; Sun, 5 May 2024 08:47:56 +0000",
            "from seliicinfr00049.seli.gic.ericsson.se (153.88.142.248) by\n smtp-central.internal.ericsson.com (100.87.178.68) with Microsoft SMTP Server\n id 15.2.1544.9; Sun, 5 May 2024 10:47:56 +0200",
            "from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100])\n by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id\n 5D89038007A; Sun,  5 May 2024 10:47:56 +0200 (CEST)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=JsKy/4ezw3mY+ntUoup1KAVkwUuOh/shFszaLuOUA+M04LCkNqh6DdcshoIh/c7/h/niL30W9SVO7kGf2wQNYS40fzf35SeQz7tq1SBo+A9MIxyKjtai2Cq7scEUkGqVHp/Em4KaF7EeOtAB7dAsYKjg7kIrUN1jrZQ6pW0JLrrF7QimNXQcW/Bfo3EOodpr3sdcVoTpU4CoK197O8FtM/DGdnUngU0taFzJqhrYpWEGnrUzglriEjjZh1QxZZdp1TCI78+7Dt1KICrQXlF6mt7Rf+kNoN8GhwtJAobzwOI9X4ZizkEolNcWN2r7EoZ0YznUT3kd2Q3HsUwqq0cxhA==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=uGaYNBWczZiaiy2F567USLR166LHBzCdDI8GvTpYwsg=;\n b=CJT2wPJ4jEV+NdBXY3YN80/WG7TiPNnUKtiGrX0K+GPWhmrvHZNMLtAHD62oCNQUSdYjS/s5Q70+iIyxqt2KzB7FGMoVDeCCaV9OFL9PRGZBee8imiM1wBL/St+/OJvd/eULLDO2/dJEgGfXXo2ggevInnp1KAlnD3t7mobipPesMbv4Ylp0wIGeVv2NX6Qxp6QGFUugAZsjsEyXcD0hfqN4nlXl8Lzx5nCP6TQjSIcVHrPvPB8oThDwAfhUIJHzaTVvsgliyBt7zlvtAKoac7pDqvi4LgkyQcXSxqwBaZ/RpeQ/6hcEUl1aU+50tVhw9i/Dq0t17TDdDPqKQjmNhQ==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 192.176.1.74) smtp.rcpttodomain=dpdk.org smtp.mailfrom=ericsson.com;\n dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ericsson.com;\n dkim=none (message not signed); arc=none (0)",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com;\n s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=uGaYNBWczZiaiy2F567USLR166LHBzCdDI8GvTpYwsg=;\n b=gYLBbLwIln9MlnMGoXwMzN+9H53zU8pfmsp7YMf5IHTDvhWpKINROxiHkwF46IzUShl1suzQ1i64qhXv7DwoA818x6Dedcuy4HKYWd0lg8fpfM19tXvRL7XvIElOEZ+9fsKY3G9i4rrdV+j/b/6y1zLd2I4J3LPKptg2+c/fnhKIwhFMDYQVjFydhGG3EDrdKafxO7I6oSqqAH+sz+bxN9P0uiVWJUn3L5o1IL0T+YmrS6mlY6DqZ3R0pHRBrwWLQxyMQv7C1NgHYB74KE7M0MPcgX2BzSHmIca7lwgwcj3eJ0NBeJaLc+0yOkHU8EMNUKviwU/ND+BpZEuOwuDUlg==",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 192.176.1.74)\n smtp.mailfrom=ericsson.com; dkim=none (message not signed)\n header.d=none;dmarc=pass action=none header.from=ericsson.com;",
        "Received-SPF": "Pass (protection.outlook.com: domain of ericsson.com designates\n 192.176.1.74 as permitted sender)\n receiver=protection.outlook.com;\n client-ip=192.176.1.74; helo=oa.msg.ericsson.com; pr=C",
        "From": "=?utf-8?q?Mattias_R=C3=B6nnblom?= <mattias.ronnblom@ericsson.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<hofors@lysator.liu.se>, Heng Wang <heng.wang@ericsson.com>,\n \"Stephen Hemminger\" <stephen@networkplumber.org>,\n Tyler Retzlaff <roretzla@linux.microsoft.com>,\n =?utf-8?q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com>, =?utf-8?q?Mattia?=\n\t=?utf-8?q?s_R=C3=B6nnblom?= <mattias.ronnblom@ericsson.com>",
        "Subject": "[RFC v7 1/6] eal: extend bit manipulation functionality",
        "Date": "Sun, 5 May 2024 10:37:32 +0200",
        "Message-ID": "<20240505083737.118649-2-mattias.ronnblom@ericsson.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20240505083737.118649-1-mattias.ronnblom@ericsson.com>",
        "References": "<20240502055706.112443-2-mattias.ronnblom@ericsson.com>\n <20240505083737.118649-1-mattias.ronnblom@ericsson.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"UTF-8\"",
        "Content-Transfer-Encoding": "8bit",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-TrafficTypeDiagnostic": "AM3PEPF00009BA0:EE_|DBAPR07MB6567:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "07cde067-3f1a-4643-ab32-08dc6ce00f81",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;\n ARA:13230031|376005|36860700004|82310400017|1800799015;",
        "X-Microsoft-Antispam-Message-Info": "=?utf-8?q?jxXltuKR1fgD+uoBJZHid3BeweSJgPV?=\n\t=?utf-8?q?q2xrv8qbMIBAwU8shwKaCeE4JLPFsGvTpM2cFYA5uxP6z1YRnuQPH9IZ4MAngd6JJ?=\n\t=?utf-8?q?HaQCImxna0DlFY8U1LjObHUIloM9HUPrx0zSvKSux46atmg8TY0uflWUsBtCEFdY/?=\n\t=?utf-8?q?gWIfQ52rKuFqQ205BzMviq5FjCESOmle3oJYbK+NKaHUp7fB2rHRlg54d38zd0OVl?=\n\t=?utf-8?q?DtZWpVJj79YumoKjycFb1Rhm46L12j5A85Z3r68Jeoa/Fbt2E9rQgsj9aiUj8Orwn?=\n\t=?utf-8?q?0UJ/vBsNclFXjsP7dOULmwVEo0fGWQeUDlgOpM0MCI1yIRC7Nb16UlmwBqlG5e9bo?=\n\t=?utf-8?q?iLHkyIpbVhA5lzbQVu9yXkLFvz1Nj9zDrzGOWzEQxKuLax3o8mRYDEZFMbvEnaVDq?=\n\t=?utf-8?q?FCJj0hYdWAugPS9NRQ2BTIT0y/MOLHd/pxPVPBkvCW4PQCUF/3zFgY4mTgPORwjoZ?=\n\t=?utf-8?q?OvZ2TnrgFBGUoEEWRZJv8etLomOTQRGoAOdgbMHeDSmAvu4INVkkkjF5rbfk3CZuU?=\n\t=?utf-8?q?z8NzhZzwqPBOaLwnVf5vQSPHiASF1uBRox2xfg4uSMmryFlr11J3qC+4+mj0umA5+?=\n\t=?utf-8?q?kSpc6+cbgacwivWQuKGusMm3TQ3eCnCCCE+W7szH9/i3vh8QcSEDz5aTFnlj4/Qan?=\n\t=?utf-8?q?bGLq7ilm+vWJ+caWvW0Bh/UlkORjNu3PkwCJnyCsBM7qt96oZbXYHSnGrY3Ab5DH7?=\n\t=?utf-8?q?Kb3ljnhJ71zxyAjNNlW5zVlD0NbyVP/qGpGjCBV0abL5dCTO9pbRpSS+J6VIh8P+i?=\n\t=?utf-8?q?e/mM+mC7IV7UEQkBEStCvMxSYIxGPhYSR3zP4XbkneSDNaiZe6PFxoDVl2/xCRvIZ?=\n\t=?utf-8?q?9xEMAaQKGmV0uxL8ENTrjWZOJrXI9VQ2GM2E10Q4OJp50yxuHgo1WLOHgQ2/9sohx?=\n\t=?utf-8?q?sl+AIc1vG+SU3oF8aYcoxxsY6NnKIsOVNqxgeEvmIuExtjuKwQPChDbj6VwTffl7k?=\n\t=?utf-8?q?4Vo+TMnnCmTZQ3xHAPVInE73nxfdgW+cNiMx14Qpzj+BTfnUvMYSUHwdpxMiztzih?=\n\t=?utf-8?q?gKT7Hg84H3pzMfuM0r5vu0nYWLaIVcCkl3Gc9D6DwaYnhyG5bGTv1+kIP6vMiXyAl?=\n\t=?utf-8?q?Ok75jfVoNTPxJciQHX1dqQ477jxqVE8WQxWZWcz+qwUYJZ3O2MXvKy/c8i3XjLXyr?=\n\t=?utf-8?q?KVDtAbJE/7bHVR56qrC84/QnmXXkRGSWVncr99wMU6zyBX9ixKvVMZIu3f6lLOofz?=\n\t=?utf-8?q?hkcdh2kyzSwAsME0aAV9/vHtIeD9v8OnpWEqKWDldqKx2MFTEk7HDVzcmEp91I1p7?=\n\t=?utf-8?q?1si1LEIyB8s5fMIhTApRBSeemktGvXruqKpHZggpvv2xy7dV8WPU/P6lYyCZadcZt?=\n\t=?utf-8?q?nQALLM76OFk0?=",
        "X-Forefront-Antispam-Report": "CIP:192.176.1.74; CTRY:SE; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:oa.msg.ericsson.com; PTR:office365.se.ericsson.net;\n CAT:NONE; SFS:(13230031)(376005)(36860700004)(82310400017)(1800799015);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "ericsson.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "05 May 2024 08:47:56.7773 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 07cde067-3f1a-4643-ab32-08dc6ce00f81",
        "X-MS-Exchange-CrossTenant-Id": "92e84ceb-fbfd-47ab-be52-080c6b87953f",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=92e84ceb-fbfd-47ab-be52-080c6b87953f; Ip=[192.176.1.74];\n Helo=[oa.msg.ericsson.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n AM3PEPF00009BA0.eurprd04.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "DBAPR07MB6567",
        "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": "Add functionality to test and modify the value of individual bits in\n32-bit or 64-bit words.\n\nThese functions have no implications on memory ordering, atomicity and\ndoes not use volatile and thus does not prevent any compiler\noptimizations.\n\nRFC v6:\n * Have rte_bit_test() accept const-marked bitsets.\n\nRFC v4:\n * Add rte_bit_flip() which, believe it or not, flips the value of a bit.\n * Mark macro-generated private functions as experimental.\n * Use macros to generate *assign*() functions.\n\nRFC v3:\n * Work around lack of C++ support for _Generic (Tyler Retzlaff).\n * Fix ','-related checkpatch warnings.\n\nSigned-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>\nAcked-by: Morten Brørup <mb@smartsharesystems.com>\nAcked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\n---\n lib/eal/include/rte_bitops.h | 259 ++++++++++++++++++++++++++++++++++-\n 1 file changed, 257 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/lib/eal/include/rte_bitops.h b/lib/eal/include/rte_bitops.h\nindex 449565eeae..3297133e22 100644\n--- a/lib/eal/include/rte_bitops.h\n+++ b/lib/eal/include/rte_bitops.h\n@@ -2,6 +2,7 @@\n  * Copyright(c) 2020 Arm Limited\n  * Copyright(c) 2010-2019 Intel Corporation\n  * Copyright(c) 2023 Microsoft Corporation\n+ * Copyright(c) 2024 Ericsson AB\n  */\n \n #ifndef _RTE_BITOPS_H_\n@@ -11,12 +12,14 @@\n  * @file\n  * Bit Operations\n  *\n- * This file defines a family of APIs for bit operations\n- * without enforcing memory ordering.\n+ * This file provides functionality for low-level, single-word\n+ * arithmetic and bit-level operations, such as counting or\n+ * setting individual bits.\n  */\n \n #include <stdint.h>\n \n+#include <rte_compat.h>\n #include <rte_debug.h>\n \n #ifdef __cplusplus\n@@ -105,6 +108,196 @@ extern \"C\" {\n #define RTE_FIELD_GET64(mask, reg) \\\n \t\t((typeof(mask))(((reg) & (mask)) >> rte_ctz64(mask)))\n \n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Test bit in word.\n+ *\n+ * Generic selection macro to test the value of a bit in a 32-bit or\n+ * 64-bit word. The type of operation depends on the type of the @c\n+ * addr parameter.\n+ *\n+ * This macro does not give any guarantees in regards to memory\n+ * ordering or atomicity.\n+ *\n+ * @param addr\n+ *   A pointer to the word to modify.\n+ * @param nr\n+ *   The index of the bit.\n+ */\n+#define rte_bit_test(addr, nr)\t\t\t\t\t\\\n+\t_Generic((addr),\t\t\t\t\t\\\n+\t\tuint32_t *: __rte_bit_test32,\t\t\t\\\n+\t\tconst uint32_t *: __rte_bit_test32,\t\t\\\n+\t\tuint64_t *: __rte_bit_test64,\t\t\t\\\n+\t\tconst uint64_t *: __rte_bit_test64)(addr, nr)\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Set bit in word.\n+ *\n+ * Generic selection macro to set a bit in a 32-bit or 64-bit\n+ * word. The type of operation depends on the type of the @c addr\n+ * parameter.\n+ *\n+ * This macro does not give any guarantees in regards to memory\n+ * ordering or atomicity.\n+ *\n+ * @param addr\n+ *   A pointer to the word to modify.\n+ * @param nr\n+ *   The index of the bit.\n+ */\n+#define rte_bit_set(addr, nr)\t\t\t\t\\\n+\t_Generic((addr),\t\t\t\t\\\n+\t\t uint32_t *: __rte_bit_set32,\t\t\\\n+\t\t uint64_t *: __rte_bit_set64)(addr, nr)\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Clear bit in word.\n+ *\n+ * Generic selection macro to clear a bit in a 32-bit or 64-bit\n+ * word. The type of operation depends on the type of the @c addr\n+ * parameter.\n+ *\n+ * This macro does not give any guarantees in regards to memory\n+ * ordering or atomicity.\n+ *\n+ * @param addr\n+ *   A pointer to the word to modify.\n+ * @param nr\n+ *   The index of the bit.\n+ */\n+#define rte_bit_clear(addr, nr)\t\t\t\t\t\\\n+\t_Generic((addr),\t\t\t\t\t\\\n+\t\t uint32_t *: __rte_bit_clear32,\t\t\t\\\n+\t\t uint64_t *: __rte_bit_clear64)(addr, nr)\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Assign a value to a bit in word.\n+ *\n+ * Generic selection macro to assign a value to a bit in a 32-bit or 64-bit\n+ * word. The type of operation depends on the type of the @c addr parameter.\n+ *\n+ * This macro does not give any guarantees in regards to memory\n+ * ordering or atomicity.\n+ *\n+ * @param addr\n+ *   A pointer to the word to modify.\n+ * @param nr\n+ *   The index of the bit.\n+ * @param value\n+ *   The new value of the bit - true for '1', or false for '0'.\n+ */\n+#define rte_bit_assign(addr, nr, value)\t\t\t\t\t\\\n+\t_Generic((addr),\t\t\t\t\t\t\\\n+\t\t uint32_t *: __rte_bit_assign32,\t\t\t\\\n+\t\t uint64_t *: __rte_bit_assign64)(addr, nr, value)\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Flip a bit in word.\n+ *\n+ * Generic selection macro to change the value of a bit to '0' if '1'\n+ * or '1' if '0' in a 32-bit or 64-bit word. The type of operation\n+ * depends on the type of the @c addr parameter.\n+ *\n+ * This macro does not give any guarantees in regards to memory\n+ * ordering or atomicity.\n+ *\n+ * @param addr\n+ *   A pointer to the word to modify.\n+ * @param nr\n+ *   The index of the bit.\n+ */\n+#define rte_bit_flip(addr, nr)\t\t\t\t\t\t\\\n+\t_Generic((addr),\t\t\t\t\t\t\\\n+\t\t uint32_t *: __rte_bit_flip32,\t\t\t\t\\\n+\t\t uint64_t *: __rte_bit_flip64)(addr, nr)\n+\n+#define __RTE_GEN_BIT_TEST(family, fun, qualifier, size)\t\t\\\n+\t__rte_experimental\t\t\t\t\t\t\\\n+\tstatic inline bool\t\t\t\t\t\t\\\n+\t__rte_bit_ ## family ## fun ## size(const qualifier uint ## size ## _t *addr, \\\n+\t\t\t\t\t    unsigned int nr)\t\t\\\n+\t{\t\t\t\t\t\t\t\t\\\n+\t\tRTE_ASSERT(nr < size);\t\t\t\t\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\t\tuint ## size ## _t mask = (uint ## size ## _t)1 << nr;\t\\\n+\t\treturn *addr & mask;\t\t\t\t\t\\\n+\t}\n+\n+#define __RTE_GEN_BIT_SET(family, fun, qualifier, size)\t\t\t\\\n+\t__rte_experimental\t\t\t\t\t\t\\\n+\tstatic inline void\t\t\t\t\t\t\\\n+\t__rte_bit_ ## family ## fun ## size(qualifier uint ## size ## _t *addr, \\\n+\t\t\t\t\t    unsigned int nr)\t\t\\\n+\t{\t\t\t\t\t\t\t\t\\\n+\t\tRTE_ASSERT(nr < size);\t\t\t\t\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\t\tuint ## size ## _t mask = (uint ## size ## _t)1 << nr;\t\\\n+\t\t*addr |= mask;\t\t\t\t\t\t\\\n+\t}\t\t\t\t\t\t\t\t\\\n+\n+#define __RTE_GEN_BIT_CLEAR(family, fun, qualifier, size)\t\t\\\n+\t__rte_experimental\t\t\t\t\t\t\\\n+\tstatic inline void\t\t\t\t\t\t\\\n+\t__rte_bit_ ## family ## fun ## size(qualifier uint ## size ## _t *addr, \\\n+\t\t\t\t\t    unsigned int nr)\t\t\\\n+\t{\t\t\t\t\t\t\t\t\\\n+\t\tRTE_ASSERT(nr < size);\t\t\t\t\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\t\tuint ## size ## _t mask = ~((uint ## size ## _t)1 << nr); \\\n+\t\t(*addr) &= mask;\t\t\t\t\t\\\n+\t}\t\t\t\t\t\t\t\t\\\n+\n+#define __RTE_GEN_BIT_ASSIGN(family, fun, qualifier, size)\t\t\\\n+\t__rte_experimental\t\t\t\t\t\t\\\n+\tstatic inline void\t\t\t\t\t\t\\\n+\t__rte_bit_ ## family ## fun ## size(qualifier uint ## size ## _t *addr, \\\n+\t\t\t\t\t    unsigned int nr, bool value) \\\n+\t{\t\t\t\t\t\t\t\t\\\n+\t\tif (value)\t\t\t\t\t\t\\\n+\t\t\t__rte_bit_ ## family ## set ## size(addr, nr);\t\\\n+\t\telse\t\t\t\t\t\t\t\\\n+\t\t\t__rte_bit_ ## family ## clear ## size(addr, nr); \\\n+\t}\n+\n+#define __RTE_GEN_BIT_FLIP(family, fun, qualifier, size)\t\t\\\n+\t__rte_experimental\t\t\t\t\t\t\\\n+\tstatic inline void\t\t\t\t\t\t\\\n+\t__rte_bit_ ## family ## fun ## size(qualifier uint ## size ## _t *addr, \\\n+\t\t\t\t\t    unsigned int nr)\t\t\\\n+\t{\t\t\t\t\t\t\t\t\\\n+\t\tbool value;\t\t\t\t\t\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\t\tvalue = __rte_bit_ ## family ## test ## size(addr, nr);\t\\\n+\t\t__rte_bit_ ## family ## assign ## size(addr, nr, !value); \\\n+\t}\n+\n+__RTE_GEN_BIT_TEST(, test,, 32)\n+__RTE_GEN_BIT_SET(, set,, 32)\n+__RTE_GEN_BIT_CLEAR(, clear,, 32)\n+__RTE_GEN_BIT_ASSIGN(, assign,, 32)\n+__RTE_GEN_BIT_FLIP(, flip,, 32)\n+\n+__RTE_GEN_BIT_TEST(, test,, 64)\n+__RTE_GEN_BIT_SET(, set,, 64)\n+__RTE_GEN_BIT_CLEAR(, clear,, 64)\n+__RTE_GEN_BIT_ASSIGN(, assign,, 64)\n+__RTE_GEN_BIT_FLIP(, flip,, 64)\n+\n /*------------------------ 32-bit relaxed operations ------------------------*/\n \n /**\n@@ -787,6 +980,68 @@ rte_log2_u64(uint64_t v)\n \n #ifdef __cplusplus\n }\n+\n+/*\n+ * Since C++ doesn't support generic selection (i.e., _Generic),\n+ * function overloading is used instead. Such functions must be\n+ * defined outside 'extern \"C\"' to be accepted by the compiler.\n+ */\n+\n+#undef rte_bit_test\n+#undef rte_bit_set\n+#undef rte_bit_clear\n+#undef rte_bit_assign\n+#undef rte_bit_flip\n+\n+#define __RTE_BIT_OVERLOAD_SZ_2(fun, qualifier, size, arg1_type, arg1_name) \\\n+\tstatic inline void\t\t\t\t\t\t\\\n+\trte_bit_ ## fun(qualifier uint ## size ## _t *addr,\t\t\\\n+\t\t\targ1_type arg1_name)\t\t\t\t\\\n+\t{\t\t\t\t\t\t\t\t\\\n+\t\t__rte_bit_ ## fun ## size(addr, arg1_name);\t\t\\\n+\t}\n+\n+#define __RTE_BIT_OVERLOAD_2(fun, qualifier, arg1_type, arg1_name)\t\\\n+\t__RTE_BIT_OVERLOAD_SZ_2(fun, qualifier, 32, arg1_type, arg1_name) \\\n+\t__RTE_BIT_OVERLOAD_SZ_2(fun, qualifier, 64, arg1_type, arg1_name)\n+\n+#define __RTE_BIT_OVERLOAD_SZ_2R(fun, qualifier, size, ret_type, arg1_type, \\\n+\t\t\t\t arg1_name)\t\t\t\t\\\n+\tstatic inline ret_type\t\t\t\t\t\t\\\n+\trte_bit_ ## fun(qualifier uint ## size ## _t *addr,\t\t\\\n+\t\t\targ1_type arg1_name)\t\t\t\t\\\n+\t{\t\t\t\t\t\t\t\t\\\n+\t\treturn __rte_bit_ ## fun ## size(addr, arg1_name);\t\\\n+\t}\n+\n+#define __RTE_BIT_OVERLOAD_2R(fun, qualifier, ret_type, arg1_type, arg1_name) \\\n+\t__RTE_BIT_OVERLOAD_SZ_2R(fun, qualifier, 32, ret_type, arg1_type, \\\n+\t\t\t\t arg1_name)\t\t\t\t\\\n+\t__RTE_BIT_OVERLOAD_SZ_2R(fun, qualifier, 64, ret_type, arg1_type, \\\n+\t\t\t\t arg1_name)\n+\n+#define __RTE_BIT_OVERLOAD_SZ_3(fun, qualifier, size, arg1_type, arg1_name, \\\n+\t\t\t\targ2_type, arg2_name)\t\t\t\\\n+\tstatic inline void\t\t\t\t\t\t\\\n+\trte_bit_ ## fun(uint ## size ## _t *addr, arg1_type arg1_name,\t\\\n+\t\t\targ2_type arg2_name)\t\t\t\t\\\n+\t{\t\t\t\t\t\t\t\t\\\n+\t\t__rte_bit_ ## fun ## size(addr, arg1_name, arg2_name);\t\\\n+\t}\n+\n+#define __RTE_BIT_OVERLOAD_3(fun, qualifier, arg1_type, arg1_name, arg2_type, \\\n+\t\t\t     arg2_name)\t\t\t\t\t\\\n+\t__RTE_BIT_OVERLOAD_SZ_3(fun, qualifier, 32, arg1_type, arg1_name, \\\n+\t\t\t\targ2_type, arg2_name)\t\t\t\\\n+\t__RTE_BIT_OVERLOAD_SZ_3(fun, qualifier, 64, arg1_type, arg1_name, \\\n+\t\t\t\targ2_type, arg2_name)\n+\n+__RTE_BIT_OVERLOAD_2R(test, const, bool, unsigned int, nr)\n+__RTE_BIT_OVERLOAD_2(set,, unsigned int, nr)\n+__RTE_BIT_OVERLOAD_2(clear,, unsigned int, nr)\n+__RTE_BIT_OVERLOAD_3(assign,, unsigned int, nr, bool, value)\n+__RTE_BIT_OVERLOAD_2(flip,, unsigned int, nr)\n+\n #endif\n \n #endif /* _RTE_BITOPS_H_ */\n",
    "prefixes": [
        "RFC",
        "v7",
        "1/6"
    ]
}