提交 6fad361a 编写于 作者: A Amit Cohen 提交者: David S. Miller

IPv6: 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: NAmit Cohen <amcohen@nvidia.com>
Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0c5fcf9e
...@@ -1798,7 +1798,7 @@ nexthop_compat_mode - BOOLEAN ...@@ -1798,7 +1798,7 @@ nexthop_compat_mode - BOOLEAN
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,
...@@ -1815,6 +1815,7 @@ fib_notify_on_flag_change - INTEGER ...@@ -1815,6 +1815,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.
IPv6 Fragmentation: IPv6 Fragmentation:
......
...@@ -6083,6 +6083,12 @@ void fib6_info_hw_flags_set(struct net *net, struct fib6_info *f6i, ...@@ -6083,6 +6083,12 @@ void fib6_info_hw_flags_set(struct net *net, struct fib6_info *f6i,
f6i->offload = offload; f6i->offload = offload;
f6i->trap = trap; f6i->trap = trap;
/* 2 means send notifications only if offload_failed was changed. */
if (net->ipv6.sysctl.fib_notify_on_flag_change == 2 &&
f6i->offload_failed == offload_failed)
return;
f6i->offload_failed = offload_failed; f6i->offload_failed = offload_failed;
if (!rcu_access_pointer(f6i->fib6_node)) if (!rcu_access_pointer(f6i->fib6_node))
......
...@@ -167,7 +167,7 @@ static struct ctl_table ipv6_table_template[] = { ...@@ -167,7 +167,7 @@ static struct ctl_table ipv6_table_template[] = {
.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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册