Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/137802/?format=api
http://patches.dpdk.org/api/patches/137802/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240302135328.531940-5-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": "<20240302135328.531940-5-mattias.ronnblom@ericsson.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20240302135328.531940-5-mattias.ronnblom@ericsson.com", "date": "2024-03-02T13:53:25", "name": "[RFC,4/7] eal: add generic once-type bit operations macros", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "f9e56768641acbf0d4c387e46eb30732c95a7b5b", "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/20240302135328.531940-5-mattias.ronnblom@ericsson.com/mbox/", "series": [ { "id": 31345, "url": "http://patches.dpdk.org/api/series/31345/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31345", "date": "2024-03-02T13:53:21", "name": "Improve EAL bit operations API", "version": 1, "mbox": "http://patches.dpdk.org/series/31345/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/137802/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/137802/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 9E87843C3A;\n\tSat, 2 Mar 2024 15:02:33 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D8A1942DA7;\n\tSat, 2 Mar 2024 15:02:19 +0100 (CET)", "from EUR05-AM6-obe.outbound.protection.outlook.com\n (mail-am6eur05on2052.outbound.protection.outlook.com [40.107.22.52])\n by mails.dpdk.org (Postfix) with ESMTP id 21B56402BF\n for <dev@dpdk.org>; Sat, 2 Mar 2024 15:02:18 +0100 (CET)", "from AM5PR0101CA0007.eurprd01.prod.exchangelabs.com\n (2603:10a6:206:16::20) by AM8PR07MB8215.eurprd07.prod.outlook.com\n (2603:10a6:20b:322::13) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.41; Sat, 2 Mar\n 2024 14:02:16 +0000", "from AMS0EPF000001A8.eurprd05.prod.outlook.com\n (2603:10a6:206:16:cafe::17) by AM5PR0101CA0007.outlook.office365.com\n (2603:10a6:206:16::20) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.37 via Frontend\n Transport; Sat, 2 Mar 2024 14:02:16 +0000", "from oa.msg.ericsson.com (192.176.1.74) by\n AMS0EPF000001A8.mail.protection.outlook.com (10.167.16.148) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.7362.11 via Frontend Transport; Sat, 2 Mar 2024 14:02:16 +0000", "from seliicinfr00050.seli.gic.ericsson.se (153.88.142.248) by\n smtp-central.internal.ericsson.com (100.87.178.63) with Microsoft SMTP Server\n id 15.2.1258.12; Sat, 2 Mar 2024 15:02:16 +0100", "from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100])\n by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id\n 1F5621C006A; Sat, 2 Mar 2024 15:02:16 +0100 (CET)" ], "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=ZmdsXWvxmWs15gkVdQeBLRS7XL9peUBPaHskJ2Y7NTHDjPyv3eyhi1bYNYlsnWX7vZd7ka20KC6FrruULWgkzAwALPU9YZZaVQZvkqr0w36YYEpOi7ISsV8bWx/omCr5XN+KdGBo7A050k5reZAJ4vxmkr/1KUtELhxJILD2K0u88XfBpn0kU9BHFnlZLyjRzPWz7L0r829/fx5gyuuqR2b5zR13S6SVBAZdMcwJcimuw1YEGEFhU10usY4UDBgrhDbCNvOKGVMkzS+54AvQSxuxI0YDmX6QkAb+mfjmCKV6WDIm1G5Sp9QhkcPmaZjRjjjLrcCuTtGPo+UkxJBbFg==", "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=8z3Sa+R7lxDoOAiWDmTLT1QEsTh2Vl65n2WcREml0WU=;\n b=igJMC3WOoeoQHZHMI3ZnZCo05DkeJ1Ox4rdcdaHFnzMTpV4FiHgMRR+66EzRu8jl3HbHTk08LgqON29vPtgFT4uj9ZyxCrhQdgk7DeDHvwe4tI4oCCwm9ExRXa+0kiBlnBeP1ZgNLo4vkPjbv6wSCoKp1ayGOUNS5Tz1HSk0qCuYb6ZWyDEBLC8UfOz6WvZv3/j9TOdv+hSVqN/FzCnY2ure4JIWsG6T4gzVWkJ24u/XzJCfIRwSw3khkCA+BoJDlU1BxViWdW+2AQfIbGJ2IR7ldzUB+L3EbokLOsvTf/m1sV4vOU2c0W/ZXrzWXom0PCqteEoOCtkw6aLyWYQzJg==", "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=8z3Sa+R7lxDoOAiWDmTLT1QEsTh2Vl65n2WcREml0WU=;\n b=kVK1ZPRmkvcxOpW+cOW/fORJoFFaXgqjb/+EM+WsSmQcABiW5VAiH2/01s6viZq0Gxr42UIqf1N5v3z4cOO5eVM/7ASJqM8B6g+SusKedVs4g1MLBlKA0FHPNqCyN1PFepmTysw/mMGxG7JCgE6JaSCsAQ3eABxq3qkrODSU9gsdEWQp8qewPbfsqreCCiZO0738e3O3J8q8WmEhcPjZmFKdF2VkdvJG13vgfz2cfigpS8P5YU/1rjbUXPLE9awkuz0X5t9oxctXfFwoHUh1ZOKoSVj6enesOBfG7yszeU+Y/Iy2yqzK4TpxwmG+JPB2Rhjqf4RfV3lJBEHg32FPbw==", "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>, =?utf-8?q?M?=\n\t=?utf-8?q?attias_R=C3=B6nnblom?= <mattias.ronnblom@ericsson.com>", "Subject": "[RFC 4/7] eal: add generic once-type bit operations macros", "Date": "Sat, 2 Mar 2024 14:53:25 +0100", "Message-ID": "<20240302135328.531940-5-mattias.ronnblom@ericsson.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20240302135328.531940-1-mattias.ronnblom@ericsson.com>", "References": "<20240302135328.531940-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": "AMS0EPF000001A8:EE_|AM8PR07MB8215:EE_", "X-MS-Office365-Filtering-Correlation-Id": "35456850-a03f-4bba-374d-08dc3ac15e6e", "X-MS-Exchange-SenderADCheck": "1", "X-MS-Exchange-AntiSpam-Relay": "0", "X-Microsoft-Antispam": "BCL:0;", "X-Microsoft-Antispam-Message-Info": "\n UXuxOG1auY9dSvHEFHjTVNmVZvZIQ7+O8zJ+xw6Ii4O2WOYAJ76RJl9Hr+LPrL9LwJEUZJtmBnGuzJ0KM8XN1y7SkI5TWfWW05IWFV1eYc4BNt7mXC4llC2Vb94OerVZfKv8JWkqGc8IPLo53fmDhktmYBkumx/JHscgy0hA4Sb5Tp/P7K97FDJ87W0HDXkso2fAJiWcO1YR6ksSzxR0+j0xWzgdge4Hh3QLZM1nCxcr9oFBZGnq1PmngXk8L0YyiBmsXDwCYooOBlTOwcebw3wRBi8CvMQRG9hVslez5wLS3M3n+I1T2hzHvZtVoEu9s8MsbyTbLwvMeC1z6XWQbCQEtXQn8FvLy0fwfUdKZ3Bv6aRK4EzE8YghF8KWV9H5ghd0jhp/X/rFozHaoTjKOCaQEEcqaOnelW+71VedGzBrLV1rLMTVjOQLPRRdA8ntwejRpdI6BhEpJMq4/tYd5n1jC5pQaK9tC9qwpipfcf1qGB4r1YsAzU8hmp+mIbH+jaQvy8xgJ1ACLosS0VE403PJLGmXME5UvO6RIDvrLmZMmo4fg57T4W40MtlRf0J5lkzQNcZTwVUF4aTXS4/q3wp68jeJ0QR9ap/973SLL4FKX0p6dJis+U+aMpTOqBirGLN36Cb5AyNaVBij44+hkdNso3AFTpzt1iuoNH8i5Bd3O3SD877+6PSGwGynUesKl5g4KmWgEYJcGRvAI4aDu+L97T4aybrAQa77o7ChsCcO0tDpdMl+oRPJ2EeihpnT", "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)(82310400014); DIR:OUT;\n SFP:1101;", "X-OriginatorOrg": "ericsson.com", "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "02 Mar 2024 14:02:16.6523 (UTC)", "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 35456850-a03f-4bba-374d-08dc3ac15e6e", "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 AMS0EPF000001A8.eurprd05.prod.outlook.com", "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous", "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "AM8PR07MB8215", "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 macros for once-type bit operations operating on both 32-bit and\n64-bit words by means of C11 generic selection.\n\nSigned-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>\n---\n lib/eal/include/rte_bitops.h | 101 +++++++++++++++++++++++++++++++++++\n 1 file changed, 101 insertions(+)", "diff": "diff --git a/lib/eal/include/rte_bitops.h b/lib/eal/include/rte_bitops.h\nindex 3118c51748..450334c751 100644\n--- a/lib/eal/include/rte_bitops.h\n+++ b/lib/eal/include/rte_bitops.h\n@@ -188,6 +188,107 @@ extern \"C\" {\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+ * Test exactly once if a particular bit in a word is set.\n+ *\n+ * Generic selection macro to exactly once test the value of a bit in\n+ * a 32-bit or 64-bit word. The type of operation depends on the type\n+ * of the @c addr parameter.\n+ *\n+ * This macro is guaranteed to result in exactly one memory load. See\n+ * rte_bit_once_test32() for more information and uses cases for the\n+ * \"once\" class of functions.\n+ *\n+ * rte_bit_once_test() does give any guarantees in regards to memory\n+ * ordering or atomicity.\n+ *\n+ * @param addr\n+ * A pointer to the word to query.\n+ * @param nr\n+ * The index of the bit.\n+ * @return\n+ * Returns true if the bit is set, and false otherwise.\n+ */\n+\n+#define rte_bit_once_test(addr, nr)\t\t\t\t\\\n+\t_Generic((addr),\t\t\t\t\t\\\n+\t\t uint32_t *: rte_bit_once_test32,\t\t\\\n+\t\t uint64_t *: rte_bit_once_test64)(addr, nr)\n+\n+/**\n+ * Set bit in word exactly once.\n+ *\n+ * Set bit specified by @c nr in the word pointed to by @c addr to '1'\n+ * exactly once.\n+ *\n+ * This function is guaranteed to result in exactly one memory load\n+ * and exactly one memory store, *or* an atomic bit set operation.\n+ *\n+ * See rte_bit_test_once32() for more information and uses cases for\n+ * the \"once\" class of functions.\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_once_set(addr, nr)\t\t\t\t\\\n+\t_Generic((addr),\t\t\t\t\t\\\n+\t\t uint32_t *: rte_bit_once_set32,\t\t\\\n+\t\t uint64_t *: rte_bit_once_set64)(addr, nr)\n+\n+/**\n+ * Clear bit in word exactly once.\n+ *\n+ * Set bit specified by @c nr in the word pointed to by @c addr to '0'\n+ * exactly once.\n+ *\n+ * This function is guaranteed to result in exactly one memory load\n+ * and exactly one memory store, *or* an atomic bit clear operation.\n+ *\n+ * See rte_bit_test_once32() for more information and uses cases for\n+ * the \"once\" class of functions.\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_once_clear(addr, nr)\t\t\t\t\\\n+\t_Generic((addr),\t\t\t\t\t\\\n+\t\t uint32_t *: rte_bit_once_clear32,\t\t\\\n+\t\t uint64_t *: rte_bit_once_clear64)(addr, nr)\n+\n+/**\n+ * Assign a value to bit in a word exactly once.\n+ *\n+ * Set bit specified by @c nr in the word pointed to by @c addr to the\n+ * value indicated by @c value exactly once.\n+ *\n+ * This function is guaranteed to result in exactly one memory load\n+ * and exactly one memory store, *or* an atomic bit clear operation.\n+ *\n+ * This function 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_once_assign(addr, nr, value)\t\t\t\t\\\n+\t_Generic((addr),\t\t\t\t\t\t\\\n+\t\t uint32_t *: rte_bit_once_assign32,\t\t\t\\\n+\t\t uint64_t *: rte_bit_once_assign64)(addr, nr, value)\n+\n /**\n * Test if a particular bit in a 32-bit word is set.\n *\n", "prefixes": [ "RFC", "4/7" ] }{ "id": 137802, "url": "