net: rps: locklessly access rflow->cpu
authorJason Xing <kernelxing@tencent.com>
Thu, 18 Apr 2024 07:36:03 +0000 (15:36 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 19 Apr 2024 10:38:03 +0000 (11:38 +0100)
This is the last member in struct rps_dev_flow which should be
protected locklessly. So finish it.

Signed-off-by: Jason Xing <kernelxing@tencent.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c

index 182fce2537d4af817efe70e4e4c6f07f708a2dfa..8bdc59074b29c287e432c73fffbe93c63d539ad2 100644 (file)
@@ -4539,7 +4539,7 @@ set_rps_cpu(struct net_device *dev, struct sk_buff *skb,
                rps_input_queue_tail_save(&rflow->last_qtail, head);
        }
 
-       rflow->cpu = next_cpu;
+       WRITE_ONCE(rflow->cpu, next_cpu);
        return rflow;
 }