summaryrefslogtreecommitdiff
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-02-09 07:39:13 +0300
committerDavid S. Miller <davem@davemloft.net>2015-02-09 08:54:09 +0300
commit93c1af6ca94c1e763efba76a127b5c135e3d23a6 (patch)
tree80725b4e6f7b9d10689a7d8a0132db7113d04a30 /include/linux/netdevice.h
parentacde2c2d28c8afee41eb67ee1cbf9e47a3f3e475 (diff)
downloadlinux-93c1af6ca94c1e763efba76a127b5c135e3d23a6.tar.xz
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: 567e4b79731c ("net: rfs: add hash collision detection") Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ab3b7cef4638..d115256ed5a2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -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]))