Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d63951d7 authored by David Vrabel's avatar David Vrabel Committed by David S. Miller
Browse files

xen-netback: return correct ethtool stats



Use correct pointer arithmetic to get the pointer to each stat.

Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 04b91701
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -340,12 +340,11 @@ static void xenvif_get_ethtool_stats(struct net_device *dev,
	unsigned int num_queues = vif->num_queues;
	unsigned int num_queues = vif->num_queues;
	int i;
	int i;
	unsigned int queue_index;
	unsigned int queue_index;
	struct xenvif_stats *vif_stats;


	for (i = 0; i < ARRAY_SIZE(xenvif_stats); i++) {
	for (i = 0; i < ARRAY_SIZE(xenvif_stats); i++) {
		unsigned long accum = 0;
		unsigned long accum = 0;
		for (queue_index = 0; queue_index < num_queues; ++queue_index) {
		for (queue_index = 0; queue_index < num_queues; ++queue_index) {
			vif_stats = &vif->queues[queue_index].stats;
			void *vif_stats = &vif->queues[queue_index].stats;
			accum += *(unsigned long *)(vif_stats + xenvif_stats[i].offset);
			accum += *(unsigned long *)(vif_stats + xenvif_stats[i].offset);
		}
		}
		data[i] = accum;
		data[i] = accum;