aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netback/interface.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2017-02-26 15:34:42 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-02-26 15:34:42 -0500
commit8e22e1b3499a446df48c2b26667ca36c55bf864c (patch)
tree5329f98b3eb3c95a9dcbab0fa4f9b6e62f0e788d /drivers/net/xen-netback/interface.c
parent00d3c14f14d51babd8aeafd5fa734ccf04f5ca3d (diff)
parent64a577196d66b44e37384bc5c4d78c61f59d5b2a (diff)
Merge airlied/drm-next into drm-misc-next
Backmerge the main pull request to sync up with all the newly landed drivers. Otherwise we'll have chaos even before 4.12 started in earnest. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'drivers/net/xen-netback/interface.c')
-rw-r--r--drivers/net/xen-netback/interface.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
index e30ffd29b7e9..579521327b03 100644
--- a/drivers/net/xen-netback/interface.c
+++ b/drivers/net/xen-netback/interface.c
@@ -221,18 +221,18 @@ static struct net_device_stats *xenvif_get_stats(struct net_device *dev)
221{ 221{
222 struct xenvif *vif = netdev_priv(dev); 222 struct xenvif *vif = netdev_priv(dev);
223 struct xenvif_queue *queue = NULL; 223 struct xenvif_queue *queue = NULL;
224 unsigned int num_queues = vif->num_queues;
225 unsigned long rx_bytes = 0; 224 unsigned long rx_bytes = 0;
226 unsigned long rx_packets = 0; 225 unsigned long rx_packets = 0;
227 unsigned long tx_bytes = 0; 226 unsigned long tx_bytes = 0;
228 unsigned long tx_packets = 0; 227 unsigned long tx_packets = 0;
229 unsigned int index; 228 unsigned int index;
230 229
230 spin_lock(&vif->lock);
231 if (vif->queues == NULL) 231 if (vif->queues == NULL)
232 goto out; 232 goto out;
233 233
234 /* Aggregate tx and rx stats from each queue */ 234 /* Aggregate tx and rx stats from each queue */
235 for (index = 0; index < num_queues; ++index) { 235 for (index = 0; index < vif->num_queues; ++index) {
236 queue = &vif->queues[index]; 236 queue = &vif->queues[index];
237 rx_bytes += queue->stats.rx_bytes; 237 rx_bytes += queue->stats.rx_bytes;
238 rx_packets += queue->stats.rx_packets; 238 rx_packets += queue->stats.rx_packets;
@@ -241,6 +241,8 @@ static struct net_device_stats *xenvif_get_stats(struct net_device *dev)
241 } 241 }
242 242
243out: 243out:
244 spin_unlock(&vif->lock);
245
244 vif->dev->stats.rx_bytes = rx_bytes; 246 vif->dev->stats.rx_bytes = rx_bytes;
245 vif->dev->stats.rx_packets = rx_packets; 247 vif->dev->stats.rx_packets = rx_packets;
246 vif->dev->stats.tx_bytes = tx_bytes; 248 vif->dev->stats.tx_bytes = tx_bytes;