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

tipc: simplify stale link failure criteria

In commit a4dc70d46cf1 ("tipc: extend link reset criteria for stale
packet retransmission") we made link retransmission failure events
dependent on the link tolerance, and not only of the number of failed
retransmission attempts, as we did earlier. This works well. However,
keeping the original, additional criteria of 99 failed retransmissions
is now redundant, and may in some cases lead to failure detection
times in the order of minutes instead of the expected 1.5 sec link
tolerance value.

We now remove this criteria altogether.

Acked-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 Maloy and committed by
David S. Miller
77cf8edb 489ce2f4

+2 -7
+2 -7
net/tipc/link.c
··· 107 107 * @backlogq: queue for messages waiting to be sent 108 108 * @snt_nxt: next sequence number to use for outbound messages 109 109 * @prev_from: sequence number of most previous retransmission request 110 - * @stale_cnt: counter for number of identical retransmit attempts 111 110 * @stale_limit: time when repeated identical retransmits must force link reset 112 111 * @ackers: # of peers that needs to ack each packet before it can be released 113 112 * @acked: # last packet acked by a certain peer. Used for broadcast. ··· 166 167 u16 snd_nxt; 167 168 u16 prev_from; 168 169 u16 window; 169 - u16 stale_cnt; 170 170 unsigned long stale_limit; 171 171 172 172 /* Reception */ ··· 908 910 l->acked = 0; 909 911 l->silent_intv_cnt = 0; 910 912 l->rst_cnt = 0; 911 - l->stale_cnt = 0; 912 913 l->bc_peer_is_up = false; 913 914 memset(&l->mon_state, 0, sizeof(l->mon_state)); 914 915 tipc_link_reset_stats(l); ··· 1065 1068 if (r->prev_from != from) { 1066 1069 r->prev_from = from; 1067 1070 r->stale_limit = jiffies + msecs_to_jiffies(r->tolerance); 1068 - r->stale_cnt = 0; 1069 - } else if (++r->stale_cnt > 99 && time_after(jiffies, r->stale_limit)) { 1071 + } else if (time_after(jiffies, r->stale_limit)) { 1070 1072 pr_warn("Retransmission failure on link <%s>\n", l->name); 1071 1073 link_print(l, "State of link "); 1072 1074 pr_info("Failed msg: usr %u, typ %u, len %u, err %u\n", ··· 1511 1515 1512 1516 /* Forward queues and wake up waiting users */ 1513 1517 if (likely(tipc_link_release_pkts(l, msg_ack(hdr)))) { 1514 - l->stale_cnt = 0; 1515 1518 tipc_link_advance_backlog(l, xmitq); 1516 1519 if (unlikely(!skb_queue_empty(&l->wakeupq))) 1517 1520 link_prepare_wakeup(l); ··· 2579 2584 i += scnprintf(buf + i, sz - i, " %u", l->silent_intv_cnt); 2580 2585 i += scnprintf(buf + i, sz - i, " %u", l->rst_cnt); 2581 2586 i += scnprintf(buf + i, sz - i, " %u", l->prev_from); 2582 - i += scnprintf(buf + i, sz - i, " %u", l->stale_cnt); 2587 + i += scnprintf(buf + i, sz - i, " %u", 0); 2583 2588 i += scnprintf(buf + i, sz - i, " %u", l->acked); 2584 2589 2585 2590 list = &l->transmq;