Skip to content

Commit 77cf8ed

Browse files
Jon Maloydavem330
authored andcommitted
tipc: simplify stale link failure criteria
In commit a4dc70d ("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>
1 parent 489ce2f commit 77cf8ed

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

‎net/tipc/link.c‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ struct tipc_stats {
107107
* @backlogq: queue for messages waiting to be sent
108108
* @snt_nxt: next sequence number to use for outbound messages
109109
* @prev_from: sequence number of most previous retransmission request
110-
* @stale_cnt: counter for number of identical retransmit attempts
111110
* @stale_limit: time when repeated identical retransmits must force link reset
112111
* @ackers: # of peers that needs to ack each packet before it can be released
113112
* @acked: # last packet acked by a certain peer. Used for broadcast.
@@ -167,7 +166,6 @@ struct tipc_link {
167166
u16 snd_nxt;
168167
u16 prev_from;
169168
u16 window;
170-
u16 stale_cnt;
171169
unsigned long stale_limit;
172170

173171
/* Reception */
@@ -910,7 +908,6 @@ void tipc_link_reset(struct tipc_link *l)
910908
l->acked = 0;
911909
l->silent_intv_cnt = 0;
912910
l->rst_cnt = 0;
913-
l->stale_cnt = 0;
914911
l->bc_peer_is_up = false;
915912
memset(&l->mon_state, 0, sizeof(l->mon_state));
916913
tipc_link_reset_stats(l);
@@ -1068,8 +1065,7 @@ static bool link_retransmit_failure(struct tipc_link *l, struct tipc_link *r,
10681065
if (r->prev_from != from) {
10691066
r->prev_from = from;
10701067
r->stale_limit = jiffies + msecs_to_jiffies(r->tolerance);
1071-
r->stale_cnt = 0;
1072-
} else if (++r->stale_cnt > 99 && time_after(jiffies, r->stale_limit)) {
1068+
} else if (time_after(jiffies, r->stale_limit)) {
10731069
pr_warn("Retransmission failure on link <%s>\n", l->name);
10741070
link_print(l, "State of link ");
10751071
pr_info("Failed msg: usr %u, typ %u, len %u, err %u\n",
@@ -1515,7 +1511,6 @@ int tipc_link_rcv(struct tipc_link *l, struct sk_buff *skb,
15151511

15161512
/* Forward queues and wake up waiting users */
15171513
if (likely(tipc_link_release_pkts(l, msg_ack(hdr)))) {
1518-
l->stale_cnt = 0;
15191514
tipc_link_advance_backlog(l, xmitq);
15201515
if (unlikely(!skb_queue_empty(&l->wakeupq)))
15211516
link_prepare_wakeup(l);
@@ -2584,7 +2579,7 @@ int tipc_link_dump(struct tipc_link *l, u16 dqueues, char *buf)
25842579
i += scnprintf(buf + i, sz - i, " %u", l->silent_intv_cnt);
25852580
i += scnprintf(buf + i, sz - i, " %u", l->rst_cnt);
25862581
i += scnprintf(buf + i, sz - i, " %u", l->prev_from);
2587-
i += scnprintf(buf + i, sz - i, " %u", l->stale_cnt);
2582+
i += scnprintf(buf + i, sz - i, " %u", 0);
25882583
i += scnprintf(buf + i, sz - i, " %u", l->acked);
25892584

25902585
list = &l->transmq;

0 commit comments

Comments
 (0)