Skip to content

Commit 3f53bd8

Browse files
Erik Hugnedavem330
authored andcommitted
tipc: fix link acknowledge logic in receive path
Link state acks triggered from the receive path is done before the last received packet have been processed by the link layer. The effect of this is that the last received packet will not be included in the ack. This causes problems if the link window is set to TIPC_MIN_LINK_WIN, where the ack interval will be equal to the link tolerance, and the link enters a stop-and-go behavior. We move the ack logic to after link state processing, just before the packet is delivered to higher layers. Signed-off-by: Erik Hugne <[email protected]> Signed-off-by: Carl Sigurjonsson <[email protected]> Reviewed-by: Ying Xue <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7ae934b commit 3f53bd8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

net/tipc/link.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,11 +1422,6 @@ void tipc_rcv(struct sk_buff *head, struct tipc_bearer *b_ptr)
14221422
if (unlikely(!list_empty(&l_ptr->waiting_ports)))
14231423
tipc_link_wakeup_ports(l_ptr, 0);
14241424

1425-
if (unlikely(++l_ptr->unacked_window >= TIPC_MIN_LINK_WIN)) {
1426-
l_ptr->stats.sent_acks++;
1427-
tipc_link_proto_xmit(l_ptr, STATE_MSG, 0, 0, 0, 0, 0);
1428-
}
1429-
14301425
/* Process the incoming packet */
14311426
if (unlikely(!link_working_working(l_ptr))) {
14321427
if (msg_user(msg) == LINK_PROTOCOL) {
@@ -1460,6 +1455,11 @@ void tipc_rcv(struct sk_buff *head, struct tipc_bearer *b_ptr)
14601455
if (unlikely(l_ptr->oldest_deferred_in))
14611456
head = link_insert_deferred_queue(l_ptr, head);
14621457

1458+
if (unlikely(++l_ptr->unacked_window >= TIPC_MIN_LINK_WIN)) {
1459+
l_ptr->stats.sent_acks++;
1460+
tipc_link_proto_xmit(l_ptr, STATE_MSG, 0, 0, 0, 0, 0);
1461+
}
1462+
14631463
if (tipc_link_prepare_input(l_ptr, &buf)) {
14641464
tipc_node_unlock(n_ptr);
14651465
continue;

0 commit comments

Comments
 (0)