aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/netns
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@OSS.NVIDIA.COM>2021-05-17 21:15:18 +0300
committerDavid S. Miller <davem@davemloft.net>2021-05-18 13:27:32 -0700
commitce5c9c20d364f156c885efed8c71fca2945db00f (patch)
treebb4858afb789ab04d7330dc3bff07f999814bbff /include/net/netns
parentipv4: Calculate multipath hash inside switch statement (diff)
downloadlinux-dev-ce5c9c20d364f156c885efed8c71fca2945db00f.tar.xz
linux-dev-ce5c9c20d364f156c885efed8c71fca2945db00f.zip
ipv4: Add a sysctl to control multipath hash fields
A subsequent patch will add a new multipath hash policy where the packet fields used for multipath hash calculation are determined by user space. This patch adds a sysctl that allows user space to set these fields. The packet fields are represented using a bitmask and are common between IPv4 and IPv6 to allow user space to use the same numbering across both protocols. For example, to hash based on standard 5-tuple: # sysctl -w net.ipv4.fib_multipath_hash_fields=0x0037 net.ipv4.fib_multipath_hash_fields = 0x0037 The kernel rejects unknown fields, for example: # sysctl -w net.ipv4.fib_multipath_hash_fields=0x1000 sysctl: setting key "net.ipv4.fib_multipath_hash_fields": Invalid argument More fields can be added in the future, if needed. Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: David Ahern <dsahern@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/netns')
-rw-r--r--include/net/netns/ipv4.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index f6af8d96d3c6..746c80cd4257 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -210,6 +210,7 @@ struct netns_ipv4 {
#endif
#endif
#ifdef CONFIG_IP_ROUTE_MULTIPATH
+ u32 sysctl_fib_multipath_hash_fields;
u8 sysctl_fib_multipath_use_neigh;
u8 sysctl_fib_multipath_hash_policy;
#endif