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

tipc: fix problem with parallel link synchronization mechanism

Currently, we try to accumulate arrived packets in the links's
'deferred' queue during the parallel link syncronization phase.

This entails two problems:

- With an unlucky combination of arriving packets the algorithm
may go into a lockstep with the out-of-sequence handling function,
where the synch mechanism is adding a packet to the deferred queue,
while the out-of-sequence handling is retrieving it again, thus
ending up in a loop inside the node_lock scope.

- Even if this is avoided, the link will very often send out
unnecessary protocol messages, in the worst case leading to
redundant retransmissions.

We fix this by just dropping arriving packets on the upcoming link
during the synchronization phase, thus relying on the retransmission
protocol to resolve the situation once the two links have arrived to
a synchronized state.

Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-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>

authored by

Jon Paul Maloy and committed by
David S. Miller
0d699f28 f2f67390

+2 -5
+2 -5
net/tipc/link.c
··· 1145 1145 } 1146 1146 /* Synchronize with parallel link if applicable */ 1147 1147 if (unlikely((l_ptr->flags & LINK_SYNCHING) && !msg_dup(msg))) { 1148 - link_handle_out_of_seq_msg(l_ptr, skb); 1149 - if (link_synch(l_ptr)) 1150 - link_retrieve_defq(l_ptr, &head); 1151 - skb = NULL; 1152 - goto unlock; 1148 + if (!link_synch(l_ptr)) 1149 + goto unlock; 1153 1150 } 1154 1151 l_ptr->next_in_no++; 1155 1152 if (unlikely(!skb_queue_empty(&l_ptr->deferdq)))