tx/rx bytes counters and some more stats as a libnl public API

Ido Barkan ibarkan at redhat.com
Mon Feb 2 04:25:46 PST 2015


Right!
Thank you.
Ido

----- Original Message -----
From: "Thomas Haller" <thaller at redhat.com>
To: "Ido Barkan" <ibarkan at redhat.com>
Cc: libnl at lists.infradead.org
Sent: Thursday, January 22, 2015 7:05:54 PM
Subject: Re: tx/rx bytes counters and some more stats as a libnl public API

On Wed, 2015-01-21 at 01:53 -0500, Ido Barkan wrote:
> Hi guys,
> 
> Is it possible to add some more nic stats as a rtnl_link_get_STAT API?
> 
> We need it to report to report current NIC health and bandwidth in ovirt/vdsm.
> 
> Specifically we use rx_bytes, tx_bytes, rx_dropped, tx_dropped, rx_errors, tx_errors
> and we have to read /sys/class/net/*/statistics/* in a cumbersome way.


Hi,


isn't this already there?



include/netlink/route/link.h:


typedef enum {
        RTNL_LINK_RX_BYTES,             /*!< Bytes received */
        RTNL_LINK_TX_BYTES,             /*!< Bytes sent */
        RTNL_LINK_RX_ERRORS,            /*!< Receive errors */
        RTNL_LINK_TX_ERRORS,            /*!< Send errors */
        RTNL_LINK_RX_DROPPED,           /*!< Received packets dropped */
        RTNL_LINK_TX_DROPPED,           /*!< Packets dropped during transmit */
} rtnl_link_stat_id_t;

extern uint64_t rtnl_link_get_stat(struct rtnl_link *, rtnl_link_stat_id_t);



Thomas

_______________________________________________
libnl mailing list
libnl at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/libnl



More information about the libnl mailing list