netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, petrm@nvidia.com,
	jiri@nvidia.com, razor@blackwall.org, roopa@nvidia.com,
	dsahern@gmail.com, andrew@lunn.ch, mlxsw@nvidia.com,
	Ido Schimmel <idosch@nvidia.com>
Subject: [PATCH net-next 01/14] net: rtnetlink: Namespace functions related to IFLA_OFFLOAD_XSTATS_*
Date: Thu, 24 Feb 2022 15:33:22 +0200	[thread overview]
Message-ID: <20220224133335.599529-2-idosch@nvidia.com> (raw)
In-Reply-To: <20220224133335.599529-1-idosch@nvidia.com>

From: Petr Machata <petrm@nvidia.com>

The currently used names rtnl_get_offload_stats() and
rtnl_get_offload_stats_size() do not clearly show the namespace. The former
function additionally seems to have been named this way in accordance with
the NDO name, as opposed to the naming used in the rtnetlink.c file (and
indeed elsewhere in the netlink handling code). As more and
differently-flavored attributes are introduced, a common clear prefix is
needed for all related functions.

Rename the functions to follow the rtnl_offload_xstats_* naming scheme.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
 net/core/rtnetlink.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 20a9e1686453..c484bf27f0b4 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -5059,8 +5059,8 @@ static int rtnl_get_offload_stats_attr_size(int attr_id)
 	return 0;
 }
 
-static int rtnl_get_offload_stats(struct sk_buff *skb, struct net_device *dev,
-				  int *prividx)
+static int rtnl_offload_xstats_fill(struct sk_buff *skb, struct net_device *dev,
+				    int *prividx)
 {
 	struct nlattr *attr = NULL;
 	int attr_id, size;
@@ -5109,7 +5109,7 @@ static int rtnl_get_offload_stats(struct sk_buff *skb, struct net_device *dev,
 	return err;
 }
 
-static int rtnl_get_offload_stats_size(const struct net_device *dev)
+static int rtnl_offload_xstats_get_size(const struct net_device *dev)
 {
 	int nla_size = 0;
 	int attr_id;
@@ -5219,7 +5219,7 @@ static int rtnl_fill_statsinfo(struct sk_buff *skb, struct net_device *dev,
 		if (!attr)
 			goto nla_put_failure;
 
-		err = rtnl_get_offload_stats(skb, dev, prividx);
+		err = rtnl_offload_xstats_fill(skb, dev, prividx);
 		if (err == -ENODATA)
 			nla_nest_cancel(skb, attr);
 		else
@@ -5323,7 +5323,7 @@ static size_t if_nlmsg_stats_size(const struct net_device *dev,
 	}
 
 	if (stats_attr_valid(filter_mask, IFLA_STATS_LINK_OFFLOAD_XSTATS, 0))
-		size += rtnl_get_offload_stats_size(dev);
+		size += rtnl_offload_xstats_get_size(dev);
 
 	if (stats_attr_valid(filter_mask, IFLA_STATS_AF_SPEC, 0)) {
 		struct rtnl_af_ops *af_ops;
-- 
2.33.1


  reply	other threads:[~2022-02-24 13:34 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-24 13:33 [PATCH net-next 00/14] HW counters for soft devices Ido Schimmel
2022-02-24 13:33 ` Ido Schimmel [this message]
2022-02-24 13:33 ` [PATCH net-next 02/14] net: rtnetlink: Stop assuming that IFLA_OFFLOAD_XSTATS_* are dev-backed Ido Schimmel
2022-02-24 13:33 ` [PATCH net-next 03/14] net: rtnetlink: RTM_GETSTATS: Allow filtering inside nests Ido Schimmel
2022-02-25  6:14   ` Jakub Kicinski
2022-02-25  8:22     ` Petr Machata
2022-02-25 16:04       ` Jakub Kicinski
2022-02-25 16:57         ` Petr Machata
2022-02-24 13:33 ` [PATCH net-next 04/14] net: rtnetlink: Propagate extack to rtnl_offload_xstats_fill() Ido Schimmel
2022-02-24 13:33 ` [PATCH net-next 05/14] net: rtnetlink: rtnl_fill_statsinfo(): Permit non-EMSGSIZE error returns Ido Schimmel
2022-02-24 13:33 ` [PATCH net-next 06/14] net: dev: Add hardware stats support Ido Schimmel
2022-02-25  6:22   ` Jakub Kicinski
2022-02-25  8:31     ` Petr Machata
2022-02-25 16:12       ` Jakub Kicinski
2022-02-25 17:00         ` Petr Machata
2022-02-25 17:56           ` Jakub Kicinski
2022-02-25 20:01             ` Petr Machata
2022-02-25 22:37               ` Jakub Kicinski
2022-02-24 13:33 ` [PATCH net-next 07/14] net: rtnetlink: Add UAPI for obtaining L3 offload xstats Ido Schimmel
2022-02-24 13:33 ` [PATCH net-next 08/14] net: rtnetlink: Add RTM_SETSTATS Ido Schimmel
2022-02-24 13:33 ` [PATCH net-next 09/14] net: rtnetlink: Add UAPI toggle for IFLA_OFFLOAD_XSTATS_L3_STATS Ido Schimmel
2022-02-24 13:33 ` [PATCH net-next 10/14] mlxsw: reg: Fix packing of router interface counters Ido Schimmel
2022-02-24 13:33 ` [PATCH net-next 11/14] mlxsw: spectrum_router: Drop mlxsw_sp arg from counter alloc/free functions Ido Schimmel
2022-02-24 13:33 ` [PATCH net-next 12/14] mlxsw: Extract classification of router-related events to a helper Ido Schimmel
2022-02-24 13:33 ` [PATCH net-next 13/14] mlxsw: Add support for IFLA_OFFLOAD_XSTATS_L3_STATS Ido Schimmel
2022-02-24 13:33 ` [PATCH net-next 14/14] selftests: forwarding: hw_stats_l3: Add a new test Ido Schimmel

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=20220224133335.599529-2-idosch@nvidia.com \
    --to=idosch@nvidia.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=jiri@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=mlxsw@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@nvidia.com \
    --cc=razor@blackwall.org \
    --cc=roopa@nvidia.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;
as well as URLs for NNTP newsgroup(s).