get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2215706,
    "url": "http://patchwork.ozlabs.org/api/patches/2215706/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20260325063143.261806-2-przemyslaw.kitszel@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260325063143.261806-2-przemyslaw.kitszel@intel.com>",
    "list_archive_url": null,
    "date": "2026-03-25T06:26:52",
    "name": "[net-next,1/2] devlink: unify devlink_shd_get_priv() into devlink_priv()",
    "commit_ref": null,
    "pull_url": null,
    "state": "handled-elsewhere",
    "archived": false,
    "hash": "182e77bcd9fcc18050430a1d4d1a043ce3f0c79f",
    "submitter": {
        "id": 85252,
        "url": "http://patchwork.ozlabs.org/api/people/85252/?format=api",
        "name": "Przemek Kitszel",
        "email": "przemyslaw.kitszel@intel.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20260325063143.261806-2-przemyslaw.kitszel@intel.com/mbox/",
    "series": [
        {
            "id": 497384,
            "url": "http://patchwork.ozlabs.org/api/series/497384/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=497384",
            "date": "2026-03-25T06:26:51",
            "name": "devlink: shared devlink improvements",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/497384/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2215706/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2215706/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256\n header.s=default header.b=hjTSI8ZZ;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=140.211.166.136; helo=smtp3.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fgcXG6XMpz1yG7\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 17:32:30 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id 6FE6B60A72;\n\tWed, 25 Mar 2026 06:32:28 +0000 (UTC)",
            "from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id 5G6ujGLe_5CY; Wed, 25 Mar 2026 06:32:27 +0000 (UTC)",
            "from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id 9D99360A82;\n\tWed, 25 Mar 2026 06:32:27 +0000 (UTC)",
            "from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n by lists1.osuosl.org (Postfix) with ESMTP id 158FA353\n for <intel-wired-lan@lists.osuosl.org>; Wed, 25 Mar 2026 06:32:26 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp1.osuosl.org (Postfix) with ESMTP id 0797781E95\n for <intel-wired-lan@lists.osuosl.org>; Wed, 25 Mar 2026 06:32:26 +0000 (UTC)",
            "from smtp1.osuosl.org ([127.0.0.1])\n by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id v7UHlOqmNifS for <intel-wired-lan@lists.osuosl.org>;\n Wed, 25 Mar 2026 06:32:25 +0000 (UTC)",
            "from mgamail.intel.com (mgamail.intel.com [198.175.65.14])\n by smtp1.osuosl.org (Postfix) with ESMTPS id BDD7381E82\n for <intel-wired-lan@lists.osuosl.org>; Wed, 25 Mar 2026 06:32:24 +0000 (UTC)",
            "from fmviesa008.fm.intel.com ([10.60.135.148])\n by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 24 Mar 2026 23:32:03 -0700",
            "from irvmail002.ir.intel.com ([10.43.11.120])\n by fmviesa008.fm.intel.com with ESMTP; 24 Mar 2026 23:31:56 -0700",
            "from pkitszel-desk.tendawifi.com (unknown [10.245.245.24])\n by irvmail002.ir.intel.com (Postfix) with ESMTP id 9095E2FC6;\n Wed, 25 Mar 2026 06:31:54 +0000 (GMT)"
        ],
        "X-Virus-Scanned": [
            "amavis at osuosl.org",
            "amavis at osuosl.org"
        ],
        "X-Comment": "SPF check N/A for local connections - client-ip=140.211.166.142;\n helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=<UNKNOWN> ",
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 smtp3.osuosl.org 9D99360A82",
            "OpenDKIM Filter v2.11.0 smtp1.osuosl.org BDD7381E82"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org;\n\ts=default; t=1774420347;\n\tbh=pXCcTwKb1lLOpjLS5Q7uk+ANua3ZXes7YNzR6hx485M=;\n\th=From:To:Date:In-Reply-To:References:Subject:List-Id:\n\t List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:\n\t Cc:From;\n\tb=hjTSI8ZZuef6UOC3+iEOK7qFbJLoFCrjIYTkEgNFF/IpNAfLVNx/K/0DZqlhN5Frd\n\t iW4JOhFK/Ld3KMdDD1GU37h+450seo5WbdM/AxUR/xy5VnHXFOnVhAakFQAvuMksHw\n\t 3s65ySkXIHSu5ad8d7WraazWPjiU/Jk9BuqFBUjG8F6utE1NN0SzBSyUL17qjxVDV+\n\t liNKgXlOO35sPrAukSQ/hTLcmYaQzmBfsBwUHiXNYD/yeQYtZ3hPaR8RCymTTtmDO4\n\t 0iuKAxiwsnBAlWCn1pCxNxhjCffKBWi5D0JS9b75EDtFYvZcDoEVsOCI/w882YfxM7\n\t dBxKcZv0IEzCg==",
        "Received-SPF": "Pass (mailfrom) identity=mailfrom; client-ip=198.175.65.14;\n helo=mgamail.intel.com; envelope-from=przemyslaw.kitszel@intel.com;\n receiver=<UNKNOWN>",
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 smtp1.osuosl.org BDD7381E82",
        "X-CSE-ConnectionGUID": [
            "1cTWFjQuSkijLoxu5OOemA==",
            "xGulh6gmTcuT57k7D1q5RQ=="
        ],
        "X-CSE-MsgGUID": [
            "Co4ZpzceT5qzT0KtIfHpyQ==",
            "qPQk9mTjT8WgBzbn8tkU0g=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6800,10657,11739\"; a=\"79308068\"",
            "E=Sophos;i=\"6.23,139,1770624000\"; d=\"scan'208\";a=\"79308068\"",
            "E=Sophos;i=\"6.23,139,1770624000\"; d=\"scan'208\";a=\"221693629\""
        ],
        "X-ExtLoop1": "1",
        "From": "Przemek Kitszel <przemyslaw.kitszel@intel.com>",
        "To": "Jiri Pirko <jiri@resnulli.us>, netdev@vger.kernel.org,\n Jakub Kicinski <kuba@kernel.org>",
        "Date": "Wed, 25 Mar 2026 07:26:52 +0100",
        "Message-ID": "<20260325063143.261806-2-przemyslaw.kitszel@intel.com>",
        "X-Mailer": "git-send-email 2.51.1",
        "In-Reply-To": "<20260325063143.261806-1-przemyslaw.kitszel@intel.com>",
        "References": "<20260325063143.261806-1-przemyslaw.kitszel@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Mailman-Original-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1774420345; x=1805956345;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=h4RRCfcEdmRZK9RVaAKuvBOS4NvEEsJkb8bg0Tcf2SI=;\n b=br2HxiAphAAiFs+aAGEYvIsozIdzfz361knstHxuNyJjlNGS0nu3eN/p\n atHuzwFtip30O9zzYsmp8DKytm1nkVhP8I4CetE6H8eCKTYURdcnnTa7K\n yWhtg1/U39Z0WPMPnz0+S9RnBbhN2vh6VTFCTEtBQ0WAKIOa2VtwsLcVW\n 95EexCJJcG/D02pJGt011uzloXdJhRjBnrfyXraAPukdNJfuqyhzqdYHW\n Le8GYxuI8yVZOXollrXNMM+BP372nhEkGqBwgIy4JWRsLy+cBh3JWBGxw\n hszXNAsaE4HZBltYj8t3xjrOBDByZZ44StnEEuVoOe7Ih6qQR0hdHDROf\n A==;",
        "X-Mailman-Original-Authentication-Results": [
            "smtp1.osuosl.org;\n dmarc=pass (p=none dis=none)\n header.from=intel.com",
            "smtp1.osuosl.org;\n dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com\n header.a=rsa-sha256 header.s=Intel header.b=br2HxiAp"
        ],
        "Subject": "[Intel-wired-lan] [PATCH net-next 1/2] devlink: unify\n devlink_shd_get_priv() into devlink_priv()",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.30",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Cc": "Przemek Kitszel <przemyslaw.kitszel@intel.com>,\n Aleksandr Loktionov <aleksandr.loktionov@intel.com>, edumazet@google.com,\n intel-wired-lan@lists.osuosl.org, horms@kernel.org,\n Tony Nguyen <anthony.l.nguyen@intel.com>, pabeni@redhat.com,\n davem@davemloft.net",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "Unify access API to shared devlink priv data with normal devlink.\n\nThanks to Jiri Pirko, we now have ability to create shared devlink\ninstances [1]. Introduction series have added usage of those for mlx, but\nwithout priv data attached to the shared devlink.\n\nCurrent API makes it possible to access shared devlink instance's priv\ndata:\n\n\tvoid *devlink_shd_get_priv(struct devlink *devlink);\n\nbut it is easy to forget (especially during rebase from \"before shared\ndevlinks\" era) and call:\n\n\tvoid *devlink_priv(struct devlink *devlink);\n\nwhich even has the same signature, so it's hard to catch the error.\n\nNew proposed API unifies both calls into one, without any increase in the\nobserved struct size. (Alternative could be to store additional pointer,\nset during devlink_alloc).\n\nUnexport the less convenient API call.\n\n[1] commit 411ad0605875 (\"Merge branch 'devlink-introduce-shared-devlink-instance-for-pfs-on-same-chip'\")\n[1] https://lore.kernel.org/all/20260312100407.551173-1-jiri@resnulli.us\n\nSigned-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>\n---\nv1:\nhttps://lore.kernel.org/netdev/20260323132136.13191-1-przemyslaw.kitszel@intel.com\n\nv2:\n- fix typos (Alex, Jiri)\n- fix infinite recurrence (Alex)\n- add __devlink_priv(), which is more general than v1's devlink_to_shd()\n  (Jiri)\n---\n net/devlink/devl_internal.h |  7 +++++++\n net/devlink/core.c          | 10 +++++++++-\n net/devlink/sh_dev.c        |  8 ++++----\n 3 files changed, 20 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/net/devlink/devl_internal.h b/net/devlink/devl_internal.h\nindex 7dfb7cdd2d23..0a57318d92f8 100644\n--- a/net/devlink/devl_internal.h\n+++ b/net/devlink/devl_internal.h\n@@ -58,6 +58,7 @@ struct devlink {\n \tstruct mutex lock;\n \tstruct lock_class_key lock_key;\n \tu8 reload_failed:1;\n+\tu8 is_shd:1;\n \trefcount_t refcount;\n \tstruct rcu_work rwork;\n \tstruct devlink_rel *rel;\n@@ -72,6 +73,12 @@ struct devlink *__devlink_alloc(const struct devlink_ops *ops, size_t priv_size,\n \t\t\t\tstruct net *net, struct device *dev,\n \t\t\t\tconst struct device_driver *dev_driver);\n \n+/* Get priv allocated for struct devlink */\n+void *__devlink_priv(struct devlink *devlink);\n+\n+/* Get private data from shared devlink instance */\n+void *devlink_shd_get_priv(struct devlink *devlink);\n+\n #define devl_warn(devlink, format, args...)\t\t\t\t\\\n \tdo {\t\t\t\t\t\t\t\t\\\n \t\tif ((devlink)->dev)\t\t\t\t\t\\\ndiff --git a/net/devlink/core.c b/net/devlink/core.c\nindex eeb6a71f5f56..a242be203fe8 100644\n--- a/net/devlink/core.c\n+++ b/net/devlink/core.c\n@@ -230,10 +230,18 @@ int devlink_rel_devlink_handle_put(struct sk_buff *msg, struct devlink *devlink,\n \treturn err;\n }\n \n-void *devlink_priv(struct devlink *devlink)\n+void *__devlink_priv(struct devlink *devlink)\n {\n \treturn &devlink->priv;\n }\n+\n+void *devlink_priv(struct devlink *devlink)\n+{\n+\tif (devlink->is_shd)\n+\t\treturn devlink_shd_get_priv(devlink);\n+\n+\treturn __devlink_priv(devlink);\n+}\n EXPORT_SYMBOL_GPL(devlink_priv);\n \n struct devlink *priv_to_devlink(void *priv)\ndiff --git a/net/devlink/sh_dev.c b/net/devlink/sh_dev.c\nindex 85acce97e788..b85e5cb1edbe 100644\n--- a/net/devlink/sh_dev.c\n+++ b/net/devlink/sh_dev.c\n@@ -43,13 +43,14 @@ static struct devlink_shd *devlink_shd_create(const char *id,\n \t\t\t\t  &init_net, NULL, driver);\n \tif (!devlink)\n \t\treturn NULL;\n-\tshd = devlink_priv(devlink);\n+\tshd = __devlink_priv(devlink);\n \n \tshd->id = kstrdup(id, GFP_KERNEL);\n \tif (!shd->id)\n \t\tgoto err_devlink_free;\n \tshd->priv_size = priv_size;\n \trefcount_set(&shd->refcount, 1);\n+\tdevlink->is_shd = 1;\n \n \tdevl_lock(devlink);\n \tdevl_register(devlink);\n@@ -136,7 +137,7 @@ void devlink_shd_put(struct devlink *devlink)\n \tstruct devlink_shd *shd;\n \n \tmutex_lock(&shd_mutex);\n-\tshd = devlink_priv(devlink);\n+\tshd = __devlink_priv(devlink);\n \tif (refcount_dec_and_test(&shd->refcount))\n \t\tdevlink_shd_destroy(shd);\n \tmutex_unlock(&shd_mutex);\n@@ -154,8 +155,7 @@ EXPORT_SYMBOL_GPL(devlink_shd_put);\n  */\n void *devlink_shd_get_priv(struct devlink *devlink)\n {\n-\tstruct devlink_shd *shd = devlink_priv(devlink);\n+\tstruct devlink_shd *shd = __devlink_priv(devlink);\n \n \treturn shd->priv;\n }\n-EXPORT_SYMBOL_GPL(devlink_shd_get_priv);\n",
    "prefixes": [
        "net-next",
        "1/2"
    ]
}