net: rtnetlink: Propagate extack to rtnl_offload_xstats_fill()

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2140149

commit 05415bccbb09a4eb0a3d57e7edfea73d4ce15b74
Author: Petr Machata <petrm@nvidia.com>
Date:   Wed Mar 2 18:31:18 2022 +0200

    net: rtnetlink: Propagate extack to rtnl_offload_xstats_fill()

    Later patches add handlers for more HW-backed statistics. An extack will be
    useful when communicating HW / driver errors to the client. Add the
    arguments as appropriate.

    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>

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
This commit is contained in:
Ivan Vecera 2022-11-04 17:15:39 +01:00
parent ef233311f2
commit e87ede5795
1 changed files with 8 additions and 5 deletions

View File

@ -5075,7 +5075,8 @@ rtnl_offload_xstats_fill_ndo(struct net_device *dev, int attr_id,
}
static int rtnl_offload_xstats_fill(struct sk_buff *skb, struct net_device *dev,
int *prividx, u32 off_filter_mask)
int *prividx, u32 off_filter_mask,
struct netlink_ext_ack *extack)
{
int attr_id_cpu_hit = IFLA_OFFLOAD_XSTATS_CPU_HIT;
bool have_data = false;
@ -5130,7 +5131,8 @@ static int rtnl_fill_statsinfo(struct sk_buff *skb, struct net_device *dev,
int type, u32 pid, u32 seq, u32 change,
unsigned int flags,
const struct rtnl_stats_dump_filters *filters,
int *idxattr, int *prividx)
int *idxattr, int *prividx,
struct netlink_ext_ack *extack)
{
unsigned int filter_mask = filters->mask[0];
struct if_stats_msg *ifsm;
@ -5218,7 +5220,7 @@ static int rtnl_fill_statsinfo(struct sk_buff *skb, struct net_device *dev,
goto nla_put_failure;
err = rtnl_offload_xstats_fill(skb, dev, prividx,
off_filter_mask);
off_filter_mask, extack);
if (err == -ENODATA)
nla_nest_cancel(skb, attr);
else
@ -5489,7 +5491,7 @@ static int rtnl_stats_get(struct sk_buff *skb, struct nlmsghdr *nlh,
err = rtnl_fill_statsinfo(nskb, dev, RTM_NEWSTATS,
NETLINK_CB(skb).portid, nlh->nlmsg_seq, 0,
0, &filters, &idxattr, &prividx);
0, &filters, &idxattr, &prividx, extack);
if (err < 0) {
/* -EMSGSIZE implies BUG in if_nlmsg_stats_size */
WARN_ON(err == -EMSGSIZE);
@ -5545,7 +5547,8 @@ static int rtnl_stats_dump(struct sk_buff *skb, struct netlink_callback *cb)
NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq, 0,
flags, &filters,
&s_idxattr, &s_prividx);
&s_idxattr, &s_prividx,
extack);
/* If we ran out of room on the first message,
* we're in trouble
*/