Skip to contentSkip to conversation

tipc: initialize broadcast link stale counter correctly

PATCH Applied Jon Maloy 3 participants 3 messages Oct 12, 2018 – Oct 16, 2018

Subsystems (3)
lore
Share & tools
lore
Acked-by on v1 1/1
#1 lore raw
In reply to Jon Maloy
Quoted 19 lines · Jon Maloy

In the commit referred to below we added link tolerance as an additional criteria for declaring broadcast transmission "stale" and resetting the unicast links to the affected node.

Unfortunately, this 'improvement' introduced two bugs, which each and one alone cause only limited problems, but combined lead to seemingly stochastic unicast link resets, depending on the amount of broadcast traffic transmitted.

The first issue, a missing initialization of the 'tolerance' field of the receiver broadcast link, was recently fixed by commit 047491ea334a ("tipc: set link tolerance correctly in broadcast link").

Ths second issue, where we omit to reset the 'stale_cnt' field of the same link after a 'stale' period is over, leads to this counter accumulating over time, and in the absence of the 'tolerance' criteria leads to the above described symptoms. This commit adds the missing initialization.

Quoted 4 lines
Fixes a4dc70d46cf1 ("tipc: extend link reset criteria for stale packet

retransmission")

Quoted 17 lines
---
 net/tipc/link.c | 1 +
 1 file changed, 1 insertion(+)
net/tipc/link.c +1 -0
index f6552e4..201c3b5 100644
@@ -1041,6 +1041,7 @@ static int tipc_link_retrans(struct tipc_link *l, struct tipc_link *r,
 	if (r->last_retransm != buf_seqno(skb)) {
 		r->last_retransm = buf_seqno(skb);
 		r->stale_limit = jiffies + msecs_to_jiffies(r->tolerance);
+		r->stale_cnt = 0;
 	} else if (++r->stale_cnt > 99 && time_after(jiffies, r->stale_limit)) {
 		link_retransmit_failure(l, skb);
 		if (link_is_bc_sndlink(l))

Jon Maloy

author
#0 lore raw

PATCH 1/1 tipc: initialize broadcast link stale counter correctly

In the commit referred to below we added link tolerance as an additional criteria for declaring broadcast transmission "stale" and resetting the unicast links to the affected node.

Unfortunately, this 'improvement' introduced two bugs, which each and one alone cause only limited problems, but combined lead to seemingly stochastic unicast link resets, depending on the amount of broadcast traffic transmitted.

The first issue, a missing initialization of the 'tolerance' field of the receiver broadcast link, was recently fixed by commit 047491ea334a ("tipc: set link tolerance correctly in broadcast link").

Ths second issue, where we omit to reset the 'stale_cnt' field of the same link after a 'stale' period is over, leads to this counter accumulating over time, and in the absence of the 'tolerance' criteria leads to the above described symptoms. This commit adds the missing initialization.

Fixes a4dc70d46cf1 ("tipc: extend link reset criteria for stale packet

retransmission")

---
 net/tipc/link.c | 1 +
 1 file changed, 1 insertion(+)
net/tipc/link.c +1 -0
index f6552e4..201c3b5 100644
@@ -1041,6 +1041,7 @@ static int tipc_link_retrans(struct tipc_link *l, struct tipc_link *r,
 	if (r->last_retransm != buf_seqno(skb)) {
 		r->last_retransm = buf_seqno(skb);
 		r->stale_limit = jiffies + msecs_to_jiffies(r->tolerance);
+		r->stale_cnt = 0;
 	} else if (++r->stale_cnt > 99 && time_after(jiffies, r->stale_limit)) {
 		link_retransmit_failure(l, skb);
 		if (link_is_bc_sndlink(l))
Signature · 1 line
2.1.4
maintainer Applied
#2 lore raw

From: Jon Maloy <[email protected]>
Date: Thu, 11 Oct 2018 22:02:29 +0200

Quoted 19 lines

In the commit referred to below we added link tolerance as an additional criteria for declaring broadcast transmission "stale" and resetting the unicast links to the affected node.

Unfortunately, this 'improvement' introduced two bugs, which each and one alone cause only limited problems, but combined lead to seemingly stochastic unicast link resets, depending on the amount of broadcast traffic transmitted.

The first issue, a missing initialization of the 'tolerance' field of the receiver broadcast link, was recently fixed by commit 047491ea334a ("tipc: set link tolerance correctly in broadcast link").

Ths second issue, where we omit to reset the 'stale_cnt' field of the same link after a 'stale' period is over, leads to this counter accumulating over time, and in the absence of the 'tolerance' criteria leads to the above described symptoms. This commit adds the missing initialization.

Quoted 4 lines
Fixes a4dc70d46cf1 ("tipc: extend link reset criteria for stale packet

retransmission")

Applied, thanks Jon.

In the future, please always make your Fixes: tag one single line no matter how long it is. And also do not separate it from other tags like the signoff with empty lines. All of the tags should be collected together without any empty lines in between.

Thank you.