From: Ivan Vecera <ivecera@redhat.com>
To: Jiri Pirko <jiri@resnulli.us>, netdev@vger.kernel.org
Cc: Jiri Pirko <jiri@nvidia.com>,
Vadim Fedorenko <vadim.fedorenko@linux.dev>,
Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Prathosh Satish <Prathosh.Satish@microchip.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
Jason Gunthorpe <jgg@ziepe.ca>,
Shannon Nelson <shannon.nelson@amd.com>,
Dave Jiang <dave.jiang@intel.com>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org, Michal Schmidt <mschmidt@redhat.com>,
Petr Oros <poros@redhat.com>
Subject: [PATCH net-next v13 03/12] devlink: Add support for u64 parameters
Date: Fri, 4 Jul 2025 20:21:53 +0200 [thread overview]
Message-ID: <20250704182202.1641943-4-ivecera@redhat.com> (raw)
In-Reply-To: <20250704182202.1641943-1-ivecera@redhat.com>
Only 8, 16 and 32-bit integers are supported for numeric devlink
parameters. The subsequent patch adds support for DPLL clock ID
that is defined as 64-bit number. Add support for u64 parameter
type.
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
---
include/net/devlink.h | 2 ++
net/devlink/param.c | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/include/net/devlink.h b/include/net/devlink.h
index 63517646a4973..a1fa88670754a 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -423,6 +423,7 @@ enum devlink_param_type {
DEVLINK_PARAM_TYPE_U8 = DEVLINK_VAR_ATTR_TYPE_U8,
DEVLINK_PARAM_TYPE_U16 = DEVLINK_VAR_ATTR_TYPE_U16,
DEVLINK_PARAM_TYPE_U32 = DEVLINK_VAR_ATTR_TYPE_U32,
+ DEVLINK_PARAM_TYPE_U64 = DEVLINK_VAR_ATTR_TYPE_U64,
DEVLINK_PARAM_TYPE_STRING = DEVLINK_VAR_ATTR_TYPE_STRING,
DEVLINK_PARAM_TYPE_BOOL = DEVLINK_VAR_ATTR_TYPE_FLAG,
};
@@ -431,6 +432,7 @@ union devlink_param_value {
u8 vu8;
u16 vu16;
u32 vu32;
+ u64 vu64;
char vstr[__DEVLINK_PARAM_MAX_STRING_VALUE];
bool vbool;
};
diff --git a/net/devlink/param.c b/net/devlink/param.c
index 396b8a7f60139..9709b41664aae 100644
--- a/net/devlink/param.c
+++ b/net/devlink/param.c
@@ -200,6 +200,11 @@ devlink_nl_param_value_fill_one(struct sk_buff *msg,
if (nla_put_u32(msg, DEVLINK_ATTR_PARAM_VALUE_DATA, val.vu32))
goto value_nest_cancel;
break;
+ case DEVLINK_PARAM_TYPE_U64:
+ if (devlink_nl_put_u64(msg, DEVLINK_ATTR_PARAM_VALUE_DATA,
+ val.vu64))
+ goto value_nest_cancel;
+ break;
case DEVLINK_PARAM_TYPE_STRING:
if (nla_put_string(msg, DEVLINK_ATTR_PARAM_VALUE_DATA,
val.vstr))
@@ -434,6 +439,11 @@ devlink_param_value_get_from_info(const struct devlink_param *param,
return -EINVAL;
value->vu32 = nla_get_u32(param_data);
break;
+ case DEVLINK_PARAM_TYPE_U64:
+ if (nla_len(param_data) != sizeof(u64))
+ return -EINVAL;
+ value->vu64 = nla_get_u64(param_data);
+ break;
case DEVLINK_PARAM_TYPE_STRING:
len = strnlen(nla_data(param_data), nla_len(param_data));
if (len == nla_len(param_data) ||
--
2.49.0
next prev parent reply other threads:[~2025-07-04 18:22 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-04 18:21 [PATCH net-next v13 00/12] Add Microchip ZL3073x support (part 1) Ivan Vecera
2025-07-04 18:21 ` [PATCH net-next v13 01/12] dt-bindings: dpll: Add DPLL device and pin Ivan Vecera
2025-07-04 18:21 ` [PATCH net-next v13 02/12] dt-bindings: dpll: Add support for Microchip Azurite chip family Ivan Vecera
2025-07-04 18:21 ` Ivan Vecera [this message]
2025-07-04 18:21 ` [PATCH net-next v13 04/12] devlink: Add new "clock_id" generic device param Ivan Vecera
2025-07-04 18:21 ` [PATCH net-next v13 05/12] dpll: Add basic Microchip ZL3073x support Ivan Vecera
2025-07-04 18:21 ` [PATCH net-next v13 06/12] dpll: zl3073x: Fetch invariants during probe Ivan Vecera
2025-07-04 18:21 ` [PATCH net-next v13 07/12] dpll: zl3073x: Read DPLL types and pin properties from system firmware Ivan Vecera
2025-07-04 18:21 ` [PATCH net-next v13 08/12] dpll: zl3073x: Register DPLL devices and pins Ivan Vecera
2025-07-04 18:21 ` [PATCH net-next v13 09/12] dpll: zl3073x: Implement input pin selection in manual mode Ivan Vecera
2025-07-04 18:22 ` [PATCH net-next v13 10/12] dpll: zl3073x: Add support to get/set priority on input pins Ivan Vecera
2025-07-04 18:22 ` [PATCH net-next v13 11/12] dpll: zl3073x: Implement input pin state setting in automatic mode Ivan Vecera
2025-07-04 18:22 ` [PATCH net-next v13 12/12] dpll: zl3073x: Add support to get/set frequency on pins Ivan Vecera
2025-07-07 8:32 ` Jiri Pirko
2025-07-07 9:46 ` Ivan Vecera
2025-07-07 10:45 ` Jiri Pirko
2025-07-07 13:02 ` Vadim Fedorenko
2025-07-07 13:10 ` Ivan Vecera
2025-07-07 8:28 ` [PATCH net-next v13 00/12] Add Microchip ZL3073x support (part 1) Jiri Pirko
2025-07-07 9:51 ` Ivan Vecera
2025-07-07 8:38 ` Jiri Pirko
2025-07-10 2:30 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250704182202.1641943-4-ivecera@redhat.com \
--to=ivecera@redhat.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=Prathosh.Satish@microchip.com \
--cc=arkadiusz.kubalewski@intel.com \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=dave.jiang@intel.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jgg@ziepe.ca \
--cc=jiri@nvidia.com \
--cc=jiri@resnulli.us \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mschmidt@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=poros@redhat.com \
--cc=robh@kernel.org \
--cc=shannon.nelson@amd.com \
--cc=vadim.fedorenko@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®