diff options
author | Jon Maloy <jon.maloy@ericsson.com> | 2018-02-14 07:34:39 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-14 15:22:24 -0500 |
commit | 37c64cf63ba1f9c071b37a2129ae9860fd423d6c (patch) | |
tree | 9c4837a85252baa3e662757ae90f04caca2cd110 /net/tipc/node.c | |
parent | a92ac140fc30f5e8fc407d75de44e0bce7f59ab6 (diff) |
tipc: apply bearer link tolerance on running links
Currently, the default link tolerance set in struct tipc_bearer only
has effect on links going up after that moment. I.e., a user has to
reset all the node's links across that bearer to have the new value
applied. This is too limiting and disturbing on a running cluster to
be useful.
We now change this so that also already existing links are updated
dynamically, without any need for a reset, when the bearer value is
changed. We leverage the already existing per-link functionality
for this to achieve the wanted effect.
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@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 | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c index 9036d8756e73..389193d7cf67 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -1618,6 +1618,30 @@ discard: | |||
1618 | kfree_skb(skb); | 1618 | kfree_skb(skb); |
1619 | } | 1619 | } |
1620 | 1620 | ||
1621 | void tipc_node_apply_tolerance(struct net *net, struct tipc_bearer *b) | ||
1622 | { | ||
1623 | struct tipc_net *tn = tipc_net(net); | ||
1624 | int bearer_id = b->identity; | ||
1625 | struct sk_buff_head xmitq; | ||
1626 | struct tipc_link_entry *e; | ||
1627 | struct tipc_node *n; | ||
1628 | |||
1629 | __skb_queue_head_init(&xmitq); | ||
1630 | |||
1631 | rcu_read_lock(); | ||
1632 | |||
1633 | list_for_each_entry_rcu(n, &tn->node_list, list) { | ||
1634 | tipc_node_write_lock(n); | ||
1635 | e = &n->links[bearer_id]; | ||
1636 | if (e->link) | ||
1637 | tipc_link_set_tolerance(e->link, b->tolerance, &xmitq); | ||
1638 | tipc_node_write_unlock(n); | ||
1639 | tipc_bearer_xmit(net, bearer_id, &xmitq, &e->maddr); | ||
1640 | } | ||
1641 | |||
1642 | rcu_read_unlock(); | ||
1643 | } | ||
1644 | |||
1621 | int tipc_nl_peer_rm(struct sk_buff *skb, struct genl_info *info) | 1645 | int tipc_nl_peer_rm(struct sk_buff *skb, struct genl_info *info) |
1622 | { | 1646 | { |
1623 | struct net *net = sock_net(skb->sk); | 1647 | struct net *net = sock_net(skb->sk); |