search for: netbk_get_ethtool_stat

Displaying 1 result from an estimated 1 matches for "netbk_get_ethtool_stat".

2009 Feb 05
0
[PATCH] netback: add ethtool stat to track copied skbs
...bk"); +} + +static const struct netif_stat { + char name[ETH_GSTRING_LEN]; + u16 offset; +} netbk_stats[] = { + { "copied_skbs", offsetof(netif_t, nr_copied_skbs) }, +}; + +static int netbk_get_stats_count(struct net_device *dev) +{ + return ARRAY_SIZE(netbk_stats); +} + +static void netbk_get_ethtool_stats(struct net_device *dev, + struct ethtool_stats *stats, u64 * data) +{ + void *netif = netdev_priv(dev); + int i; + + for (i = 0; i < ARRAY_SIZE(netbk_stats); i++) + data[i] = *(int *)(netif + netbk_stats[i].offset); +} + +static void netbk_get_strings(struct net_device *dev, u32 stringse...