get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 139718,
    "url": "http://patches.dpdk.org/api/patches/139718/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240429095138.106849-2-mattias.ronnblom@ericsson.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": "<20240429095138.106849-2-mattias.ronnblom@ericsson.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240429095138.106849-2-mattias.ronnblom@ericsson.com",
    "date": "2024-04-29T09:51:33",
    "name": "[RFC,v3,1/6] eal: extend bit manipulation functionality",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "c5bedafd8b4bd70fe1827a85265d47df6a582305",
    "submitter": {
        "id": 1077,
        "url": "http://patches.dpdk.org/api/people/1077/?format=api",
        "name": "Mattias Rönnblom",
        "email": "mattias.ronnblom@ericsson.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/20240429095138.106849-2-mattias.ronnblom@ericsson.com/mbox/",
    "series": [
        {
            "id": 31838,
            "url": "http://patches.dpdk.org/api/series/31838/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31838",
            "date": "2024-04-29T09:51:32",
            "name": "Improve EAL bit operations API",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/31838/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/139718/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/139718/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 F2EDA43F49;\n\tMon, 29 Apr 2024 12:02:10 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 67D2F402BE;\n\tMon, 29 Apr 2024 12:02:07 +0200 (CEST)",
            "from EUR04-DB3-obe.outbound.protection.outlook.com\n (mail-db3eur04on2083.outbound.protection.outlook.com [40.107.6.83])\n by mails.dpdk.org (Postfix) with ESMTP id 3D203402C6\n for <dev@dpdk.org>; Mon, 29 Apr 2024 12:02:06 +0200 (CEST)",
            "from AM0PR06CA0094.eurprd06.prod.outlook.com (2603:10a6:208:fa::35)\n by DU2PR07MB8238.eurprd07.prod.outlook.com (2603:10a6:10:277::5) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Mon, 29 Apr\n 2024 10:02:04 +0000",
            "from AMS0EPF000001B6.eurprd05.prod.outlook.com\n (2603:10a6:208:fa:cafe::3c) by AM0PR06CA0094.outlook.office365.com\n (2603:10a6:208:fa::35) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34 via Frontend\n Transport; Mon, 29 Apr 2024 10:02:04 +0000",
            "from oa.msg.ericsson.com (192.176.1.74) by\n AMS0EPF000001B6.mail.protection.outlook.com (10.167.16.170) 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; Mon, 29 Apr 2024 10:02:04 +0000",
            "from seliicinfr00050.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; Mon, 29 Apr 2024 12:02:04 +0200",
            "from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100])\n by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id\n 68CE91C006A; Mon, 29 Apr 2024 12:02:04 +0200 (CEST)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=CfV9DJgPxBTwBC++0L99FWER4YgavUImCL7F0nBGVzBzA3wHqRd8bFT/37zkTHJlGvu2npCTYLlCrvK5PWDOX+0P80D9CnQFVBD5QOYWJlCf1Qm1ilHK0J9hh6MrHi3hnIZ/LesL0fFB0hAtIDjVnLyGNtUukeIo3RdAeEnDMvMoiZaY6YCmnVxyrTNgw9C/raG4RUAAfnC9P1Wlk/PuDnqftrQpar+uUDbgDv9wu90Bjck+scXXeLcZsUz0vYcEV7I9n36K45fjkBmJtr/6L+510Oux61Yypu6kpmaOHru5XxaEwM5b53yVG+FmcRpzbSX4puXouKL6aoQtpnBXvQ==",
        "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=IqnbVv24AfUXeFe4Y3k5gSs3DT/2YMpJZI9hY4gF6co=;\n b=dPRH3nEM4k7J5O6ad7EL99EHK3fw1nzLexvLmjkFHZrS4IcPVpCcWi7RbKKBYOCzH3PeACng3ugEYsqWgVjryvna8WsU4WzYgigjXoOOKngGJx8TorJ2nV2oBEMb0xYikzuHjnXBC0dlSdevuFT+p1lQlZY5TO9xiJ4/jzlen8+YVipAPpRpDrXS02hpa8rF1RHPidPLKFfxyH1c9/epgE9QdxzqSwQ9lrFtPrZ1koL4iUv4s/LImIiYusTb9bzX7NIDZp3ixr/u1Yt65YyX9b8AD7fV/uYcYChFWdj+NRnA/ns3i/QBkdmTAHF036lowpC/qklbIqlYUHLsxCHGwA==",
        "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=IqnbVv24AfUXeFe4Y3k5gSs3DT/2YMpJZI9hY4gF6co=;\n b=H9bPWPyFbdKdFaaTIlCf9mf7vExofd9/axsFijBNtmayjX85c5EPgPy3PrczPDwkrZ79/MerpYQIkpbZbUXTAQzLrkmD8k1F4bJp6LAq5il9SsgBBfr/g4+O7hiH1CxXHBqhxyxKluys+53/ZnSkqd+85rYnghx5DJZXvrH3ZeFGVrVEsMWSJluuct5Y6Lf0YYuDqsCWUHQtRhHuBwDjTLK5JUkInH79xYuqkJZqEBVJz0nLLlgsE4xMbUGDot9ctWvXb+/070rUPNXBhH+iAci8EHaJs0XGGr2COzTAhX9kiCNF6oOtoq9mduS081H049+0yS1f8R9kBGMDXH3IZw==",
        "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 v3 1/6] eal: extend bit manipulation functionality",
        "Date": "Mon, 29 Apr 2024 11:51:33 +0200",
        "Message-ID": "<20240429095138.106849-2-mattias.ronnblom@ericsson.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20240429095138.106849-1-mattias.ronnblom@ericsson.com>",
        "References": "<20240425085853.97888-2-mattias.ronnblom@ericsson.com>\n <20240429095138.106849-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": "AMS0EPF000001B6:EE_|DU2PR07MB8238:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "34454810-d851-42aa-7768-08dc68336c3a",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;\n ARA:13230031|376005|36860700004|1800799015|82310400014;",
        "X-Microsoft-Antispam-Message-Info": "=?utf-8?q?i54GKR9HCuRHfnP58lJJO73Rn0wTJXZ?=\n\t=?utf-8?q?qiPPifZwxWZhSPSjp+laO6U+Rp2FwnJ4hsV6/nMYi1ooydnC7YdkcRpy2ByqNkX67?=\n\t=?utf-8?q?9aMRcENppOMin3GpNQB/VctnPbb2PoAU438ySOLVw7cCSDfqNxrXSAa1xU0Cq5x/I?=\n\t=?utf-8?q?V0lwBKBl1jIbdztWXD1I755CHQaxWNhswa0CyMQcXwZus/gA169YFL+0r7K+CVW/F?=\n\t=?utf-8?q?m63sFvCaNYMMcabFTogzBi+G6Bj8Fpf9VxxIGfTKrDJECWaf7pQpLZ8CrupWE7g9N?=\n\t=?utf-8?q?iczaxzuacxjXXmU+8hKMHZ/3ibIrj3EqE3khJpzOJPdnuoZcv4VH1MLtJVqzFYWs0?=\n\t=?utf-8?q?XSRVQ1tyt5IsjLZu+juWAzwnLirF21MdfImlis2NeUkuIh9BDeVgb1FXVQ77RN2gk?=\n\t=?utf-8?q?JGBeechAFsy0/cljYHNSNSJPdkQcsjHe1z8RI94z1d6pg5jMkbALwLDHoDaRDkvNk?=\n\t=?utf-8?q?aHXma+D6JU/yY3MGDKt+5FrPBt4uT1WH7uW3DHalhl4MO6WWus0/g8QVVgCfUGdqt?=\n\t=?utf-8?q?C9yNmVpm9i//TG/rsxDtock/Py9mU6MuReDELowqlbtmNSGDN4fvsqyeSdNMWVkm1?=\n\t=?utf-8?q?AHChMPUU2Iz5jpMUUWsSsGsabte9LFecmqlm39CS+IFZOzx/J8PXBhvjh4wsUrEoz?=\n\t=?utf-8?q?oXcD3/d3udK9hmqMYmjVGoVIBKk2kCQQpXVjGuK2Z/HrcEiJBVDY9Rwsq6szBefOG?=\n\t=?utf-8?q?ek4vjYEOREzxakwL7N+QQt/0gJchcUDWT0L+Q4VJzv4LEu//Vvs8i2CZGZMdiHEFa?=\n\t=?utf-8?q?Nr4sAeMbIhjaHLRBfF7N2YmmWAD4zLFS97AaqUqS9vdeHJbEupy79kjyIsuelRzVk?=\n\t=?utf-8?q?EuGLn84869h3USOrKxHjqbUeACQL1hJrNNQju6UyJk0CTJqS3doqFgLQPj2qGyJGA?=\n\t=?utf-8?q?YWH0YHZiWdlhBvzEsGTSZRllEDxR/Mblp3uRnkn0Ak7lu4TZwBqSbXlYx9NQDLhJ2?=\n\t=?utf-8?q?ouN46CgCl8c3jm8cENzVqEKz/hECLfxlKtgcrK0TM8GcxFm+fKlb5Z4zeCKZEBQlH?=\n\t=?utf-8?q?4YqbAzSZgxuXY+3UJKjmTIhSeDTaEKXcgjkUvfGn8sVVIAqVxNnrjI6+Tc2SGIOiT?=\n\t=?utf-8?q?1lVDMC38fUcvVM4D0YR1gOx97I8QxSVfjX82eyg2ShQBdqXtQh2WZHd/UkIy32R93?=\n\t=?utf-8?q?+smx/lZeX3qXAl7Wh4o4LwMY7sTUo4DEC9l/MQSeYUmV2Si16x6Eqp5JvIFw55aKa?=\n\t=?utf-8?q?pqNaBy+AHPSg1a/72K8L9hQqar3XxkEpn0l5GsVS4CIqroVIyXzFKxsZilZ8frL06?=\n\t=?utf-8?q?Acij5mncMIa7qmuggMnRDZtG/6FtfLNADnIYt66Ct5yGJkSQWwl9dq0SXqQXnZmMF?=\n\t=?utf-8?q?6QoWHH+nslGj?=",
        "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)(1800799015)(82310400014);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "ericsson.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "29 Apr 2024 10:02:04.7690 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 34454810-d851-42aa-7768-08dc68336c3a",
        "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 AMS0EPF000001B6.eurprd05.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "DU2PR07MB8238",
        "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, set, clear, and assign the value to\nindividual bits in 32-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 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>\n---\n lib/eal/include/rte_bitops.h | 218 ++++++++++++++++++++++++++++++++++-\n 1 file changed, 216 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/lib/eal/include/rte_bitops.h b/lib/eal/include/rte_bitops.h\nindex 449565eeae..fb2e3dae7b 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,157 @@ 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\t uint32_t *: __rte_bit_test32,\t\t\t\\\n+\t\t 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+#define __RTE_GEN_BIT_TEST(name, size, qualifier)\t\t\t\\\n+\tstatic inline bool\t\t\t\t\t\t\\\n+\tname(const qualifier uint ## size ## _t *addr, unsigned int nr)\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(name, size, qualifier)\t\t\t\\\n+\tstatic inline void\t\t\t\t\t\t\\\n+\tname(qualifier uint ## size ## _t *addr, unsigned int nr)\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(name, size, qualifier)\t\t\t\\\n+\tstatic inline void\t\t\t\t\t\t\\\n+\tname(qualifier uint ## size ## _t *addr, unsigned int nr)\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+__RTE_GEN_BIT_TEST(__rte_bit_test32, 32, )\n+__RTE_GEN_BIT_SET(__rte_bit_set32, 32, )\n+__RTE_GEN_BIT_CLEAR(__rte_bit_clear32, 32, )\n+\n+__RTE_GEN_BIT_TEST(__rte_bit_test64, 64, )\n+__RTE_GEN_BIT_SET(__rte_bit_set64, 64, )\n+__RTE_GEN_BIT_CLEAR(__rte_bit_clear64, 64, )\n+\n+__rte_experimental\n+static inline void\n+__rte_bit_assign32(uint32_t *addr, unsigned int nr, bool value)\n+{\n+\tif (value)\n+\t\t__rte_bit_set32(addr, nr);\n+\telse\n+\t\t__rte_bit_clear32(addr, nr);\n+}\n+\n+__rte_experimental\n+static inline void\n+__rte_bit_assign64(uint64_t *addr, unsigned int nr, bool value)\n+{\n+\tif (value)\n+\t\t__rte_bit_set64(addr, nr);\n+\telse\n+\t\t__rte_bit_clear64(addr, nr);\n+}\n+\n /*------------------------ 32-bit relaxed operations ------------------------*/\n \n /**\n@@ -787,6 +941,66 @@ 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+\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+\n #endif\n \n #endif /* _RTE_BITOPS_H_ */\n",
    "prefixes": [
        "RFC",
        "v3",
        "1/6"
    ]
}