aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/core/net-procfs.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2025-04-07 16:36:00 +0000
committerJakub Kicinski <kuba@kernel.org>2025-04-08 12:30:55 -0700
commit7b6f0a852da34379a304d7020d70049ba5d1f0f3 (patch)
tree7dfb396686dab3189b36f237f97d57f521ec6685 /net/core/net-procfs.c
parentnet: rps: change skb_flow_limit() hash function (diff)
downloadwireguard-linux-7b6f0a852da34379a304d7020d70049ba5d1f0f3.tar.xz
wireguard-linux-7b6f0a852da34379a304d7020d70049ba5d1f0f3.zip
net: rps: annotate data-races around (struct sd_flow_limit)->count
softnet_seq_show() can read fl->count while another cpu updates this field from skb_flow_limit(). Make this field an 'unsigned int', as its only consumer only deals with 32 bit. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://patch.msgid.link/20250407163602.170356-3-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to '')
-rw-r--r--net/core/net-procfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/net-procfs.c b/net/core/net-procfs.c
index 3e92bf0f9060..69782d62fbe1 100644
--- a/net/core/net-procfs.c
+++ b/net/core/net-procfs.c
@@ -132,8 +132,9 @@ static int softnet_seq_show(struct seq_file *seq, void *v)
rcu_read_lock();
fl = rcu_dereference(sd->flow_limit);
+ /* Pairs with WRITE_ONCE() in skb_flow_limit() */
if (fl)
- flow_limit_count = fl->count;
+ flow_limit_count = READ_ONCE(fl->count);
rcu_read_unlock();
#endif