Currently, updating binding table (add service binding to
name table/withdraw a service binding) is being sent over replicast.
However, if we are scaling up clusters to > 100 nodes/containers this
method is less affection because of looping through nodes in a cluster one
by one.

It is worth to use broadcast to update a binding service. Then binding
table updates in all nodes for one shot.

The mechanism is backward compatible because of sending side changing.

Signed-off-by: Hoang Le <hoang.h...@dektech.com.au>
---
 net/tipc/bcast.c      | 13 +++++++++++++
 net/tipc/bcast.h      |  2 ++
 net/tipc/name_table.c |  4 ++--
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index f41096a759fa..18431fa897ab 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -843,3 +843,16 @@ void tipc_mcast_filter_msg(struct net *net, struct 
sk_buff_head *defq,
                __skb_queue_tail(inputq, _skb);
        }
 }
+
+int tipc_bcast_named_publish(struct net *net, struct sk_buff *skb)
+{
+       struct sk_buff_head xmitq;
+       u16 cong_link_cnt;
+       int rc = 0;
+
+       __skb_queue_head_init(&xmitq);
+       __skb_queue_tail(&xmitq, skb);
+       rc = tipc_bcast_xmit(net, &xmitq, &cong_link_cnt);
+       __skb_queue_purge(&xmitq);
+       return rc;
+}
diff --git a/net/tipc/bcast.h b/net/tipc/bcast.h
index dadad953e2be..a100da3800fc 100644
--- a/net/tipc/bcast.h
+++ b/net/tipc/bcast.h
@@ -101,6 +101,8 @@ int tipc_bclink_reset_stats(struct net *net);
 u32 tipc_bcast_get_broadcast_mode(struct net *net);
 u32 tipc_bcast_get_broadcast_ratio(struct net *net);
 
+int tipc_bcast_named_publish(struct net *net, struct sk_buff *skb);
+
 void tipc_mcast_filter_msg(struct net *net, struct sk_buff_head *defq,
                           struct sk_buff_head *inputq);
 
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index 66a65c2cdb23..9e9c61f7c999 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -633,7 +633,7 @@ struct publication *tipc_nametbl_publish(struct net *net, 
u32 type, u32 lower,
        spin_unlock_bh(&tn->nametbl_lock);
 
        if (skb)
-               tipc_node_broadcast(net, skb);
+               tipc_bcast_named_publish(net, skb);
        return p;
 }
 
@@ -664,7 +664,7 @@ int tipc_nametbl_withdraw(struct net *net, u32 type, u32 
lower,
        spin_unlock_bh(&tn->nametbl_lock);
 
        if (skb) {
-               tipc_node_broadcast(net, skb);
+               tipc_bcast_named_publish(net, skb);
                return 1;
        }
        return 0;
-- 
2.20.1



_______________________________________________
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to