get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 139878,
    "url": "https://patches.dpdk.org/api/patches/139878/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20240506082721.120666-5-mattias.ronnblom@ericsson.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20240506082721.120666-5-mattias.ronnblom@ericsson.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240506082721.120666-5-mattias.ronnblom@ericsson.com",
    "date": "2024-05-06T08:27:19",
    "name": "[RFC,v6,4/6] power: keep per-lcore state in lcore variable",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "f931ec71b46130389d36ab53e381dcc57408ecce",
    "submitter": {
        "id": 1077,
        "url": "https://patches.dpdk.org/api/people/1077/?format=api",
        "name": "Mattias Rönnblom",
        "email": "mattias.ronnblom@ericsson.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20240506082721.120666-5-mattias.ronnblom@ericsson.com/mbox/",
    "series": [
        {
            "id": 31884,
            "url": "https://patches.dpdk.org/api/series/31884/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=31884",
            "date": "2024-05-06T08:27:15",
            "name": "Lcore variables",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/31884/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/139878/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/139878/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 E0B4943FC4;\n\tMon,  6 May 2024 10:39:05 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4D7634068A;\n\tMon,  6 May 2024 10:38:35 +0200 (CEST)",
            "from EUR01-HE1-obe.outbound.protection.outlook.com\n (mail-he1eur01on2080.outbound.protection.outlook.com [40.107.13.80])\n by mails.dpdk.org (Postfix) with ESMTP id DF67E402DE\n for <dev@dpdk.org>; Mon,  6 May 2024 10:38:26 +0200 (CEST)",
            "from DU6P191CA0028.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:53f::14)\n by AM9PR07MB7057.eurprd07.prod.outlook.com (2603:10a6:20b:2c1::19) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Mon, 6 May\n 2024 08:38:25 +0000",
            "from DU2PEPF00028D04.eurprd03.prod.outlook.com\n (2603:10a6:10:53f:cafe::4) by DU6P191CA0028.outlook.office365.com\n (2603:10a6:10:53f::14) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41 via Frontend\n Transport; Mon, 6 May 2024 08:38:23 +0000",
            "from oa.msg.ericsson.com (192.176.1.74) by\n DU2PEPF00028D04.mail.protection.outlook.com (10.167.242.164) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.7519.19 via Frontend Transport; Mon, 6 May 2024 08:38:23 +0000",
            "from seliicinfr00050.seli.gic.ericsson.se (153.88.142.248) by\n smtp-central.internal.ericsson.com (100.87.178.61) with Microsoft SMTP Server\n id 15.2.1544.9; Mon, 6 May 2024 10:38:23 +0200",
            "from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100])\n by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id\n 234B71C006A; Mon,  6 May 2024 10:38:23 +0200 (CEST)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=kTJKZiZfz46RD2yPKUMHcWCvu10VUQErMKridACMChFQVa4MY/QqGPAed/rrFGAlnlx2LzT5UD2E9YMRYIG8aCQx9z1lw6EFVWlPqW26xoFOxA5oOGKnCTpiYdhFmuYvv9dZGnSiATgyplQar5FRVRquL7lvrneVsTTbdQNDl2GN6OONUXrH+2FsUnwQPKnSYRS8/81eIKLeBxyC8Y0z5NUgcocYL7yTr4Vkgmb+Ee1yh2rxACxnlWCR++HVynoym3gipSn6CngNGM95o9NV5xSop1yQnsMfjp5Qf1po3jAiCtmzBgSxl3fScureZL4Fu0pREv0jSiV5jRrT8LPvrA==",
        "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=UAPG5IrKv36TlW4hfjOUZ0AP0ETcFjlN5y7QwuYr6i8=;\n b=Bh8sqDo/gpMqc5kNvSzMEdecAhXpFYJ4ypepDnjO7bWUOsGlJbryNAfxPh6+OT57Sx8Nw5ySh1cwTS1BhbIioazv2SVIESky79GfJjMY1RzNgStAuixOxSGno0eif+9p1VWMCT4c9D/PTMSo3/mPkTPuusKSujuozCRx4NvAzTt5Mg21ITYRBXcQPxKuUY3hxy6i5MgtS3sJ56lj5BiExqzpIzXcMZf/CIilCo3pIGTXwIqXorYpsIceWMO+Hh0PzCDR/3ksoyBayjj1EWe7VWMQTbrQYk4MLoaPE0C/YfKEg3HXY43Bw1mFI1zxPxxb+OaMa6HfpCkEImlI5wXHuA==",
        "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=UAPG5IrKv36TlW4hfjOUZ0AP0ETcFjlN5y7QwuYr6i8=;\n b=WNpYou7kzk4+XoWP20xAAuQL2alsjw5NI3K17lvn7uHcR0hl20AAWMlmmyBob1ohgnjD1WXJyUGlxWN/Re04dPUwZio88aySa2SKbLes+EqBW1JiYi81pk8XPbde8bisMKVtBKkxsUj9VouJfSb0SatAf7oLpOs6EFD07Ij+XjIgKX12r1Nm2bIPQJ/sm7SxTLGgDTuvsdHfYejZn4kEwCaPLRQ1JsvHYVM4+rwKtcq4DSB2JKUqqi5Trb0Uti5avZ3V0k2ScllYVjD25lr2q+mO8gtIckIIxiCkZnjdIYni/mk1f7SqCXG5dxWjubpEh8PUAxSq6fx6xOEqs9ERCw==",
        "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>,\n Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>, =?utf-8?q?Mattias_R?=\n\t=?utf-8?q?=C3=B6nnblom?= <mattias.ronnblom@ericsson.com>",
        "Subject": "[RFC v6 4/6] power: keep per-lcore state in lcore variable",
        "Date": "Mon, 6 May 2024 10:27:19 +0200",
        "Message-ID": "<20240506082721.120666-5-mattias.ronnblom@ericsson.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20240506082721.120666-1-mattias.ronnblom@ericsson.com>",
        "References": "<20240228100928.524277-2-mattias.ronnblom@ericsson.com>\n <20240506082721.120666-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": "DU2PEPF00028D04:EE_|AM9PR07MB7057:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "9ae2840b-7287-4ce6-3694-08dc6da7e461",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;\n ARA:13230031|1800799015|82310400017|36860700004|376005;",
        "X-Microsoft-Antispam-Message-Info": "=?utf-8?q?Fp1Nh8gM7X2EiWT22mYZbmiCc1und0E?=\n\t=?utf-8?q?R0taRyAt7hHhBJkDVy84+i61uaMV/XpIRrW4JK6txepp01sIvNQS8v89kkmnJ/YZL?=\n\t=?utf-8?q?m6UdkrVq4CbPmBqVehckND4j33fK4Cf0pElAd41rffHV+O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?q?PgniIPLF/HGztXAm657zngU/8BqTl9xQgKBD/5egyqpXXraQ+tTNNMMaGnttMcXdO?=\n\t=?utf-8?q?8cz4lF4LDsSNo3MHEkc7BVsfkhVUoM4G0oHYGTkz7S5I1ebA1V4E2ZjZg/+TfmqCV?=\n\t=?utf-8?q?xAe5mLKWY7mhI3WJ6L+xThzG3TDOJOzjJEiv0gI1B+e+YEXFKCslCWKoLepw8WgNg?=\n\t=?utf-8?q?hZQN/twVNudz37fiopxO1m948c10B+F2bz8I/kgokuLDUiXimRS14wmus3eE7cEv4?=\n\t=?utf-8?q?SXVRcAjs9gsAZMNc7Fh0hSYj8DTEhuSsXiTA/X5jFxtFh+RhuChfQGMFDto8n+nus?=\n\t=?utf-8?q?tcjjODpqm/Y4yrDLhLU/O/wLz448dDLThFY3Nth/pztglg7iFaqxu93A=3D?=",
        "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)(1800799015)(82310400017)(36860700004)(376005);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "ericsson.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "06 May 2024 08:38:23.7060 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 9ae2840b-7287-4ce6-3694-08dc6da7e461",
        "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 DU2PEPF00028D04.eurprd03.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "AM9PR07MB7057",
        "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 | 34 ++++++++++++++++------------------\n 1 file changed, 16 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/lib/power/rte_power_pmd_mgmt.c b/lib/power/rte_power_pmd_mgmt.c\nindex b1c18a5f56..a5139dd4f7 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@@ -69,7 +70,7 @@ struct __rte_cache_aligned pmd_core_cfg {\n \tuint64_t sleep_target;\n \t/**< Prevent a queue from triggering sleep multiple times */\n };\n-static struct pmd_core_cfg lcore_cfgs[RTE_MAX_LCORE];\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",
        "v6",
        "4/6"
    ]
}