aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-11-03 15:40:42 +0900
committerDavid S. Miller <davem@davemloft.net>2017-11-03 15:40:42 +0900
commit6437b112f70612212c20359a708af106a564d17c (patch)
tree83492098d0c91c46eb68b578c6318efcbd23241d /net
parentcxgb4: fix error return code in cxgb4_set_hash_filter() (diff)
parentmlxsw: spectrum_router: Update multipath hash parameters upon netevents (diff)
downloadlinux-dev-6437b112f70612212c20359a708af106a564d17c.tar.xz
linux-dev-6437b112f70612212c20359a708af106a564d17c.zip
Merge branch 'mlxsw-Align-multipath-hash-parameters-with-kernels'
Jiri Pirko says: ==================== mlxsw: Align multipath hash parameters with kernel's Ido says: This set makes sure the device is using the same parameters as the kernel when it computes the multipath hash during IP forwarding. First patch adds a new netevent to let interested listeners know that the multipath hash policy has changed. Next two patches do small and non-functional changes in the mlxsw driver. Last patches configure the multipath hash policy upon driver initialization and as a response to netevents. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/ipv4/sysctl_net_ipv4.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 4602af6d5358..8dcc2b185fcc 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -25,6 +25,7 @@
#include <net/inet_frag.h>
#include <net/ping.h>
#include <net/protocol.h>
+#include <net/netevent.h>
static int zero;
static int one = 1;
@@ -385,6 +386,23 @@ static int proc_tcp_available_ulp(struct ctl_table *ctl,
return ret;
}
+#ifdef CONFIG_IP_ROUTE_MULTIPATH
+static int proc_fib_multipath_hash_policy(struct ctl_table *table, int write,
+ void __user *buffer, size_t *lenp,
+ loff_t *ppos)
+{
+ struct net *net = container_of(table->data, struct net,
+ ipv4.sysctl_fib_multipath_hash_policy);
+ int ret;
+
+ ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
+ if (write && ret == 0)
+ call_netevent_notifiers(NETEVENT_MULTIPATH_HASH_UPDATE, net);
+
+ return ret;
+}
+#endif
+
static struct ctl_table ipv4_table[] = {
{
.procname = "tcp_max_orphans",
@@ -907,7 +925,7 @@ static struct ctl_table ipv4_net_table[] = {
.data = &init_net.ipv4.sysctl_fib_multipath_hash_policy,
.maxlen = sizeof(int),
.mode = 0644,
- .proc_handler = proc_dointvec_minmax,
+ .proc_handler = proc_fib_multipath_hash_policy,
.extra1 = &zero,
.extra2 = &one,
},