get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 139673,
    "url": "http://patchwork.dpdk.org/api/patches/139673/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20240425085853.97888-3-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": "<20240425085853.97888-3-mattias.ronnblom@ericsson.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240425085853.97888-3-mattias.ronnblom@ericsson.com",
    "date": "2024-04-25T08:58:49",
    "name": "[RFC,v2,2/6] eal: add unit tests for bit operations",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "7633aceed04cf17da768ee6e05d0aa082df59f24",
    "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/20240425085853.97888-3-mattias.ronnblom@ericsson.com/mbox/",
    "series": [
        {
            "id": 31818,
            "url": "http://patchwork.dpdk.org/api/series/31818/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31818",
            "date": "2024-04-25T08:58:47",
            "name": "Improve EAL bit operations API",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/31818/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/139673/comments/",
    "check": "pending",
    "checks": "http://patchwork.dpdk.org/api/patches/139673/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 DE56C43F04;\n\tThu, 25 Apr 2024 11:10:05 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2998E436CC;\n\tThu, 25 Apr 2024 11:10:02 +0200 (CEST)",
            "from EUR01-HE1-obe.outbound.protection.outlook.com\n (mail-he1eur01on2085.outbound.protection.outlook.com [40.107.13.85])\n by mails.dpdk.org (Postfix) with ESMTP id 1F63C436BF\n for <dev@dpdk.org>; Thu, 25 Apr 2024 11:10:00 +0200 (CEST)",
            "from DUZP191CA0048.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:4f8::8) by\n DBBPR07MB7420.eurprd07.prod.outlook.com (2603:10a6:10:1e4::5) with\n Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.7519.22; Thu, 25 Apr 2024 09:09:58 +0000",
            "from DU2PEPF0001E9C2.eurprd03.prod.outlook.com\n (2603:10a6:10:4f8:cafe::70) by DUZP191CA0048.outlook.office365.com\n (2603:10a6:10:4f8::8) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.25 via Frontend\n Transport; Thu, 25 Apr 2024 09:09:58 +0000",
            "from oa.msg.ericsson.com (192.176.1.74) by\n DU2PEPF0001E9C2.mail.protection.outlook.com (10.167.8.71) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.7519.19 via Frontend Transport; Thu, 25 Apr 2024 09:09:58 +0000",
            "from seliicinfr00050.seli.gic.ericsson.se (153.88.142.248) by\n smtp-central.internal.ericsson.com (100.87.178.65) with Microsoft SMTP Server\n id 15.2.1258.12; Thu, 25 Apr 2024 11:09:57 +0200",
            "from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100])\n by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id\n 18A3A1C006A; Thu, 25 Apr 2024 11:09:57 +0200 (CEST)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=LOYSmHajmF45uwZwYYcEp0jKFqCu2PYPU1yydKSXGQz2NlAlaESu8+InoVJvseY/+2hOBengEK/JaRA7PbUrtObOKsoYCt9NI9F9DxGZOT4FyORpFCdco5dG2jsYEfCHUqMPXGSnXqSapGhegnoev1Vr7RoeIsy2bluJcFVSiqdS4NtRdj/oiVAGjr/C3zRXS1Vyn27ttxreQSvHETQI67pisgaw28jX8qDQ0/Ur5POb9ku4JSlptFqkx4EVmd6KXz4M+7oHzIGgcmfR8cF4ng1vGbIUQA9iRkLe7ILzj3AiBvuybB0P4PEkrVPCAAGHNi5lIWUdcnWZrrq1o/HOvQ==",
        "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=UAXttjTnMNYVno4iLY1+608dHrWTK4YyrJUpoliiT/k=;\n b=BatapY27STw0FuKEsmj8YsDyl0yPZ5d6HKpOdST21Lx9TzE7AdROOZ42S5vem3eD5ihPuDG2ZKofZKlYwOucORGi01OHDQBmsp32UpzTKO3+vtpxXkxupFrEWDwIpYS5y3AeOzLophZHg9xkbjLvKFHqT4Dj3OhsHYQ77XVB/4yuwhtRiBdyupxgkEGF2KQcZN56DFbR3rH+fqulzu+IVn38Evm0CdYtrHJbyTeuYGiPXSHuZs7mV1BQmHi5JE2dlr3UpNVGa3kOIHZGZ/IE7cwGA7qr7C/iIgYhugdZe/UzV9OzKHcnKqzp+NmPm7TQXvttIq4ksm0Xk4HsEpWHOQ==",
        "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=UAXttjTnMNYVno4iLY1+608dHrWTK4YyrJUpoliiT/k=;\n b=akb05kjnqKlI+48wBC28d7hFChjSSoVte2mLzFIP3OgNEjxX2GhEu/fVauHtaK6j1Her5kX0ZcLsIgLgw8jm+2Ma0sACkbmiCRphQpJyuqBl0fdUVmv4EHb9MgFZ40t1IFui/XDn99pCedrJVBe+DO4j19K/gXxVFiQxI+lSABh4GwGqr/8mIkz6EraprR0bKtX1XRBVjfmYpIo6pcX39Yksm2DHm8aoocrun6B7h25jU9Nt+VWfdnP58Bh80gmGY9+E1uEwnBwg8U/nCr6RmqjRAQwDuPCsKq6qdfKDD1A/Ftg1ATkW48dmI7RI7oT4Sw2Dr4p4k4e/JU7szabziw==",
        "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>, =?utf-8?q?Mattias_R=C3=B6nnb?=\n\t=?utf-8?q?lom?= <mattias.ronnblom@ericsson.com>",
        "Subject": "[RFC v2 2/6] eal: add unit tests for bit operations",
        "Date": "Thu, 25 Apr 2024 10:58:49 +0200",
        "Message-ID": "<20240425085853.97888-3-mattias.ronnblom@ericsson.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20240425085853.97888-1-mattias.ronnblom@ericsson.com>",
        "References": "<20240302135328.531940-2-mattias.ronnblom@ericsson.com>\n <20240425085853.97888-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": "DU2PEPF0001E9C2:EE_|DBBPR07MB7420:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "0f24ff4f-f1da-444b-1a40-08dc65077b1a",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;\n ARA:13230031|36860700004|82310400014|376005|1800799015;",
        "X-Microsoft-Antispam-Message-Info": "=?utf-8?q?xbz/QTitZdbTb9onFuws9c9ndsfW9AW?=\n\t=?utf-8?q?LjGk74OcXVrlug5/mleohILDoiQLXjyINDU0b+cm2Gz+AKA0x3+ZfZWjbCqkwhf/K?=\n\t=?utf-8?q?gejaWl1pb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3xJLBfhlLsjee5Q9jrHdBII5WlargKaxKL0g?=\n\t=?utf-8?q?lJky0cN0fS4fdyHWiJtHdTiPr7A0v9yrww2GHm4Gxg7kIEXlcjdln3gLgge6hjVLq?=\n\t=?utf-8?q?gbaH/jhmtcetLSFdbN+vf/q+GarD5ObAkMay4GVEsMHXbKuYy/Sw+WXxZNc+0wYmT?=\n\t=?utf-8?q?uQn6oPcTmGeEvEcUoDukiMe6NVXAkhPAC5AptFua/LX4fRArkr7PZ8zEUMmJWSEcb?=\n\t=?utf-8?q?8MU7TV9YqXEULW4zkYUhalp72wx3UgbdtLYbMPPtebaVGxpJrbHrODrVSNFHXA50g?=\n\t=?utf-8?q?P2MClRafOrrUl1axvHzXkVhO4pa74eA8ztNGZCxNRhJxj89V66ePL9+1HAd+HaWvl?=\n\t=?utf-8?q?9/UUJ3NUNQCqGQ6cJ0aJvONzkjS94QqF6Un3DkZ9ZThiLeYaXmkLKRoHkFdGXfRi7?=\n\t=?utf-8?q?JOR+d98kYAeF?=",
        "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)(36860700004)(82310400014)(376005)(1800799015);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "ericsson.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "25 Apr 2024 09:09:58.3471 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 0f24ff4f-f1da-444b-1a40-08dc65077b1a",
        "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 DU2PEPF0001E9C2.eurprd03.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "DBBPR07MB7420",
        "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": "Extend bitops tests to cover the rte_bit_[set|clear|assign|test]()\nfamily of functions.\n\nThe tests are converted to use the test suite runner framework.\n\nSigned-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>\n---\n app/test/test_bitops.c | 76 +++++++++++++++++++++++++++++++++---------\n 1 file changed, 61 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/app/test/test_bitops.c b/app/test/test_bitops.c\nindex 0d4ccfb468..f788b561a0 100644\n--- a/app/test/test_bitops.c\n+++ b/app/test/test_bitops.c\n@@ -1,13 +1,59 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n  * Copyright(c) 2019 Arm Limited\n+ * Copyright(c) 2024 Ericsson AB\n  */\n \n+#include <stdbool.h>\n+\n #include <rte_launch.h>\n #include <rte_bitops.h>\n+#include <rte_random.h>\n #include \"test.h\"\n \n-uint32_t val32;\n-uint64_t val64;\n+#define GEN_TEST_BIT_ACCESS(test_name, set_fun, clear_fun, assign_fun,\t\\\n+\t\t\t    test_fun, size)\t\t\t\t\\\n+\tstatic int\t\t\t\t\t\t\t\\\n+\ttest_name(void)\t\t\t\t\t\t\t\\\n+\t{\t\t\t\t\t\t\t\t\\\n+\t\tuint ## size ## _t reference = (uint ## size ## _t)rte_rand(); \\\n+\t\tunsigned int bit_nr;\t\t\t\t\t\\\n+\t\tuint ## size ## _t word = (uint ## size ## _t)rte_rand(); \\\n+\t\t\t\t\t\t\t\t\t\\\n+\t\tfor (bit_nr = 0; bit_nr < size; bit_nr++) {\t\t\\\n+\t\t\tbool reference_bit = (reference >> bit_nr) & 1;\t\\\n+\t\t\tbool assign = rte_rand() & 1;\t\t\t\\\n+\t\t\tif (assign)\t\t\t\t\t\\\n+\t\t\t\tassign_fun(&word, bit_nr, reference_bit); \\\n+\t\t\telse {\t\t\t\t\t\t\\\n+\t\t\t\tif (reference_bit)\t\t\t\\\n+\t\t\t\t\tset_fun(&word, bit_nr);\t\t\\\n+\t\t\t\telse\t\t\t\t\t\\\n+\t\t\t\t\tclear_fun(&word, bit_nr);\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\t\t\t}\t\t\t\t\t\t\\\n+\t\t\tTEST_ASSERT(test_fun(&word, bit_nr) == reference_bit, \\\n+\t\t\t\t    \"Bit %d had unexpected value\", bit_nr); \\\n+\t\t}\t\t\t\t\t\t\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\t\tfor (bit_nr = 0; bit_nr < size; bit_nr++) {\t\t\\\n+\t\t\tbool reference_bit = (reference >> bit_nr) & 1;\t\\\n+\t\t\tTEST_ASSERT(test_fun(&word, bit_nr) == reference_bit, \\\n+\t\t\t\t    \"Bit %d had unexpected value\", bit_nr); \\\n+\t\t}\t\t\t\t\t\t\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\t\tTEST_ASSERT(reference == word, \"Word had unexpected value\"); \\\n+\t\t\t\t\t\t\t\t\t\\\n+\t\treturn TEST_SUCCESS;\t\t\t\t\t\\\n+\t}\n+\n+GEN_TEST_BIT_ACCESS(test_bit_access_32, rte_bit_set, rte_bit_clear, \\\n+\t\t    rte_bit_assign, rte_bit_test, 32)\n+\n+GEN_TEST_BIT_ACCESS(test_bit_access_64, rte_bit_set, rte_bit_clear, \\\n+\t\t    rte_bit_assign, rte_bit_test, 64)\n+\n+static uint32_t val32;\n+static uint64_t val64;\n \n #define MAX_BITS_32 32\n #define MAX_BITS_64 64\n@@ -117,22 +163,22 @@ test_bit_relaxed_test_set_clear(void)\n \treturn TEST_SUCCESS;\n }\n \n+static struct unit_test_suite test_suite = {\n+\t.suite_name = \"Bitops test suite\",\n+\t.unit_test_cases = {\n+\t\tTEST_CASE(test_bit_access_32),\n+\t\tTEST_CASE(test_bit_access_64),\n+\t\tTEST_CASE(test_bit_relaxed_set),\n+\t\tTEST_CASE(test_bit_relaxed_clear),\n+\t\tTEST_CASE(test_bit_relaxed_test_set_clear),\n+\t\tTEST_CASES_END()\n+\t}\n+};\n+\n static int\n test_bitops(void)\n {\n-\tval32 = 0;\n-\tval64 = 0;\n-\n-\tif (test_bit_relaxed_set() < 0)\n-\t\treturn TEST_FAILED;\n-\n-\tif (test_bit_relaxed_clear() < 0)\n-\t\treturn TEST_FAILED;\n-\n-\tif (test_bit_relaxed_test_set_clear() < 0)\n-\t\treturn TEST_FAILED;\n-\n-\treturn TEST_SUCCESS;\n+\treturn unit_test_suite_runner(&test_suite);\n }\n \n REGISTER_FAST_TEST(bitops_autotest, true, true, test_bitops);\n",
    "prefixes": [
        "RFC",
        "v2",
        "2/6"
    ]
}