diff options
author | Eric Dumazet <edumazet@google.com> | 2021-11-16 19:29:21 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-11-17 14:56:16 +0000 |
commit | 8160fb43d55d26d64607fd32fe69185a5f5fe41f (patch) | |
tree | 4b03026ee23389b71df5a8ca657e9dd7ef639974 /net/core/net-sysfs.c | |
parent | b32563b6ccbacf2a1bf6fb7093b4fd2b7dc28612 (diff) |
net: use an atomic_long_t for queue->trans_timeout
tx_timeout_show() assumed dev_watchdog() would stop all
the queues, to fetch queue->trans_timeout under protection
of the queue->_xmit_lock.
As we want to no longer disrupt transmits, we use an
atomic_long_t instead.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: david decotigny <david.decotigny@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/net-sysfs.c')
-rw-r--r-- | net/core/net-sysfs.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 9c01c642cf9e..addbef5419fb 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -1201,11 +1201,7 @@ static const struct sysfs_ops netdev_queue_sysfs_ops = { static ssize_t tx_timeout_show(struct netdev_queue *queue, char *buf) { - unsigned long trans_timeout; - - spin_lock_irq(&queue->_xmit_lock); - trans_timeout = queue->trans_timeout; - spin_unlock_irq(&queue->_xmit_lock); + unsigned long trans_timeout = atomic_long_read(&queue->trans_timeout); return sprintf(buf, fmt_ulong, trans_timeout); } |