diff options
author | Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com> | 2016-07-26 02:47:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-26 17:26:42 -0400 |
commit | 7b3f52296493656015f0c0deddb6e90e36b9cda2 (patch) | |
tree | 08a395cd2b131c0b64e3e96d1c9e543ff6d9dfd0 /net/tipc/node.c | |
parent | 9ff26e9fabaf52f28fb5e875c0b9ffc2d1512039 (diff) |
tipc: make cluster size threshold for monitoring configurable
In this commit, we introduce support to configure the minimum
threshold to activate the new link monitoring algorithm.
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r-- | net/tipc/node.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c index 95cc78b51532..0fc531d0f709 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -1928,3 +1928,30 @@ out: | |||
1928 | 1928 | ||
1929 | return skb->len; | 1929 | return skb->len; |
1930 | } | 1930 | } |
1931 | |||
1932 | int tipc_nl_node_set_monitor(struct sk_buff *skb, struct genl_info *info) | ||
1933 | { | ||
1934 | struct nlattr *attrs[TIPC_NLA_MON_MAX + 1]; | ||
1935 | struct net *net = sock_net(skb->sk); | ||
1936 | int err; | ||
1937 | |||
1938 | if (!info->attrs[TIPC_NLA_MON]) | ||
1939 | return -EINVAL; | ||
1940 | |||
1941 | err = nla_parse_nested(attrs, TIPC_NLA_MON_MAX, | ||
1942 | info->attrs[TIPC_NLA_MON], | ||
1943 | tipc_nl_monitor_policy); | ||
1944 | if (err) | ||
1945 | return err; | ||
1946 | |||
1947 | if (attrs[TIPC_NLA_MON_ACTIVATION_THRESHOLD]) { | ||
1948 | u32 val; | ||
1949 | |||
1950 | val = nla_get_u32(attrs[TIPC_NLA_MON_ACTIVATION_THRESHOLD]); | ||
1951 | err = tipc_nl_monitor_set_threshold(net, val); | ||
1952 | if (err) | ||
1953 | return err; | ||
1954 | } | ||
1955 | |||
1956 | return 0; | ||
1957 | } | ||