aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/sysctl_net_core.c
diff options
context:
space:
mode:
authorEric Dumazet <[email protected]>2025-04-07 16:35:59 +0000
committerJakub Kicinski <[email protected]>2025-04-08 19:30:55 +0000
commitc3025e94daa9ce84ef0e53df983b5bf2fbd76ea6 (patch)
treeae27369d8f8e2ba0f96e7038fa7a996d7d9c8d28 /net/core/sysctl_net_core.c
parentamd-xgbe: Convert to SPDX identifier (diff)
downloadkernel-c3025e94daa9ce84ef0e53df983b5bf2fbd76ea6.tar.gz
kernel-c3025e94daa9ce84ef0e53df983b5bf2fbd76ea6.zip
net: rps: change skb_flow_limit() hash function
As explained in commit f3483c8e1da6 ("net: rfs: hash function change"), masking low order bits of skb_get_hash(skb) has low entropy. A NIC with 32 RX queues uses the 5 low order bits of rss key to select a queue. This means all packets landing to a given queue share the same 5 low order bits. Switch to hash_32() to reduce hash collisions. Signed-off-by: Eric Dumazet <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/core/sysctl_net_core.c')
-rw-r--r--net/core/sysctl_net_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index c7769ee0d9c5..5cfe76ede523 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -248,7 +248,7 @@ static int flow_limit_cpu_sysctl(const struct ctl_table *table, int write,
ret = -ENOMEM;
goto write_unlock;
}
- cur->num_buckets = netdev_flow_limit_table_len;
+ cur->log_buckets = ilog2(netdev_flow_limit_table_len);
rcu_assign_pointer(sd->flow_limit, cur);
}
}