Skip to content

Commit c49a0a8

Browse files
Jon Paul Maloydavem330
authored andcommitted
tipc: ensure binding table initial distribution is sent via first link
Correct synchronization of the broadcast link at first contact between two nodes is dependent on the assumption that the binding table "bulk" update passes via the same link as the initial broadcast syncronization message, i.e., via the first link that is established. This is not guaranteed in the current implementation. If two link come up very close to each other in time, the "bulk" may quite well pass via the second link, and hence void the guarantee of a correct initial synchronization before the broadcast link is opened. This commit makes two small changes to strengthen this guarantee. 1) We let the second established link occupy slot 1 of the "active_links" array, while the first link will retain slot 0. (This is in reality a cosmetic change, we could just as well keep the current, opposite order) 2) We let the name distributor always use link selector/slot 0 when it sends it binding table updates. The extra traffic bias on the first link caused by this change should be negligible, since binding table updates constitutes a very small fraction of the total traffic. Signed-off-by: Jon Maloy <[email protected]> Reviewed-by: Ying Xue <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c72fa87 commit c49a0a8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

net/tipc/name_distr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void named_cluster_distribute(struct net *net, struct sk_buff *skb)
102102
if (!oskb)
103103
break;
104104
msg_set_destnode(buf_msg(oskb), dnode);
105-
tipc_node_xmit_skb(net, oskb, dnode, dnode);
105+
tipc_node_xmit_skb(net, oskb, dnode, 0);
106106
}
107107
rcu_read_unlock();
108108

@@ -223,7 +223,7 @@ void tipc_named_node_up(struct net *net, u32 dnode)
223223
&tn->nametbl->publ_list[TIPC_ZONE_SCOPE]);
224224
rcu_read_unlock();
225225

226-
tipc_node_xmit(net, &head, dnode, dnode);
226+
tipc_node_xmit(net, &head, dnode, 0);
227227
}
228228

229229
static void tipc_publ_subscribe(struct net *net, struct publication *publ,

net/tipc/node.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ static void __tipc_node_link_up(struct tipc_node *n, int bearer_id,
370370
tipc_link_set_active(ol, false);
371371
} else if (nl->priority == ol->priority) {
372372
tipc_link_set_active(nl, true);
373-
*slot0 = bearer_id;
373+
*slot1 = bearer_id;
374374
} else {
375375
pr_debug("New link <%s> is standby\n", nl->name);
376376
}

0 commit comments

Comments
 (0)