mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: netdev@vger.kernel.org
Cc: Tony Nguyen <anthony.l.nguyen@intel.com>,
	nex.sw.ncis.osdt.itp.upstreaming@intel.com,
	Marcin Szycik <marcin.szycik@linux.intel.com>,
	Jiri Pirko <jiri@resnulli.us>,
	davem@davemloft.net, Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	linux-kernel@vger.kernel.org,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Wojciech Drewek <wojciech.drewek@intel.com>,
	Jiri Pirko <jiri@nvidia.com>, Joe Damato <jdamato@fastly.com>
Subject: [PATCH net-next v2 1/7] devlink: introduce devlink_nl_put_u64()
Date: Wed, 23 Oct 2024 15:09:01 +0200	[thread overview]
Message-ID: <20241023131248.27192-2-przemyslaw.kitszel@intel.com> (raw)
In-Reply-To: <20241023131248.27192-1-przemyslaw.kitszel@intel.com>

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>
---
 net/devlink/devl_internal.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/devlink/devl_internal.h b/net/devlink/devl_internal.h
index a9f064ab9ed9..14eaad9cfe35 100644
--- a/net/devlink/devl_internal.h
+++ b/net/devlink/devl_internal.h
@@ -181,6 +181,11 @@ devlink_nl_put_handle(struct sk_buff *msg, struct devlink *devlink)
 	return 0;
 }
 
+static inline int devlink_nl_put_u64(struct sk_buff *msg, int attrtype, u64 val)
+{
+	return nla_put_u64_64bit(msg, attrtype, val, DEVLINK_ATTR_PAD);
+}
+
 int devlink_nl_put_nested_handle(struct sk_buff *msg, struct net *net,
 				 struct devlink *devlink, int attrtype);
 int devlink_nl_msg_reply_and_new(struct sk_buff **msg, struct genl_info *info);
-- 
2.46.0


  reply	other threads:[~2024-10-23 13:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-23 13:09 [PATCH net-next v2 0/7] devlink: minor cleanup Przemek Kitszel
2024-10-23 13:09 ` Przemek Kitszel [this message]
2024-10-23 13:09 ` [PATCH net-next v2 2/7] devlink: use devlink_nl_put_u64() helper Przemek Kitszel
2024-10-23 13:09 ` [PATCH net-next v2 3/7] devlink: devl_resource_register(): differentiate error codes Przemek Kitszel
2024-10-23 13:09 ` [PATCH net-next v2 4/7] devlink: region: snapshot IDs: consolidate error values Przemek Kitszel
2024-10-23 13:09 ` [PATCH net-next v2 5/7] net: dsa: replace devlink resource registration calls by devl_ variants Przemek Kitszel
2024-10-23 13:09 ` [PATCH net-next v2 6/7] devlink: remove unused devlink_resource_occ_get_register() and _unregister() Przemek Kitszel
2024-10-23 13:09 ` [PATCH net-next v2 7/7] devlink: remove unused devlink_resource_register() Przemek Kitszel
2024-10-30  0:30 ` [PATCH net-next v2 0/7] devlink: minor cleanup 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=20241023131248.27192-2-przemyslaw.kitszel@intel.com \
    --to=przemyslaw.kitszel@intel.com \
    --cc=andrew@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=jdamato@fastly.com \
    --cc=jiri@nvidia.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcin.szycik@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=nex.sw.ncis.osdt.itp.upstreaming@intel.com \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=wojciech.drewek@intel.com \
    /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®