mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 15:27:29 +00:00
net: rtnetlink: add support for the IFLA_STATS_LINK_XSTATS_SLAVE attribute
This patch adds support for the IFLA_STATS_LINK_XSTATS_SLAVE attribute which allows to export per-slave statistics if the master device supports the linkxstats callback. The attribute is passed down to the linkxstats callback and it is up to the callback user to use it (an example has been added to the only current user - the bridge). This allows us to query only specific slaves of master devices like bridge ports and export only what we're interested in instead of having to dump all ports and searching only for a single one. This will be used to export per-port IGMP/MLD stats and also per-port vlan stats in the future, possibly other statistics as well. Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
545c321ba3
commit
80e73cc563
4 changed files with 108 additions and 7 deletions
|
@ -98,10 +98,11 @@ struct rtnl_link_ops {
|
|||
const struct net_device *dev,
|
||||
const struct net_device *slave_dev);
|
||||
struct net *(*get_link_net)(const struct net_device *dev);
|
||||
size_t (*get_linkxstats_size)(const struct net_device *dev);
|
||||
size_t (*get_linkxstats_size)(const struct net_device *dev,
|
||||
int attr);
|
||||
int (*fill_linkxstats)(struct sk_buff *skb,
|
||||
const struct net_device *dev,
|
||||
int *prividx);
|
||||
int *prividx, int attr);
|
||||
};
|
||||
|
||||
int __rtnl_link_register(struct rtnl_link_ops *ops);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue