Skip to content

Commit d3b0999

Browse files
Jon Maloydavem330
authored andcommitted
tipc: eliminate more unnecessary nacks and retransmissions
When we increase the link tranmsit window we often observe the following scenario: 1) A STATE message bypasses a sequence of traffic packets and arrives far ahead of those to the receiver. STATE messages contain a 'peers_nxt_snt' field to indicate which was the last packet sent from the peer. This mechanism is intended as a last resort for the receiver to detect missing packets, e.g., during very low traffic when there is no packet flow to help early loss detection. 3) The receiving link compares the 'peer_nxt_snt' field to its own 'rcv_nxt', finds that there is a gap, and immediately sends a NACK message back to the peer. 4) When this NACKs arrives at the sender, all the requested retransmissions are performed, since it is a first-time request. Just like in the scenario described in the previous commit this leads to many redundant retransmissions, with decreased throughput as a consequence. We fix this by adding two more conditions before we send a NACK in this sitution. First, the deferred queue must be empty, so we cannot assume that the potential packet loss has already been detected by other means. Second, we check the 'peers_snd_nxt' field only in probe/ probe_reply messages, thus turning this into a true mechanism of last resort as it was really meant to be. Acked-by: Ying Xue <[email protected]> Signed-off-by: Jon Maloy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0228824 commit d3b0999

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

net/tipc/link.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2079,8 +2079,12 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb,
20792079
&l->mon_state, l->bearer_id);
20802080

20812081
/* Send NACK if peer has sent pkts we haven't received yet */
2082-
if (more(peers_snd_nxt, rcv_nxt) && !tipc_link_is_synching(l))
2082+
if ((reply || msg_is_keepalive(hdr)) &&
2083+
more(peers_snd_nxt, rcv_nxt) &&
2084+
!tipc_link_is_synching(l) &&
2085+
skb_queue_empty(&l->deferdq))
20832086
rcvgap = peers_snd_nxt - l->rcv_nxt;
2087+
20842088
if (rcvgap || reply)
20852089
tipc_link_build_proto_msg(l, STATE_MSG, 0, reply,
20862090
rcvgap, 0, 0, xmitq);

0 commit comments

Comments
 (0)