]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
netdevice: add helper to update trans_start
authorFlorian Westphal <fw@strlen.de>
Tue, 3 May 2016 14:31:00 +0000 (16:31 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 May 2016 18:16:48 +0000 (14:16 -0400)
trans_start exists twice:
- as member of net_device (legacy)
- as member of netdev_queue

In order to get rid of the legacy case, add a helper for the
dev->trans_update (this patch), then convert spots that do

dev->trans_start = jiffies

to use this helper (next patch).

This would then allow us to change the helper so that it updates the
trans_stamp of netdev queue 0 instead.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h

index bcf012637d109a76edf251ffaa6d38fe97c3ef56..f53412cccbaa19dca8a6b45706c1c8784511f887 100644 (file)
@@ -3481,6 +3481,12 @@ static inline void txq_trans_update(struct netdev_queue *txq)
                txq->trans_start = jiffies;
 }
 
+/* legacy drivers only, netdev_start_xmit() sets txq->trans_start */
+static inline void netif_trans_update(struct net_device *dev)
+{
+       dev->trans_start = jiffies;
+}
+
 /**
  *     netif_tx_lock - grab network device transmit lock
  *     @dev: network device