search for: virtnet_stat_off

Displaying 2 results from an estimated 2 matches for "virtnet_stat_off".

2012 Jun 05
1
[net-next RFC PATCH] virtio_net: collect satistics and export through ethtool
...a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 5214b1e..7ab0cc1 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -41,6 +41,10 @@ module_param(gso, bool, 0444); #define VIRTNET_SEND_COMMAND_SG_MAX 2 #define VIRTNET_DRIVER_VERSION "1.0.0" +#define VIRTNET_STAT_OFF(m) offsetof(struct virtnet_stats, m) +#define VIRTNET_STAT(stat, i) (*((u64 *)((char *)stat + \ + virtnet_stats_str_attr[i].stat_offset))) + struct virtnet_stats { struct u64_stats_sync syncp; u64 tx_bytes; @@ -48,8 +52,33 @@ struct virtnet_stats { u64 rx_bytes; u64 rx_packets;...
2012 Jun 05
1
[net-next RFC PATCH] virtio_net: collect satistics and export through ethtool
...a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 5214b1e..7ab0cc1 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -41,6 +41,10 @@ module_param(gso, bool, 0444); #define VIRTNET_SEND_COMMAND_SG_MAX 2 #define VIRTNET_DRIVER_VERSION "1.0.0" +#define VIRTNET_STAT_OFF(m) offsetof(struct virtnet_stats, m) +#define VIRTNET_STAT(stat, i) (*((u64 *)((char *)stat + \ + virtnet_stats_str_attr[i].stat_offset))) + struct virtnet_stats { struct u64_stats_sync syncp; u64 tx_bytes; @@ -48,8 +52,33 @@ struct virtnet_stats { u64 rx_bytes; u64 rx_packets;...