]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
bnxt: don't lock the tx queue from napi poll
authorJakub Kicinski <kuba@kernel.org>
Thu, 12 Aug 2021 21:42:39 +0000 (14:42 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 24 Sep 2021 10:27:46 +0000 (12:27 +0200)
commite02af159977a0a60688273b2f71d019fbf3cbb74
tree18828410dc1a4675287c65169787599ba77d4df7
parent2b93ff97d093f9cc367d547f2be7e92096a55604
bnxt: don't lock the tx queue from napi poll

BugLink: https://bugs.launchpad.net/bugs/1944212
[ Upstream commit 3c603136c9f82833813af77185618de5af67676c ]

We can't take the tx lock from the napi poll routine, because
netpoll can poll napi at any moment, including with the tx lock
already held.

The tx lock is protecting against two paths - the disable
path, and (as Michael points out) the NETDEV_TX_BUSY case
which may occur if NAPI completions race with start_xmit
and both decide to re-enable the queue.

For the disable/ifdown path use synchronize_net() to make sure
closing the device does not race we restarting the queues.
Annotate accesses to dev_state against data races.

For the NAPI cleanup vs start_xmit path - appropriate barriers
are already in place in the main spot where Tx queue is stopped
but we need to do the same careful dance in the TX_BUSY case.

Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c