Re: [RFC][PATCH iproute2-next 2/6] ip: Introduce get_rtnl_link_stats_rta() to get link statistics

2018-02-01 Thread Stephen Hemminger
On Thu, 1 Feb 2018 21:40:54 +0200 Serhey Popovych wrote: > +/* Based on copy_rtnl_link_stats() from kernel at net/core/rtnetlink.c */ > +static void copy_rtnl_link_stats64(struct rtnl_link_stats64 *a, > +const struct rtnl_link_stats *b) > +{ > + a->rx_packets

[RFC][PATCH iproute2-next 2/6] ip: Introduce get_rtnl_link_stats_rta() to get link statistics

2018-02-01 Thread Serhey Popovych
Assume all statistics in ip(8) represented either by IFLA_STATS64 or IFLA_STATS is 64 bit. It is clean that we can store __u32 counters of @struct rtnl_link_stats in __u64 counters in @struct rtnl_link_stats64. New get_rtnl_link_stats_rta() follows __print_link_stats() behaviour on handling of sta