Skip to content

Commit

Permalink
net: rtnetlink: Namespace functions related to IFLA_OFFLOAD_XSTATS_*
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Petr Machata authored and David S. Miller committed Mar 3, 2022
1 parent cbcc44d commit 6b524a1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions net/core/rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6b524a1

Please sign in to comment.