> On Sep 8, 2016, at 9:19 AM, Jiri Pirko <j...@resnulli.us> wrote: > > From: Nogah Frankel <nog...@mellanox.com> > > Add a nested attribute of offload stats to if_stats_msg > named IFLA_STATS_LINK_OFFLOAD_XSTATS. > Under it, add SW stats, meaning stats only per packets that went via > slowpath to the cpu, named IFLA_OFFLOAD_XSTATS_CPU_HIT. > > Signed-off-by: Nogah Frankel <nog...@mellanox.com> > Signed-off-by: Jiri Pirko <j...@mellanox.com> > --- > include/uapi/linux/if_link.h | 9 ++++ > net/core/rtnetlink.c | 97 ++++++++++++++++++++++++++++++++++++++++++-- > 2 files changed, 102 insertions(+), 4 deletions(-) > [snip] > > + if (stats_attr_valid(filter_mask, IFLA_STATS_LINK_OFFLOAD_XSTATS, > + *idxattr)) { > + attr = nla_nest_start(skb, IFLA_STATS_LINK_OFFLOAD_XSTATS); > + if (!attr) > + goto nla_put_failure; > + > + err = rtnl_get_offload_stats(skb, dev); > + if (err == -ENODATA) > + nla_nest_cancel(skb, attr); > + else > + nla_nest_end(skb, attr); > + > + if ((err) && (err != -ENODATA)) > + goto nla_put_failure;
Hi, Sorry I’m a little late to the party, one minor nit though - could you please drop the extra braces here. Overall the set looks good to me and you can add my Reviewed-by: Nikolay Aleksandrov <niko...@cumulusnetworks.com> Thanks, Nik > + } > + > nlmsg_end(skb, nlh); > > return 0; > @@ -3712,6 +3798,9 @@ 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); > + > return size; > } > > -- > 2.5.5 >