Skip to contentSkip to conversation

Netlink event for network device statistics

DISCUSSION Marcel Holtmann 2 participants 3 messages Nov 29, 2009 – Dec 1, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi everyone,

so I was playing with monitoring network device statistics and storing them over a period of time. While netlink and ethtool provides all the network packet statistics, I have a problem with devices that are actually hotplug. Especially 3G cards that get taken off the bus via RFKILL and external dongles that can be unplugged at any time.

So I was thinking that before we send the DELLINK netlink event for that interface, we should send the latest statistic details via netlink. Is that a good idea or is there another way to get up-to-date statistics without polling for them?

Regards

Marcel

#1 lore raw
Quoted 8 lines · Marcel Holtmann

Hi everyone,

so I was playing with monitoring network device statistics and storing them over a period of time. While netlink and ethtool provides all the network packet statistics, I have a problem with devices that are actually hotplug. Especially 3G cards that get taken off the bus via RFKILL and external dongles that can be unplugged at any time.

Quoted 4 lines

So I was thinking that before we send the DELLINK netlink event for that interface, we should send the latest statistic details via netlink. Is that a good idea or is there another way to get up-to-date statistics without polling for them?

Don't we already include them in the DELLINK message? rtnl_fill_ifinfo() unconditionally includes the statistics.

#2 lore raw

Hi Patrick,

Quoted 6 lines
Quoted 6 lines

so I was playing with monitoring network device statistics and storing them over a period of time. While netlink and ethtool provides all the network packet statistics, I have a problem with devices that are actually hotplug. Especially 3G cards that get taken off the bus via RFKILL and external dongles that can be unplugged at any time.

Quoted 7 lines
Quoted 4 lines

So I was thinking that before we send the DELLINK netlink event for that interface, we should send the latest statistic details via netlink. Is that a good idea or is there another way to get up-to-date statistics without polling for them?

Don't we already include them in the DELLINK message? rtnl_fill_ifinfo() unconditionally includes the statistics.

you are correct. We already have the IFLA_STATS in DELLINK. I got confused with ip monitor not decoding these and assumed they were not included at all.

Regards

Marcel