diff options
| author | Eric Dumazet <edumazet@google.com> | 2025-03-21 20:13:09 +0300 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2025-03-25 18:24:13 +0300 |
| commit | f3483c8e1da62993fe0f57af23b925de7661adaa (patch) | |
| tree | 3d864c054b3ebe3c8eecda735e3b235851214994 /include | |
| parent | 1952e19c02ae8ea0c663d30b19be14344b543068 (diff) | |
| download | linux-f3483c8e1da62993fe0f57af23b925de7661adaa.tar.xz | |
net: rfs: hash function change
RFS is using two kinds of hash tables.
First one is controlled by /proc/sys/net/core/rps_sock_flow_entries = 2^N
and using the N low order bits of the l4 hash is good enough.
Then each RX queue has its own hash table, controlled by
/sys/class/net/eth1/queues/rx-$q/rps_flow_cnt = 2^X
Current hash function, using the X low order bits is suboptimal,
because RSS is usually using Func(hash) = (hash % power_of_two);
For example, with 32 RX queues, 6 low order bits have no entropy
for a given queue.
Switch this hash function to hash_32(hash, log) to increase
chances to use all possible slots and reduce collisions.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tom Herbert <tom@herbertland.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250321171309.634100-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/rps.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/rps.h b/include/net/rps.h index a93401d23d66..e358e9711f27 100644 --- a/include/net/rps.h +++ b/include/net/rps.h @@ -39,7 +39,7 @@ struct rps_dev_flow { * The rps_dev_flow_table structure contains a table of flow mappings. */ struct rps_dev_flow_table { - unsigned int mask; + u8 log; struct rcu_head rcu; struct rps_dev_flow flows[]; }; |
