Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tipc: update replicast capability for broadcast send link

When setting up a cluster with non-replicast/replicast capability
supported. This capability will be disabled for broadcast send link
in order to be backwards compatible.

However, when these non-support nodes left and be removed out the cluster.
We don't update this capability on broadcast send link. Then, some of
features that based on this capability will also disabling as unexpected.

In this commit, we make sure the broadcast send link capabilities will
be re-calculated as soon as a node removed/rejoined a cluster.

Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Hoang Le and committed by
David S. Miller
ba5f6a86 13baf667

+11 -5
+2 -2
net/tipc/bcast.c
··· 87 87 return tipc_link_mss(tipc_bc_sndlink(net)); 88 88 } 89 89 90 - void tipc_bcast_disable_rcast(struct net *net) 90 + void tipc_bcast_toggle_rcast(struct net *net, bool supp) 91 91 { 92 - tipc_bc_base(net)->rcast_support = false; 92 + tipc_bc_base(net)->rcast_support = supp; 93 93 } 94 94 95 95 static void tipc_bcbase_calc_bc_threshold(struct net *net)
+1 -1
net/tipc/bcast.h
··· 85 85 void tipc_bcast_inc_bearer_dst_cnt(struct net *net, int bearer_id); 86 86 void tipc_bcast_dec_bearer_dst_cnt(struct net *net, int bearer_id); 87 87 int tipc_bcast_get_mtu(struct net *net); 88 - void tipc_bcast_disable_rcast(struct net *net); 88 + void tipc_bcast_toggle_rcast(struct net *net, bool supp); 89 89 int tipc_mcast_xmit(struct net *net, struct sk_buff_head *pkts, 90 90 struct tipc_mc_method *method, struct tipc_nlist *dests, 91 91 u16 *cong_link_cnt);
+1 -1
net/tipc/link.c
··· 550 550 551 551 /* Disable replicast if even a single peer doesn't support it */ 552 552 if (link_is_bc_rcvlink(l) && !(peer_caps & TIPC_BCAST_RCAST)) 553 - tipc_bcast_disable_rcast(net); 553 + tipc_bcast_toggle_rcast(net, false); 554 554 555 555 return true; 556 556 }
+7 -1
net/tipc/node.c
··· 496 496 tn->capabilities &= temp_node->capabilities; 497 497 } 498 498 499 + tipc_bcast_toggle_rcast(net, 500 + (tn->capabilities & TIPC_BCAST_RCAST)); 501 + 499 502 goto exit; 500 503 } 501 504 n = kzalloc(sizeof(*n), GFP_ATOMIC); ··· 560 557 list_for_each_entry_rcu(temp_node, &tn->node_list, list) { 561 558 tn->capabilities &= temp_node->capabilities; 562 559 } 560 + tipc_bcast_toggle_rcast(net, (tn->capabilities & TIPC_BCAST_RCAST)); 563 561 trace_tipc_node_create(n, true, " "); 564 562 exit: 565 563 spin_unlock_bh(&tn->node_list_lock); ··· 744 740 list_for_each_entry_rcu(temp_node, &tn->node_list, list) { 745 741 tn->capabilities &= temp_node->capabilities; 746 742 } 747 - 743 + tipc_bcast_toggle_rcast(peer->net, 744 + (tn->capabilities & TIPC_BCAST_RCAST)); 748 745 spin_unlock_bh(&tn->node_list_lock); 749 746 return deleted; 750 747 } ··· 2203 2198 list_for_each_entry_rcu(temp_node, &tn->node_list, list) { 2204 2199 tn->capabilities &= temp_node->capabilities; 2205 2200 } 2201 + tipc_bcast_toggle_rcast(net, (tn->capabilities & TIPC_BCAST_RCAST)); 2206 2202 err = 0; 2207 2203 err_out: 2208 2204 tipc_node_put(peer);