diff options
| author | David S. Miller <davem@davemloft.net> | 2016-05-04 14:16:51 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2016-05-04 14:16:51 -0400 |
| commit | 4d659fcb20d3d3302b429c889a73a92ff2804b9a (patch) | |
| tree | 697d25e26da4437eb1421298a21e63ea56f64453 /include/linux | |
| parent | a6e5472dc3d99201d0f59dd4d1faf0dcf7d978c3 (diff) | |
| parent | 9b36627acecd5792e81daf1a3bff8eab39ed45fb (diff) | |
| download | cachepc-linux-4d659fcb20d3d3302b429c889a73a92ff2804b9a.tar.gz cachepc-linux-4d659fcb20d3d3302b429c889a73a92ff2804b9a.zip | |
Merge branch 'kill_trans_start'
Florian Westphal says:
====================
net: remove trans_start from struct net_device
We currently have two instances for trans_start, once in
net_device and once in netdev_queue.
This series removes trans_start from net_device.
Updates to dev->trans_start are replaced with updates to netdev queue 0.
This series is compile-tested only.
Replacement is done in 3 steps:
1. Replace read-accesses:
x = dev->trans_start
gets replaced by
x = dev_trans_start(dev)
2. Replace write accesses:
dev->trans_start = jiffies;
gets replaced with new helper:
netif_trans_update(dev);
3. This helper is then changed to set
netdev_get_tx_queue(dev, 0)->trans_start
instead of dev->trans_start.
After this dev->trans_start can be removed.
It should be noted that after this series several instances
of netif_trans_update() are useless (if they occur in
.ndo_start_xmit and driver doesn't set LLTX flag -- stack already
did an update).
Comments welcome.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/netdevice.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index bcf012637d10..63580e6d0df4 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -581,7 +581,7 @@ struct netdev_queue { spinlock_t _xmit_lock ____cacheline_aligned_in_smp; int xmit_lock_owner; /* - * please use this field instead of dev->trans_start + * Time (in jiffies) of last Tx */ unsigned long trans_start; @@ -1545,7 +1545,6 @@ enum netdev_priv_flags { * * @offload_fwd_mark: Offload device fwding mark * - * @trans_start: Time (in jiffies) of last Tx * @watchdog_timeo: Represents the timeout that is used by * the watchdog (see dev_watchdog()) * @watchdog_timer: List of timers @@ -1794,13 +1793,6 @@ struct net_device { #endif /* These may be needed for future network-power-down code. */ - - /* - * trans_start here is expensive for high speed devices on SMP, - * please use netdev_queue->trans_start instead. - */ - unsigned long trans_start; - struct timer_list watchdog_timer; int __percpu *pcpu_refcnt; @@ -3481,6 +3473,15 @@ 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) +{ + struct netdev_queue *txq = netdev_get_tx_queue(dev, 0); + + if (txq->trans_start != jiffies) + txq->trans_start = jiffies; +} + /** * netif_tx_lock - grab network device transmit lock * @dev: network device |
