Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2235021/?format=api
{ "id": 2235021, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2235021/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20260508124208.11622-2-przemyslaw.kitszel@intel.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/1.2/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": "<20260508124208.11622-2-przemyslaw.kitszel@intel.com>", "list_archive_url": null, "date": "2026-05-08T12:41:54", "name": "[iwl-next,v1,01/15] devlink, mlx5: add init/fini ops for shared devlink", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "d9a8090c64fbde53997566ff6d130ec2bbe9c358", "submitter": { "id": 85252, "url": "http://patchwork.ozlabs.org/api/1.2/people/85252/?format=api", "name": "Przemek Kitszel", "email": "przemyslaw.kitszel@intel.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20260508124208.11622-2-przemyslaw.kitszel@intel.com/mbox/", "series": [ { "id": 503388, "url": "http://patchwork.ozlabs.org/api/1.2/series/503388/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=503388", "date": "2026-05-08T12:41:53", "name": "devlink, mlx5, iavf, ice: XLVF for iavf", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/503388/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2235021/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2235021/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=B6qXyC7j;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137])\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 4gBq2t5mzmz1yCg\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 08 May 2026 22:59:50 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby smtp4.osuosl.org (Postfix) with ESMTP id 60D2940E67;\n\tFri, 8 May 2026 12:59:49 +0000 (UTC)", "from smtp4.osuosl.org ([127.0.0.1])\n by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id M1SSmOVLIQl2; Fri, 8 May 2026 12:59:48 +0000 (UTC)", "from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])\n\tby smtp4.osuosl.org (Postfix) with ESMTP id 894E540F2F;\n\tFri, 8 May 2026 12:59:48 +0000 (UTC)", "from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137])\n by lists1.osuosl.org (Postfix) with ESMTP id 227A8317\n for <intel-wired-lan@lists.osuosl.org>; Fri, 8 May 2026 12:59:45 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n by smtp4.osuosl.org (Postfix) with ESMTP id C377640E37\n for <intel-wired-lan@lists.osuosl.org>; Fri, 8 May 2026 12:59:44 +0000 (UTC)", "from smtp4.osuosl.org ([127.0.0.1])\n by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id Lwqxn286oC4B for <intel-wired-lan@lists.osuosl.org>;\n Fri, 8 May 2026 12:59:44 +0000 (UTC)", "from mgamail.intel.com (mgamail.intel.com [198.175.65.17])\n by smtp4.osuosl.org (Postfix) with ESMTPS id C766F40E67\n for <intel-wired-lan@lists.osuosl.org>; Fri, 8 May 2026 12:59:43 +0000 (UTC)", "from fmviesa005.fm.intel.com ([10.60.135.145])\n by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 08 May 2026 05:59:43 -0700", "from irvmail002.ir.intel.com ([10.43.11.120])\n by fmviesa005.fm.intel.com with ESMTP; 08 May 2026 05:59:38 -0700", "from vecna.igk.intel.com (vecna.igk.intel.com [10.123.220.17])\n by irvmail002.ir.intel.com (Postfix) with ESMTP id 01B0628798;\n Fri, 8 May 2026 13:59:35 +0100 (IST)" ], "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 smtp4.osuosl.org 894E540F2F", "OpenDKIM Filter v2.11.0 smtp4.osuosl.org C766F40E67" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org;\n\ts=default; t=1778245188;\n\tbh=F5FnkXHSPZ/YAL8xpK6mkTE8WKR4BG1hdPs6xRFgCYU=;\n\th=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id:\n\t List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:\n\t From;\n\tb=B6qXyC7jvua78m15lBuWcJfQ4/xjSYoai8kOgmlhFlg2CoNgWOlp0dof9DLVJHm10\n\t rI4ikAk7aUuh8gqCaE5wvfQnAlYrt0xtohtb84+ijPEMNzxNmcA1YX6vfpY8P7Gac0\n\t ixMLLstASWVQqcW0jB9L5reEhgeBqWR928r6e8Ae6mwjU/FTOC7PvH2WXOPd9AZmb2\n\t CX4TdlZwcuCiJANUwSINxkM9Wo/QdaN6h9X+H6bmovOWgDuB4yMCfItG/ayfV8aWvl\n\t salx1OEcW7N4cKuXBa1iIzUdhjZRpClb1UjEH3CI0ZQ4UMrsySRy7qG6u/jziKxj6Y\n\t 4ce8mW689HU7Q==", "Received-SPF": "Pass (mailfrom) identity=mailfrom; client-ip=198.175.65.17;\n helo=mgamail.intel.com; envelope-from=przemyslaw.kitszel@intel.com;\n receiver=<UNKNOWN>", "DMARC-Filter": "OpenDMARC Filter v1.4.2 smtp4.osuosl.org C766F40E67", "X-CSE-ConnectionGUID": [ "JemHlPfEQluLXq36qf6OvQ==", "gacRS5sDToWF1t7ZyymUoQ==" ], "X-CSE-MsgGUID": [ "Ryv0zTDBSFG1O8iqQ65v6Q==", "sGDyEB+NS9yAvETiJTNZ9w==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6800,10657,11779\"; a=\"79199861\"", "E=Sophos;i=\"6.23,223,1770624000\"; d=\"scan'208\";a=\"79199861\"", "E=Sophos;i=\"6.23,223,1770624000\"; d=\"scan'208\";a=\"241730093\"" ], "X-ExtLoop1": "1", "From": "Przemek Kitszel <przemyslaw.kitszel@intel.com>", "To": "intel-wired-lan@lists.osuosl.org, Michal Schmidt <mschmidt@redhat.com>,\n Jakub Kicinski <kuba@kernel.org>, Jiri Pirko <jiri@resnulli.us>", "Cc": "netdev@vger.kernel.org, Simon Horman <horms@kernel.org>,\n Tony Nguyen <anthony.l.nguyen@intel.com>,\n Michal Swiatkowski <michal.swiatkowski@linux.intel.com>,\n bruce.richardson@intel.com,\n Vladimir Medvedkin <vladimir.medvedkin@intel.com>,\n padraig.j.connolly@intel.com, ananth.s@intel.com,\n timothy.miskell@intel.com, Jacob Keller <jacob.e.keller@intel.com>,\n Lukasz Czapnik <lukasz.czapnik@intel.com>,\n Aleksandr Loktionov <aleksandr.loktionov@intel.com>,\n Andrew Lunn <andrew+netdev@lunn.ch>,\n \"David S. Miller\" <davem@davemloft.net>,\n Eric Dumazet <edumazet@google.com>, Paolo Abeni <pabeni@redhat.com>,\n Saeed Mahameed <saeedm@nvidia.com>, Leon Romanovsky <leon@kernel.org>,\n Tariq Toukan <tariqt@nvidia.com>, Mark Bloch <mbloch@nvidia.com>,\n Przemek Kitszel <przemyslaw.kitszel@intel.com>", "Date": "Fri, 8 May 2026 14:41:54 +0200", "Message-Id": "<20260508124208.11622-2-przemyslaw.kitszel@intel.com>", "X-Mailer": "git-send-email 2.39.3", "In-Reply-To": "<20260508124208.11622-1-przemyslaw.kitszel@intel.com>", "References": "<20260508124208.11622-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=1778245184; x=1809781184;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=cIgqFDuYpmAQ9O9mjXlj0JybX6yCopnWD3DhBhD2jzA=;\n b=XDc7Y4dgy0ChQ9nWSqg/Z1+WpkNO9CloPCPG3kIvA5AygGL8B2lto1Ze\n MA+6XPThW/QMyoF8h7Gd0GLLVLuSzgsfKJbgU7z2dB0Y+pyaszS+uHvnT\n ZKqgDo2Nykayi8+e+JeKmgdpGQNOpPz5UN9VOpetaPYN+0viXeczQKS+p\n IF5Ghh5MTboRIEngiwA5N3DfrRLrTZPZBt/RQrOYmpTBMwKc2WFmybvi7\n QjoodVr9jkU0pA3HLxdpiVIr3s7peShxy4WUo03QdTVN+ycmGoG+r240Q\n A3VvdljNLwYoWKKT3VU4Is3Sjkhe6nTA13PDgwOkJOw5m6NgLxrMeupNU\n g==;", "X-Mailman-Original-Authentication-Results": [ "smtp4.osuosl.org;\n dmarc=pass (p=none dis=none)\n header.from=intel.com", "smtp4.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=XDc7Y4dg" ], "Subject": "[Intel-wired-lan] [PATCH iwl-next v1 01/15] devlink,\n mlx5: add init/fini ops for shared devlink", "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>", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "Add .shd_init() and .shd_fini() ops, that will be called for the first\ndevlink_shd_get() (to initialize driver' priv data) and on the last\ndevlink_shd_put() (to allow for the cleanup). Both ops are optional.\n\n.shd_init() could return an error, which will stop creation of shd\ninstance. The initializer also gets an additional, optional param,\nthat driver could use for any needs.\n\nIf any of the callbacks will need to get devlink instance, it could\nbe accessed by shd_priv_to_devlink().\n\nBoth callbacks are called with devl_lock held and devlink registered.\n\nNext commit will make use of the callbacks, another one will make use also\nof the non-null additional param (outside of this series).\n\nReviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>\nSigned-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>\n---\n(v0) first discussed at:\nhttps://lore.kernel.org/netdev/20260325063143.261806-3-przemyslaw.kitszel@intel.com\n\nv1: remove redundant added blank line (Jiri)\n---\n include/net/devlink.h | 26 +++++++++++++\n .../ethernet/mellanox/mlx5/core/sh_devlink.c | 2 +-\n net/devlink/sh_dev.c | 38 ++++++++++++++++++-\n 3 files changed, 63 insertions(+), 3 deletions(-)", "diff": "diff --git a/include/net/devlink.h b/include/net/devlink.h\nindex bcd31de1f890..5d3a1337bfa1 100644\n--- a/include/net/devlink.h\n+++ b/include/net/devlink.h\n@@ -1586,6 +1586,30 @@ struct devlink_ops {\n \t\t\t\t struct devlink_rate *parent,\n \t\t\t\t void *priv_child, void *priv_parent,\n \t\t\t\t struct netlink_ext_ack *extack);\n+\n+\t/**\n+\t * shd_init: Shared devlink instance initializer\n+\t * @priv: shd_devlink' priv\n+\t * @init_param: additional param to pass to driver callback\n+\t *\n+\t * Called once when the shared instance is first created (by the first\n+\t * devlink_shd_get() call).\n+\t * Should initialize the driver's private data embedded in the shared\n+\t * devlink. May be NULL.\n+\t *\n+\t * Return: 0 on success, negative to prevent shared instance usage.\n+\t */\n+\tint (*shd_init)(void *priv, void *init_param);\n+\t/**\n+\t * shd_fini: Shared devlink instance finalizer\n+\t * @priv: shd_devlink' priv\n+\t *\n+\t * Called once when the last reference is dropped and the shared\n+\t * instance is destroyed. Should clean up the driver's private data.\n+\t * May be NULL.\n+\t */\n+\tvoid (*shd_fini)(void *priv);\n+\n \t/**\n \t * selftests_check() - queries if selftest is supported\n \t * @devlink: devlink instance\n@@ -1651,9 +1675,11 @@ void devlink_free(struct devlink *devlink);\n struct devlink *devlink_shd_get(const char *id,\n \t\t\t\tconst struct devlink_ops *ops,\n \t\t\t\tsize_t priv_size,\n+\t\t\t\tvoid *init_param,\n \t\t\t\tconst struct device_driver *driver);\n void devlink_shd_put(struct devlink *devlink);\n void *devlink_shd_get_priv(struct devlink *devlink);\n+struct devlink *shd_priv_to_devlink(void *priv);\n \n /**\n * struct devlink_port_ops - Port operations\ndiff --git a/drivers/net/ethernet/mellanox/mlx5/core/sh_devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/sh_devlink.c\nindex b925364765ac..1b8b1ce7e72d 100644\n--- a/drivers/net/ethernet/mellanox/mlx5/core/sh_devlink.c\n+++ b/drivers/net/ethernet/mellanox/mlx5/core/sh_devlink.c\n@@ -43,7 +43,7 @@ int mlx5_shd_init(struct mlx5_core_dev *dev)\n \t*end = '\\0';\n \n \t/* Get or create shared devlink instance */\n-\tdevlink = devlink_shd_get(sn, &mlx5_shd_ops, 0, pdev->dev.driver);\n+\tdevlink = devlink_shd_get(sn, &mlx5_shd_ops, 0, NULL, pdev->dev.driver);\n \tkfree(sn);\n \tif (!devlink)\n \t\treturn -ENOMEM;\ndiff --git a/net/devlink/sh_dev.c b/net/devlink/sh_dev.c\nindex 85acce97e788..7b9520d3f946 100644\n--- a/net/devlink/sh_dev.c\n+++ b/net/devlink/sh_dev.c\n@@ -34,6 +34,7 @@ static struct devlink_shd *devlink_shd_lookup(const char *id)\n static struct devlink_shd *devlink_shd_create(const char *id,\n \t\t\t\t\t const struct devlink_ops *ops,\n \t\t\t\t\t size_t priv_size,\n+\t\t\t\t\t void *init_param,\n \t\t\t\t\t const struct device_driver *driver)\n {\n \tstruct devlink_shd *shd;\n@@ -49,16 +50,30 @@ static struct devlink_shd *devlink_shd_create(const char *id,\n \tif (!shd->id)\n \t\tgoto err_devlink_free;\n \tshd->priv_size = priv_size;\n-\trefcount_set(&shd->refcount, 1);\n \n \tdevl_lock(devlink);\n \tdevl_register(devlink);\n+\n+\tif (ops->shd_init) {\n+\t\tint err;\n+\n+\t\terr = ops->shd_init(shd->priv, init_param);\n+\t\tif (err)\n+\t\t\tgoto err_unregister;\n+\t}\n+\n \tdevl_unlock(devlink);\n \n+\trefcount_set(&shd->refcount, 1);\n \tlist_add_tail(&shd->list, &shd_list);\n \n \treturn shd;\n \n+err_unregister:\n+\tdevl_unregister(devlink);\n+\tdevl_unlock(devlink);\n+\tkfree(shd->id);\n+\n err_devlink_free:\n \tdevlink_free(devlink);\n \treturn NULL;\n@@ -70,6 +85,10 @@ static void devlink_shd_destroy(struct devlink_shd *shd)\n \n \tlist_del(&shd->list);\n \tdevl_lock(devlink);\n+\n+\tif (devlink->ops->shd_fini)\n+\t\tdevlink->ops->shd_fini(shd->priv);\n+\n \tdevl_unregister(devlink);\n \tdevl_unlock(devlink);\n \tkfree(shd->id);\n@@ -81,6 +100,7 @@ static void devlink_shd_destroy(struct devlink_shd *shd)\n * @id: Identifier string (e.g., serial number) for the shared instance\n * @ops: Devlink operations structure\n * @priv_size: Size of private data structure\n+ * @init_param: Passed to .shd_init() callback alongside driver's priv\n * @driver: Driver associated with the shared devlink instance\n *\n * Get an existing shared devlink instance identified by @id, or create\n@@ -96,16 +116,17 @@ static void devlink_shd_destroy(struct devlink_shd *shd)\n struct devlink *devlink_shd_get(const char *id,\n \t\t\t\tconst struct devlink_ops *ops,\n \t\t\t\tsize_t priv_size,\n+\t\t\t\tvoid *init_param,\n \t\t\t\tconst struct device_driver *driver)\n {\n \tstruct devlink *devlink;\n \tstruct devlink_shd *shd;\n \n \tmutex_lock(&shd_mutex);\n \n \tshd = devlink_shd_lookup(id);\n \tif (!shd) {\n-\t\tshd = devlink_shd_create(id, ops, priv_size, driver);\n+\t\tshd = devlink_shd_create(id, ops, priv_size, init_param, driver);\n \t\tgoto unlock;\n \t}\n \n@@ -159,3 +180,16 @@ void *devlink_shd_get_priv(struct devlink *devlink)\n \treturn shd->priv;\n }\n EXPORT_SYMBOL_GPL(devlink_shd_get_priv);\n+\n+/** shd_priv_to_devlink - Get devlink instance from shd_devlink's priv\n+ * @priv: Driver's priv data\n+ *\n+ * Return: pointer to shared devlink instance the @priv belongs to.\n+ */\n+struct devlink *shd_priv_to_devlink(void *priv)\n+{\n+\tstruct devlink_shd *shd = container_of(priv, struct devlink_shd, priv);\n+\n+\treturn priv_to_devlink(shd);\n+}\n+EXPORT_SYMBOL_GPL(shd_priv_to_devlink);\n", "prefixes": [ "iwl-next", "v1", "01/15" ] }