Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

devlink: introduce devlink_nl_put_u64()

Add devlink_nl_put_u64() that abstracts padding for u64 values.
All u64 values are passed with the very same padding option.

Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Joe Damato <jdamato@fastly.com>
Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Link: https://patch.msgid.link/20241023131248.27192-2-przemyslaw.kitszel@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Przemek Kitszel and committed by
Jakub Kicinski
da3ee3cd b8bd8c44

+5
+5
net/devlink/devl_internal.h
··· 181 181 return 0; 182 182 } 183 183 184 + static inline int devlink_nl_put_u64(struct sk_buff *msg, int attrtype, u64 val) 185 + { 186 + return nla_put_u64_64bit(msg, attrtype, val, DEVLINK_ATTR_PAD); 187 + } 188 + 184 189 int devlink_nl_put_nested_handle(struct sk_buff *msg, struct net *net, 185 190 struct devlink *devlink, int attrtype); 186 191 int devlink_nl_msg_reply_and_new(struct sk_buff **msg, struct genl_info *info);