net:rfs: adjust table size checking
Make sure root user does not try something stupid.
Also make sure mask field in struct rps_sock_flow_table
does not share a cache line with the potentially often dirtied
flow table.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Fixes: 567e4b7973
("net: rfs: add hash collision detection")
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
acde2c2d28
commit
93c1af6ca9
@@ -653,7 +653,8 @@ struct rps_dev_flow_table {
|
||||
*/
|
||||
struct rps_sock_flow_table {
|
||||
u32 mask;
|
||||
u32 ents[0];
|
||||
|
||||
u32 ents[0] ____cacheline_aligned_in_smp;
|
||||
};
|
||||
#define RPS_SOCK_FLOW_TABLE_SIZE(_num) (offsetof(struct rps_sock_flow_table, ents[_num]))
|
||||
|
||||
|
Reference in New Issue
Block a user