summaryrefslogtreecommitdiff
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2026-03-02 21:14:28 +0300
committerJakub Kicinski <kuba@kernel.org>2026-03-05 03:54:09 +0300
commit9cde131cdd888873363b5d9dfd8d4d4c1fae6986 (patch)
tree1ceb14f3759bd6d8d62ca4fae81cb5374c57a7bf /net/core/dev.c
parent61753849b8bc6420cc5834fb3de331ce1134060d (diff)
downloadlinux-9cde131cdd888873363b5d9dfd8d4d4c1fae6986.tar.xz
net-sysfs: add rps_sock_flow_table_mask() helper
In preparation of the following patch, abstract access to the @mask field in 'struct rps_sock_flow_table'. Also cleanup rps_sock_flow_sysctl() a bit : - Rename orig_sock_table to o_sock_table. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Link: https://patch.msgid.link/20260302181432.1836150-4-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 19b84eaa2643..92f8eeac8de3 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5112,12 +5112,14 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb,
if (flow_table && sock_flow_table) {
struct rps_dev_flow *rflow;
u32 next_cpu;
+ u32 flow_id;
u32 ident;
/* First check into global flow table if there is a match.
* This READ_ONCE() pairs with WRITE_ONCE() from rps_record_sock_flow().
*/
- ident = READ_ONCE(sock_flow_table->ents[hash & sock_flow_table->mask]);
+ flow_id = hash & rps_sock_flow_table_mask(sock_flow_table);
+ ident = READ_ONCE(sock_flow_table->ents[flow_id]);
if ((ident ^ hash) & ~net_hotdata.rps_cpu_mask)
goto try_rps;