get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2235215,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2235215/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20260508034912.4082520-5-rkannoth@marvell.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": "<20260508034912.4082520-5-rkannoth@marvell.com>",
    "list_archive_url": null,
    "date": "2026-05-08T03:49:07",
    "name": "[v12,net-next,4/9] devlink: Implement devlink param multi attribute nested data values",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "20cf9608f8170111c01f4ac34ef6fa557155d2bb",
    "submitter": {
        "id": 86908,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/86908/?format=api",
        "name": "Ratheesh Kannoth",
        "email": "rkannoth@marvell.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20260508034912.4082520-5-rkannoth@marvell.com/mbox/",
    "series": [
        {
            "id": 503453,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/503453/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=503453",
            "date": "2026-05-08T03:49:12",
            "name": "octeontx2-af: npc: Enhancements.",
            "version": 12,
            "mbox": "http://patchwork.ozlabs.org/series/503453/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2235215/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2235215/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=3MhEdsU5;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138])\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 4gC3Dp2ckvz1yMp\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 09 May 2026 08:09:14 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id 3A8CC84AA0;\n\tFri,  8 May 2026 22:09:12 +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 342Kr_yInmLG; Fri,  8 May 2026 22:09:11 +0000 (UTC)",
            "from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id 6D26E84AA1;\n\tFri,  8 May 2026 22:09:11 +0000 (UTC)",
            "from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133])\n by lists1.osuosl.org (Postfix) with ESMTP id 2729C272\n for <intel-wired-lan@lists.osuosl.org>; Fri,  8 May 2026 04:04:53 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp2.osuosl.org (Postfix) with ESMTP id 24DFD409D6\n for <intel-wired-lan@lists.osuosl.org>; Fri,  8 May 2026 04:04:53 +0000 (UTC)",
            "from smtp2.osuosl.org ([127.0.0.1])\n by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id nC6YTTmf3BO7 for <intel-wired-lan@lists.osuosl.org>;\n Fri,  8 May 2026 04:04:52 +0000 (UTC)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by smtp2.osuosl.org (Postfix) with ESMTPS id 2EBE1409F2\n for <intel-wired-lan@lists.osuosl.org>; Fri,  8 May 2026 04:04:52 +0000 (UTC)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 647NVHVa2833021; Thu, 7 May 2026 20:50:15 -0700",
            "from dc5-exch05.marvell.com ([199.233.59.128])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 4e0uytj5mn-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Thu, 07 May 2026 20:50:15 -0700 (PDT)",
            "from DC5-EXCH05.marvell.com (10.69.176.209) by\n DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.2.1544.25; Thu, 7 May 2026 20:50:13 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com\n (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.25 via Frontend\n Transport; Thu, 7 May 2026 20:50:13 -0700",
            "from rkannoth-OptiPlex-7090.. (unknown [10.28.36.165])\n by maili.marvell.com (Postfix) with ESMTP id 403DC3F7041;\n Thu,  7 May 2026 20:50:02 -0700 (PDT)"
        ],
        "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 smtp1.osuosl.org 6D26E84AA1",
            "OpenDKIM Filter v2.11.0 smtp2.osuosl.org 2EBE1409F2"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org;\n\ts=default; t=1778278151;\n\tbh=Qc51QPgYDba2Xrmm6GTgasNEK/UZIviAAu63blxBGP0=;\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=3MhEdsU5BHjlcP5iEHj6URZKHeuvUeEMimaodngr6gBjS++k/mrUjwXW8Lcbir7ey\n\t AzGbWl4STZjl9LugEC+sjGmzuLcfDpbEFDEedsTsx9M01TwfJCFlLAhXiewhjJGANp\n\t t1N2KtgAzJlt9F2Dmov8Sw5ON776NMVTG2/ekvDC/j3uX6y06NU7CDh1SisFL2oBmn\n\t eneX86KA5JtJ6x30Uw95CwGUAiWWXqFv/VJKurR71sygBoqRTaryz+2SoZqs4prgyS\n\t O7nmuI/KuWEUmAEkvAEbKRwFeRfR5uyCFIS6MwpvXVrI7S51uWHtiUjAfA3DVUmzqt\n\t ayDWGum+k3jsg==",
        "Received-SPF": "Pass (mailfrom) identity=mailfrom; client-ip=67.231.156.173;\n helo=mx0b-0016f401.pphosted.com;\n envelope-from=prvs=65883a0750=rkannoth@marvell.com; receiver=<UNKNOWN>",
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 smtp2.osuosl.org 2EBE1409F2",
        "From": "Ratheesh Kannoth <rkannoth@marvell.com>",
        "To": "<intel-wired-lan@lists.osuosl.org>, <linux-kernel@vger.kernel.org>,\n <linux-rdma@vger.kernel.org>, <netdev@vger.kernel.org>,\n <oss-drivers@corigine.com>",
        "CC": "<akiyano@amazon.com>, <andrew+netdev@lunn.ch>,\n <anthony.l.nguyen@intel.com>, <arkadiusz.kubalewski@intel.com>,\n <brett.creeley@amd.com>, <darinzon@amazon.com>, <davem@davemloft.net>,\n <donald.hunter@gmail.com>, <edumazet@google.com>, <horms@kernel.org>,\n <idosch@nvidia.com>, <ivecera@redhat.com>, <jiri@resnulli.us>,\n <kuba@kernel.org>, <leon@kernel.org>, <mbloch@nvidia.com>,\n <michael.chan@broadcom.com>, <pabeni@redhat.com>,\n <pavan.chebbi@broadcom.com>, <petrm@nvidia.com>,\n <Prathosh.Satish@microchip.com>, <przemyslaw.kitszel@intel.com>,\n <saeedm@nvidia.com>, <sgoutham@marvell.com>, <tariqt@nvidia.com>,\n <vadim.fedorenko@linux.dev>, Ratheesh Kannoth <rkannoth@marvell.com>",
        "Date": "Fri, 8 May 2026 09:19:07 +0530",
        "Message-ID": "<20260508034912.4082520-5-rkannoth@marvell.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260508034912.4082520-1-rkannoth@marvell.com>",
        "References": "<20260508034912.4082520-1-rkannoth@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Authority-Analysis": "v=2.4 cv=I6RVgtgg c=1 sm=1 tr=0 ts=69fd5d77 cx=c_pps\n a=rEv8fa4AjpPjGxpoe8rlIQ==:117 a=rEv8fa4AjpPjGxpoe8rlIQ==:17\n a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22 a=l0iWHRpgs5sLHlkKQ1IR:22\n a=QXcCYyLzdtTjyudCfB6f:22 a=Ikd4Dj_1AAAA:8 a=M5GUcnROAAAA:8\n a=fjkij7JY_VKj8B3xdwgA:9 a=OBjm3rFKGHvpk9ecZwUJ:22",
        "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNTA4MDAzNCBTYWx0ZWRfX4kKxDkyraKDO\n TAAMD4dn30m+bU/Kc6zrhvtG3Q0k7XNhCIwItUcnAE3cjnWb/WzekoSSvOYkBf8daCWfGRy/uux\n siGKkoBFR8fr4fpNv9UE4CqcasA7aaDU3nzliYO08kQZaayTsZWGwFPblG7kN2eV1W02bSSkxn6\n O/Lq0Lmf/BjyMWB7gfIBn/qYs0e1n7KVwissWxvXiVUtqzRyaB8EIDy2Pro0wYqIyrLpxJpC6hM\n KX/EFllnMNuUWUKcMM9MD1fHIfE6Q+Ip8G2lzchgM7l/b+0j31+uDgJfOKeHT+iyEncxiJgQNvC\n JkPQCtBHt5WOhnBSi7R6UoZpA71WyL2htvMujhOg6teNO5REfQWWhFKAnNwnO62B2L+SNO7771N\n eGv7+vA7njKgEeepwJyVRYakkTckeSmnStRhKK6QqiYzHCv8xU5IqlvKDJOQ2VIhJG4y3tRh0Y0\n wNKyxJIUuCWO7xqwDig==",
        "X-Proofpoint-GUID": "d2xc7y5uDNZorA_5WOZb22RjZ3Vjjn6E",
        "X-Proofpoint-ORIG-GUID": "d2xc7y5uDNZorA_5WOZb22RjZ3Vjjn6E",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-05-07_02,2026-05-06_01,2025-10-01_01",
        "X-Mailman-Approved-At": "Fri, 08 May 2026 22:09:04 +0000",
        "X-Mailman-Original-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=marvell.com; h=\n cc:content-transfer-encoding:content-type:date:from:in-reply-to\n :message-id:mime-version:references:subject:to; s=pfpt0220; bh=Q\n c51QPgYDba2Xrmm6GTgasNEK/UZIviAAu63blxBGP0=; b=aeHd5otf7NxWy4Q41\n 7EvdUYbN9f0x8TuUtGAsQCXAkfrzbSF5rEd/iB46woy3jnOj7n5Xz77bVz/ywrek\n nrz7KN6wGb2VGuv8gW1SEIOkYZKTODepT2205QSDTMX5xCdYMUTrdC90ujYG1Vek\n pTHQVPubdy03P9JPkXWuVJN7oK6ucDTfQL5E1DBVie+n8kPTWySNasOR0JtcxFcZ\n ZyhPMpgGEK59Bs7kaS74mwzvxC1nbq4D1Q3QsZ9kWnA09PAyItDpgBvOlqj7Jtfv\n 1g5T+XlCzEbYw5+lYRGsxNlsA772xYuFwBugmjcsvpk4GNFT9qlkV480Lzg45m6e\n Pclrg==",
        "X-Mailman-Original-Authentication-Results": [
            "smtp2.osuosl.org;\n dmarc=pass (p=none dis=none)\n header.from=marvell.com",
            "smtp2.osuosl.org;\n dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com\n header.a=rsa-sha256 header.s=pfpt0220 header.b=aeHd5otf"
        ],
        "Subject": "[Intel-wired-lan] [PATCH v12 net-next 4/9] devlink: Implement\n devlink param multi attribute nested data values",
        "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": "From: Saeed Mahameed <saeedm@nvidia.com>\n\nDevlink param value attribute is not defined since devlink is handling\nthe value validating and parsing internally, this allows us to implement\nmulti attribute values without breaking any policies.\n\nDevlink param multi-attribute values are considered to be dynamically\nsized arrays of u64 values, by introducing a new devlink param type\nDEVLINK_PARAM_TYPE_U64_ARRAY, driver and user space can set a variable\ncount of u32 values into the DEVLINK_ATTR_PARAM_VALUE_DATA attribute.\n\nImplement get/set parsing and add to the internal value structure passed\nto drivers.\n\nThis is useful for devices that need to configure a list of values for\na specific configuration.\n\nexample:\n$ devlink dev param show pci/... name multi-value-param\nname multi-value-param type driver-specific\nvalues:\ncmode permanent value: 0,1,2,3,4,5,6,7\n\n$ devlink dev param set pci/... name multi-value-param \\\n\t\tvalue 4,5,6,7,0,1,2,3 cmode permanent\n\nSigned-off-by: Saeed Mahameed <saeedm@nvidia.com>\nSigned-off-by: Ratheesh Kannoth <rkannoth@marvell.com>\n---\n Documentation/netlink/specs/devlink.yaml |  4 ++\n include/net/devlink.h                    |  8 +++\n include/uapi/linux/devlink.h             |  1 +\n net/devlink/netlink_gen.c                |  2 +\n net/devlink/param.c                      | 88 +++++++++++++++++++-----\n 5 files changed, 86 insertions(+), 17 deletions(-)",
    "diff": "diff --git a/Documentation/netlink/specs/devlink.yaml b/Documentation/netlink/specs/devlink.yaml\nindex 247b147d689f..52ad1e7805d1 100644\n--- a/Documentation/netlink/specs/devlink.yaml\n+++ b/Documentation/netlink/specs/devlink.yaml\n@@ -234,6 +234,10 @@ definitions:\n         value: 10\n       -\n         name: binary\n+      -\n+        name: u64-array\n+        value: 129\n+\n   -\n     name: rate-tc-index-max\n     type: const\ndiff --git a/include/net/devlink.h b/include/net/devlink.h\nindex 5f4083dc4345..dd546dbd57cf 100644\n--- a/include/net/devlink.h\n+++ b/include/net/devlink.h\n@@ -433,6 +433,13 @@ enum devlink_param_type {\n \tDEVLINK_PARAM_TYPE_U64 = DEVLINK_VAR_ATTR_TYPE_U64,\n \tDEVLINK_PARAM_TYPE_STRING = DEVLINK_VAR_ATTR_TYPE_STRING,\n \tDEVLINK_PARAM_TYPE_BOOL = DEVLINK_VAR_ATTR_TYPE_FLAG,\n+\tDEVLINK_PARAM_TYPE_U64_ARRAY = DEVLINK_VAR_ATTR_TYPE_U64_ARRAY,\n+};\n+\n+#define __DEVLINK_PARAM_MAX_ARRAY_SIZE 32\n+struct devlink_param_u64_array {\n+\tu64 size;\n+\tu64 val[__DEVLINK_PARAM_MAX_ARRAY_SIZE];\n };\n \n union devlink_param_value {\n@@ -442,6 +449,7 @@ union devlink_param_value {\n \tu64 vu64;\n \tchar vstr[__DEVLINK_PARAM_MAX_STRING_VALUE];\n \tbool vbool;\n+\tstruct devlink_param_u64_array u64arr;\n };\n \n struct devlink_param_gset_ctx {\ndiff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h\nindex 0b165eac7619..ca713bcc47b9 100644\n--- a/include/uapi/linux/devlink.h\n+++ b/include/uapi/linux/devlink.h\n@@ -406,6 +406,7 @@ enum devlink_var_attr_type {\n \tDEVLINK_VAR_ATTR_TYPE_BINARY,\n \t__DEVLINK_VAR_ATTR_TYPE_CUSTOM_BASE = 0x80,\n \t/* Any possible custom types, unrelated to NLA_* values go below */\n+\tDEVLINK_VAR_ATTR_TYPE_U64_ARRAY,\n };\n \n enum devlink_attr {\ndiff --git a/net/devlink/netlink_gen.c b/net/devlink/netlink_gen.c\nindex 81899786fd98..f52b0c2b19ed 100644\n--- a/net/devlink/netlink_gen.c\n+++ b/net/devlink/netlink_gen.c\n@@ -37,6 +37,8 @@ devlink_attr_param_type_validate(const struct nlattr *attr,\n \tcase DEVLINK_VAR_ATTR_TYPE_NUL_STRING:\n \t\tfallthrough;\n \tcase DEVLINK_VAR_ATTR_TYPE_BINARY:\n+\t\tfallthrough;\n+\tcase DEVLINK_VAR_ATTR_TYPE_U64_ARRAY:\n \t\treturn 0;\n \t}\n \tNL_SET_ERR_MSG_ATTR(extack, attr, \"invalid enum value\");\ndiff --git a/net/devlink/param.c b/net/devlink/param.c\nindex 1a196d3a843d..4cc479bd019f 100644\n--- a/net/devlink/param.c\n+++ b/net/devlink/param.c\n@@ -252,6 +252,11 @@ devlink_nl_param_value_put(struct sk_buff *msg, enum devlink_param_type type,\n \t\t\t\treturn -EMSGSIZE;\n \t\t}\n \t\tbreak;\n+\tcase DEVLINK_PARAM_TYPE_U64_ARRAY:\n+\t\tfor (int i = 0; i < val->u64arr.size; i++)\n+\t\t\tif (nla_put_uint(msg, nla_type, val->u64arr.val[i]))\n+\t\t\t\treturn -EMSGSIZE;\n+\t\tbreak;\n \t}\n \treturn 0;\n }\n@@ -304,56 +309,78 @@ static int devlink_nl_param_fill(struct sk_buff *msg, struct devlink *devlink,\n \t\t\t\t u32 portid, u32 seq, int flags,\n \t\t\t\t struct netlink_ext_ack *extack)\n {\n-\tunion devlink_param_value default_value[DEVLINK_PARAM_CMODE_MAX + 1];\n-\tunion devlink_param_value param_value[DEVLINK_PARAM_CMODE_MAX + 1];\n \tbool default_value_set[DEVLINK_PARAM_CMODE_MAX + 1] = {};\n \tbool param_value_set[DEVLINK_PARAM_CMODE_MAX + 1] = {};\n \tconst struct devlink_param *param = param_item->param;\n-\tstruct devlink_param_gset_ctx ctx;\n+\tunion devlink_param_value *default_value;\n+\tunion devlink_param_value *param_value;\n+\tstruct devlink_param_gset_ctx *ctx;\n \tstruct nlattr *param_values_list;\n \tstruct nlattr *param_attr;\n \tvoid *hdr;\n \tint err;\n \tint i;\n \n+\tdefault_value = kcalloc(DEVLINK_PARAM_CMODE_MAX + 1,\n+\t\t\t\tsizeof(*default_value), GFP_KERNEL);\n+\tif (!default_value)\n+\t\treturn -ENOMEM;\n+\n+\tparam_value = kcalloc(DEVLINK_PARAM_CMODE_MAX + 1,\n+\t\t\t      sizeof(*param_value), GFP_KERNEL);\n+\tif (!param_value) {\n+\t\tkfree(default_value);\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\tctx = kmalloc_obj(*ctx);\n+\tif (!ctx) {\n+\t\tkfree(param_value);\n+\t\tkfree(default_value);\n+\t\treturn -ENOMEM;\n+\t}\n+\n \t/* Get value from driver part to driverinit configuration mode */\n \tfor (i = 0; i <= DEVLINK_PARAM_CMODE_MAX; i++) {\n \t\tif (!devlink_param_cmode_is_supported(param, i))\n \t\t\tcontinue;\n \t\tif (i == DEVLINK_PARAM_CMODE_DRIVERINIT) {\n-\t\t\tif (param_item->driverinit_value_new_valid)\n+\t\t\tif (param_item->driverinit_value_new_valid) {\n \t\t\t\tparam_value[i] = param_item->driverinit_value_new;\n-\t\t\telse if (param_item->driverinit_value_valid)\n+\t\t\t} else if (param_item->driverinit_value_valid) {\n \t\t\t\tparam_value[i] = param_item->driverinit_value;\n-\t\t\telse\n-\t\t\t\treturn -EOPNOTSUPP;\n+\t\t\t} else {\n+\t\t\t\terr = -EOPNOTSUPP;\n+\t\t\t\tgoto get_put_fail;\n+\t\t\t}\n \n \t\t\tif (param_item->driverinit_value_valid) {\n \t\t\t\tdefault_value[i] = param_item->driverinit_default;\n \t\t\t\tdefault_value_set[i] = true;\n \t\t\t}\n \t\t} else {\n-\t\t\tctx.cmode = i;\n-\t\t\terr = devlink_param_get(devlink, param, &ctx, extack);\n+\t\t\tctx->cmode = i;\n+\t\t\terr = devlink_param_get(devlink, param, ctx, extack);\n \t\t\tif (err)\n-\t\t\t\treturn err;\n-\t\t\tparam_value[i] = ctx.val;\n+\t\t\t\tgoto get_put_fail;\n+\t\t\tparam_value[i] = ctx->val;\n \n-\t\t\terr = devlink_param_get_default(devlink, param, &ctx,\n+\t\t\terr = devlink_param_get_default(devlink, param, ctx,\n \t\t\t\t\t\t\textack);\n \t\t\tif (!err) {\n-\t\t\t\tdefault_value[i] = ctx.val;\n+\t\t\t\tdefault_value[i] = ctx->val;\n \t\t\t\tdefault_value_set[i] = true;\n \t\t\t} else if (err != -EOPNOTSUPP) {\n-\t\t\t\treturn err;\n+\t\t\t\tgoto get_put_fail;\n \t\t\t}\n \t\t}\n \t\tparam_value_set[i] = true;\n \t}\n \n+\terr = -EMSGSIZE;\n \thdr = genlmsg_put(msg, portid, seq, &devlink_nl_family, flags, cmd);\n \tif (!hdr)\n-\t\treturn -EMSGSIZE;\n+\t\tgoto get_put_fail;\n \n \tif (devlink_nl_put_handle(msg, devlink))\n \t\tgoto genlmsg_cancel;\n@@ -393,6 +420,9 @@ static int devlink_nl_param_fill(struct sk_buff *msg, struct devlink *devlink,\n \tnla_nest_end(msg, param_values_list);\n \tnla_nest_end(msg, param_attr);\n \tgenlmsg_end(msg, hdr);\n+\tkfree(default_value);\n+\tkfree(param_value);\n+\tkfree(ctx);\n \treturn 0;\n \n values_list_nest_cancel:\n@@ -401,7 +431,11 @@ static int devlink_nl_param_fill(struct sk_buff *msg, struct devlink *devlink,\n \tnla_nest_cancel(msg, param_attr);\n genlmsg_cancel:\n \tgenlmsg_cancel(msg, hdr);\n-\treturn -EMSGSIZE;\n+get_put_fail:\n+\tkfree(default_value);\n+\tkfree(param_value);\n+\tkfree(ctx);\n+\treturn err;\n }\n \n static void devlink_param_notify(struct devlink *devlink,\n@@ -507,7 +541,7 @@ devlink_param_value_get_from_info(const struct devlink_param *param,\n \t\t\t\t  union devlink_param_value *value)\n {\n \tstruct nlattr *param_data;\n-\tint len;\n+\tint len, cnt, rem;\n \n \tparam_data = info->attrs[DEVLINK_ATTR_PARAM_VALUE_DATA];\n \n@@ -547,6 +581,26 @@ devlink_param_value_get_from_info(const struct devlink_param *param,\n \t\t\treturn -EINVAL;\n \t\tvalue->vbool = nla_get_flag(param_data);\n \t\tbreak;\n+\n+\tcase DEVLINK_PARAM_TYPE_U64_ARRAY:\n+\t\tcnt = 0;\n+\t\tnla_for_each_attr_type(param_data,\n+\t\t\t\t       DEVLINK_ATTR_PARAM_VALUE_DATA,\n+\t\t\t\t       genlmsg_data(info->genlhdr),\n+\t\t\t\t       genlmsg_len(info->genlhdr), rem) {\n+\t\t\tif (cnt >= __DEVLINK_PARAM_MAX_ARRAY_SIZE)\n+\t\t\t\treturn -EMSGSIZE;\n+\n+\t\t\tif ((nla_len(param_data) != sizeof(u64)) &&\n+\t\t\t    (nla_len(param_data) != sizeof(u32)))\n+\t\t\t\treturn -EINVAL;\n+\n+\t\t\tvalue->u64arr.val[cnt] = (u64)nla_get_uint(param_data);\n+\t\t\tcnt++;\n+\t\t}\n+\n+\t\tvalue->u64arr.size = cnt;\n+\t\tbreak;\n \t}\n \treturn 0;\n }\n",
    "prefixes": [
        "v12",
        "net-next",
        "4/9"
    ]
}