summaryrefslogtreecommitdiff
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-12-02 22:44:56 +0300
committerJakub Kicinski <kuba@kernel.org>2021-12-02 22:44:56 +0300
commitfc993be36f9ea7fc286d84d8471a1a20e871aad4 (patch)
treecef440a299ed7d1c2418992f7d724b4d86e6d83b /net/core/dev.c
parent36d7d36fcf69e7f95068307f8bc519af31085431 (diff)
parenta51e3ac43ddbad891c2b1a4f3aa52371d6939570 (diff)
downloadlinux-fc993be36f9ea7fc286d84d8471a1a20e871aad4.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index d30adecc2bb2..aba8acc1238c 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4093,7 +4093,10 @@ static int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev)
if (dev->flags & IFF_UP) {
int cpu = smp_processor_id(); /* ok because BHs are off */
- if (txq->xmit_lock_owner != cpu) {
+ /* Other cpus might concurrently change txq->xmit_lock_owner
+ * to -1 or to their cpu id, but not to our id.
+ */
+ if (READ_ONCE(txq->xmit_lock_owner) != cpu) {
if (dev_xmit_recursion())
goto recursion_alert;