Commit 648106c3 authored by Amit Cohen's avatar Amit Cohen Committed by David S. Miller

IPv4: Extend 'fib_notify_on_flag_change' sysctl

Add the value '2' to 'fib_notify_on_flag_change' to allow sending
notifications only for failed route installation.

Separate value is added for such notifications because there are less of
them, so they do not impact performance and some users will find them more
important.
Signed-off-by: default avatarAmit Cohen <amcohen@nvidia.com>
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 36c5100e
...@@ -180,7 +180,7 @@ min_adv_mss - INTEGER ...@@ -180,7 +180,7 @@ min_adv_mss - INTEGER
fib_notify_on_flag_change - INTEGER fib_notify_on_flag_change - INTEGER
Whether to emit RTM_NEWROUTE notifications whenever RTM_F_OFFLOAD/ Whether to emit RTM_NEWROUTE notifications whenever RTM_F_OFFLOAD/
RTM_F_TRAP flags are changed. RTM_F_TRAP/RTM_F_OFFLOAD_FAILED flags are changed.
After installing a route to the kernel, user space receives an After installing a route to the kernel, user space receives an
acknowledgment, which means the route was installed in the kernel, acknowledgment, which means the route was installed in the kernel,
...@@ -197,6 +197,7 @@ fib_notify_on_flag_change - INTEGER ...@@ -197,6 +197,7 @@ fib_notify_on_flag_change - INTEGER
- 0 - Do not emit notifications. - 0 - Do not emit notifications.
- 1 - Emit notifications. - 1 - Emit notifications.
- 2 - Emit notifications only for RTM_F_OFFLOAD_FAILED flag change.
IP Fragmentation: IP Fragmentation:
......
...@@ -1053,6 +1053,12 @@ void fib_alias_hw_flags_set(struct net *net, const struct fib_rt_info *fri) ...@@ -1053,6 +1053,12 @@ void fib_alias_hw_flags_set(struct net *net, const struct fib_rt_info *fri)
fa_match->offload = fri->offload; fa_match->offload = fri->offload;
fa_match->trap = fri->trap; fa_match->trap = fri->trap;
/* 2 means send notifications only if offload_failed was changed. */
if (net->ipv4.sysctl_fib_notify_on_flag_change == 2 &&
fa_match->offload_failed == fri->offload_failed)
goto out;
fa_match->offload_failed = fri->offload_failed; fa_match->offload_failed = fri->offload_failed;
if (!net->ipv4.sysctl_fib_notify_on_flag_change) if (!net->ipv4.sysctl_fib_notify_on_flag_change)
......
...@@ -1361,7 +1361,7 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -1361,7 +1361,7 @@ static struct ctl_table ipv4_net_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE, .extra2 = &two,
}, },
{ } { }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment