get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 137418,
    "url": "http://patches.dpdk.org/api/patches/137418/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240228100928.524277-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": "<20240228100928.524277-5-mattias.ronnblom@ericsson.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240228100928.524277-5-mattias.ronnblom@ericsson.com",
    "date": "2024-02-28T10:09:26",
    "name": "[RFC,v5,4/6] power: keep per-lcore state in lcore variable",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "b18edf43e034ee53c560f0a3f5b2e8e3912cb4b8",
    "submitter": {
        "id": 1077,
        "url": "http://patches.dpdk.org/api/people/1077/?format=api",
        "name": "Mattias Rönnblom",
        "email": "mattias.ronnblom@ericsson.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20240228100928.524277-5-mattias.ronnblom@ericsson.com/mbox/",
    "series": [
        {
            "id": 31270,
            "url": "http://patches.dpdk.org/api/series/31270/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31270",
            "date": "2024-02-28T10:09:22",
            "name": "Lcore variables",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/31270/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/137418/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/137418/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 44C2143C1F;\n\tWed, 28 Feb 2024 11:17:53 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 3880A427E8;\n\tWed, 28 Feb 2024 11:17:38 +0100 (CET)",
            "from EUR04-HE1-obe.outbound.protection.outlook.com\n (mail-he1eur04on2040.outbound.protection.outlook.com [40.107.7.40])\n by mails.dpdk.org (Postfix) with ESMTP id 86F3D40DDB\n for <dev@dpdk.org>; Wed, 28 Feb 2024 11:17:24 +0100 (CET)",
            "from DU2PR04CA0233.eurprd04.prod.outlook.com (2603:10a6:10:2b1::28)\n by PAXPR07MB7821.eurprd07.prod.outlook.com (2603:10a6:102:13c::11)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.37; Wed, 28 Feb\n 2024 10:17:23 +0000",
            "from DU6PEPF0000B620.eurprd02.prod.outlook.com\n (2603:10a6:10:2b1:cafe::32) by DU2PR04CA0233.outlook.office365.com\n (2603:10a6:10:2b1::28) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.27 via Frontend\n Transport; Wed, 28 Feb 2024 10:17:22 +0000",
            "from oa.msg.ericsson.com (192.176.1.74) by\n DU6PEPF0000B620.mail.protection.outlook.com (10.167.8.136) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.7292.25 via Frontend Transport; Wed, 28 Feb 2024 10:17:22 +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.1258.12; Wed, 28 Feb 2024 11:17:22 +0100",
            "from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100])\n by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id\n 1A85D380061; Wed, 28 Feb 2024 11:17:22 +0100 (CET)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=QiNr7Eljkb8nM+MRdrsbgpfBShpIDiH+g51pHX8TbWYyDWM16QtA6JppLV7bgO/TOfzEryXNj55Zfe2S7QI4JziCWCm6eSnNKoVB2Qwr6ycJAvoI2hRnLLzQs3bkpwsLnhdLKxu+yKriBFmHU85EGWqk3TDTXgIzllulMKQlxAPjP2p+sBK9PEnZCCst4X8AYjpvCqFb0KPuri4DHxCI9hW/uo7erOYWj/MpQLB0sKocjpIJNBmt2jZi8bJDMbw3HS+YHgUy6w+YUEb+qxW3bHKypghaPYa9u3DMVBiW4xJtqh3PehRBAQgAWSSJ1X5IC1dHs4CXvFZ1IHFgTHxa/A==",
        "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=r6P73IjIGICPMlen7Dz9PuYmagHog0FDx6vR5RaQ6yk=;\n b=cZ0+HxD/T+29NxzmbkhSI+XpQbwymZK/ZpLpVz8piVWvp8bNGtC03IVtH6anWeTMUUWZewJ4lLkDEbTMHjVz7iEHAA4VhA25xR4bQO1lSl1i6jd8x1/cYUY2SgBT86vA2iquEowHYGFMu8wpc/nSywlkvpUXWxQaUV0h8ZOEQ1EjvyaHURS21Nm/g1tIPe3bGqqnlJuOtcwZyc0mt9lULH03f4t4LQtvovV2z5QZqZfOZv2GMl+559qpxM0WdXaVaPOYXnGJig0leiWXJHlPr998F0B8C6u2s49CFEmUKAwxNhqZeqDfkmFY29IOXmBeCU4XRDc9g+cD+uGIzwvvzA==",
        "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=r6P73IjIGICPMlen7Dz9PuYmagHog0FDx6vR5RaQ6yk=;\n b=M+GtHtkoYYzCw1n+/+6T9QwiXT/YpNFMfy02RJ8qSo/XyeFh1akwEwlI83GxN3k4ZHu9ttc0f30DLjz96ew9W7BmXYp96f2WFoRb2cbHf4vF35cwdu8L9KB3Zu7UpakNO6Hmc4l08Kaa4Z2fh/NiVNDUpROpASgr6dqsliTFT5cSyRvWxI0CCZG82lVk/sVAj7PNisORDns5JQyHplvFavPN8GwJx41rK+HQOEQj1Dx2GGASwYWm8vDSE0ras9ue4rrA2GsFDfetXtqS7HqWoze0qPwwesDDygGJDJpJWObSEQS+Q6+pxmrUyJVp9Xep277EqkkJaTAs/zDcY54w/g==",
        "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>,\n =?utf-8?q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com>,\n Stephen Hemminger <stephen@networkplumber.org>, =?utf-8?q?Mattias_R=C3=B6nn?=\n\t=?utf-8?q?blom?= <mattias.ronnblom@ericsson.com>",
        "Subject": "[RFC v5 4/6] power: keep per-lcore state in lcore variable",
        "Date": "Wed, 28 Feb 2024 11:09:26 +0100",
        "Message-ID": "<20240228100928.524277-5-mattias.ronnblom@ericsson.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20240228100928.524277-1-mattias.ronnblom@ericsson.com>",
        "References": "<20240225150330.517225-2-mattias.ronnblom@ericsson.com>\n <20240228100928.524277-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": "DU6PEPF0000B620:EE_|PAXPR07MB7821:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "b369456c-0003-4d25-66dd-08dc38467430",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n T8jOL4VOpU9YFzpF/KMbE4nE1vDxFezT7FQZa9ZYfvP1NVlEgRo+LQkbiZmqMHkgvZ4Z6jiEre7D3+vo8216Blk64kjHh3GAw0h+qpFpuYk1S9K9TPpSIxX4yW+seH56fE1C6mSEnahm2gkHB5LDVIXUe6+WyDkkA9jfzydWOY0RPX7WVCYtXM991ExnFPIk60hB73R35/xSMLIh9deL0Tz16KcogBDPLHOl4t3jtv4OhBu2q3Bixj59Oj1zVzKYMVSBYY1Rn0JUXE+t3MDxr2n8qo3++ovQXgcG1bvVhZCoRrO/pXdelf76pYoYrhdHzK+AhIU0pCC3GiXL4zzQcM4ZlWQZroJ24XgEiiXskK4v/AmYxRC4riiHvNPbTeZrPtTq+2/rfI7JUfCJmH1lV3ygUCtffCTd7FTEIliqd+DbwbsoVrw22Jc/Azd8TCWfqFrfrwa1VjLKAFDaHDIui5Lxo/4p/yX+3MWirQ49umjiwoOnE2wJ78A4JOxpbzHLYQ0/bnFRGZLO0/MHJUB7eaU1Rd3dpX5ynZiP62KMbqxizrjvWwUjq3OkT1fkUGGG79C7q3Mr0DQLcuQD6kCW/g3XC+SirtREDT8B+uhJGiCJKuHtZews4ZBjXyRtTrnlGRRGNojOKyh+Fh1G9khP20mqTUtRwzOQRQR9pl7091VCBw/jgDXnMSLgkfO8JUYdTDGDcFblNIcUUoqsH0fctmGVOhAUQDMbb4NGcRx5mtidx5hYPIJtnbodjnQQql50",
        "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)(82310400014)(36860700004); DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "ericsson.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "28 Feb 2024 10:17:22.7025 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n b369456c-0003-4d25-66dd-08dc38467430",
        "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 DU6PEPF0000B620.eurprd02.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "PAXPR07MB7821",
        "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": "Replace static array of cache-aligned structs with an lcore variable,\nto slightly benefit code simplicity and performance.\n\nRFC v3:\n * Replace for loop with FOREACH macro.\n\nSigned-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>\nAcked-by: Morten Brørup <mb@smartsharesystems.com>\n---\n lib/power/rte_power_pmd_mgmt.c | 36 ++++++++++++++++------------------\n 1 file changed, 17 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/lib/power/rte_power_pmd_mgmt.c b/lib/power/rte_power_pmd_mgmt.c\nindex 591fc69f36..595c8091e6 100644\n--- a/lib/power/rte_power_pmd_mgmt.c\n+++ b/lib/power/rte_power_pmd_mgmt.c\n@@ -5,6 +5,7 @@\n #include <stdlib.h>\n \n #include <rte_lcore.h>\n+#include <rte_lcore_var.h>\n #include <rte_cycles.h>\n #include <rte_cpuflags.h>\n #include <rte_malloc.h>\n@@ -68,8 +69,8 @@ struct pmd_core_cfg {\n \t/**< Number of queues ready to enter power optimized state */\n \tuint64_t sleep_target;\n \t/**< Prevent a queue from triggering sleep multiple times */\n-} __rte_cache_aligned;\n-static struct pmd_core_cfg lcore_cfgs[RTE_MAX_LCORE];\n+};\n+static RTE_LCORE_VAR_HANDLE(struct pmd_core_cfg, lcore_cfgs);\n \n static inline bool\n queue_equal(const union queue *l, const union queue *r)\n@@ -252,12 +253,11 @@ clb_multiwait(uint16_t port_id __rte_unused, uint16_t qidx __rte_unused,\n \t\tstruct rte_mbuf **pkts __rte_unused, uint16_t nb_rx,\n \t\tuint16_t max_pkts __rte_unused, void *arg)\n {\n-\tconst unsigned int lcore = rte_lcore_id();\n \tstruct queue_list_entry *queue_conf = arg;\n \tstruct pmd_core_cfg *lcore_conf;\n \tconst bool empty = nb_rx == 0;\n \n-\tlcore_conf = &lcore_cfgs[lcore];\n+\tlcore_conf = RTE_LCORE_VAR_VALUE(lcore_cfgs);\n \n \t/* early exit */\n \tif (likely(!empty))\n@@ -317,13 +317,12 @@ clb_pause(uint16_t port_id __rte_unused, uint16_t qidx __rte_unused,\n \t\tstruct rte_mbuf **pkts __rte_unused, uint16_t nb_rx,\n \t\tuint16_t max_pkts __rte_unused, void *arg)\n {\n-\tconst unsigned int lcore = rte_lcore_id();\n \tstruct queue_list_entry *queue_conf = arg;\n \tstruct pmd_core_cfg *lcore_conf;\n \tconst bool empty = nb_rx == 0;\n \tuint32_t pause_duration = rte_power_pmd_mgmt_get_pause_duration();\n \n-\tlcore_conf = &lcore_cfgs[lcore];\n+\tlcore_conf = RTE_LCORE_VAR_VALUE(lcore_cfgs);\n \n \tif (likely(!empty))\n \t\t/* early exit */\n@@ -358,9 +357,8 @@ clb_scale_freq(uint16_t port_id __rte_unused, uint16_t qidx __rte_unused,\n \t\tstruct rte_mbuf **pkts __rte_unused, uint16_t nb_rx,\n \t\tuint16_t max_pkts __rte_unused, void *arg)\n {\n-\tconst unsigned int lcore = rte_lcore_id();\n \tconst bool empty = nb_rx == 0;\n-\tstruct pmd_core_cfg *lcore_conf = &lcore_cfgs[lcore];\n+\tstruct pmd_core_cfg *lcore_conf = RTE_LCORE_VAR_VALUE(lcore_cfgs);\n \tstruct queue_list_entry *queue_conf = arg;\n \n \tif (likely(!empty)) {\n@@ -518,7 +516,7 @@ rte_power_ethdev_pmgmt_queue_enable(unsigned int lcore_id, uint16_t port_id,\n \t\tgoto end;\n \t}\n \n-\tlcore_cfg = &lcore_cfgs[lcore_id];\n+\tlcore_cfg = RTE_LCORE_VAR_LCORE_VALUE(lcore_id, lcore_cfgs);\n \n \t/* check if other queues are stopped as well */\n \tret = cfg_queues_stopped(lcore_cfg);\n@@ -619,7 +617,7 @@ rte_power_ethdev_pmgmt_queue_disable(unsigned int lcore_id,\n \t}\n \n \t/* no need to check queue id as wrong queue id would not be enabled */\n-\tlcore_cfg = &lcore_cfgs[lcore_id];\n+\tlcore_cfg = RTE_LCORE_VAR_LCORE_VALUE(lcore_id, lcore_cfgs);\n \n \t/* check if other queues are stopped as well */\n \tret = cfg_queues_stopped(lcore_cfg);\n@@ -769,21 +767,21 @@ rte_power_pmd_mgmt_get_scaling_freq_max(unsigned int lcore)\n }\n \n RTE_INIT(rte_power_ethdev_pmgmt_init) {\n-\tsize_t i;\n-\tint j;\n+\tstruct pmd_core_cfg *lcore_cfg;\n+\tint i;\n+\n+\tRTE_LCORE_VAR_ALLOC(lcore_cfgs);\n \n \t/* initialize all tailqs */\n-\tfor (i = 0; i < RTE_DIM(lcore_cfgs); i++) {\n-\t\tstruct pmd_core_cfg *cfg = &lcore_cfgs[i];\n-\t\tTAILQ_INIT(&cfg->head);\n-\t}\n+\tRTE_LCORE_VAR_FOREACH_VALUE(lcore_cfg, lcore_cfgs)\n+\t\tTAILQ_INIT(&lcore_cfg->head);\n \n \t/* initialize config defaults */\n \temptypoll_max = 512;\n \tpause_duration = 1;\n \t/* scaling defaults out of range to ensure not used unless set by user or app */\n-\tfor (j = 0; j < RTE_MAX_LCORE; j++) {\n-\t\tscale_freq_min[j] = 0;\n-\t\tscale_freq_max[j] = UINT32_MAX;\n+\tfor (i = 0; i < RTE_MAX_LCORE; i++) {\n+\t\tscale_freq_min[i] = 0;\n+\t\tscale_freq_max[i] = UINT32_MAX;\n \t}\n }\n",
    "prefixes": [
        "RFC",
        "v5",
        "4/6"
    ]
}