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

tipc: simplify link timer handling

Prior to this commit, the link timer has been running at a "continuity
interval" of configured link tolerance/4. When a timer wakes up and
discovers that there has been no sign of life from the peer during the
previous interval, it divides its own timer interval by another factor
four, and starts sending one probe per new interval. When the configured
link tolerance time has passed without answer, i.e. after 16 unacked
probes, the link is declared faulty and reset.

This is unnecessary complex. It is sufficient to continue with the
original continuity interval, and instead reset the link after four
missed probe responses. This makes the timer handling in the link
simpler, and opens up for some planned later changes in this area.
This commit implements this change.

Reviewed-by: Richard Alpe <richard.alpe@ericsson.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-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 Paul Maloy and committed by
David S. Miller
75b44b01 b1c29f6b

+3 -3
+3 -3
net/tipc/link.c
··· 528 528 l_ptr->fsm_msg_cnt = 0; 529 529 tipc_link_proto_xmit(l_ptr, STATE_MSG, 1, 0, 0, 0); 530 530 l_ptr->fsm_msg_cnt++; 531 - link_set_timer(l_ptr, cont_intv / 4); 531 + link_set_timer(l_ptr, cont_intv); 532 532 break; 533 533 case RESET_MSG: 534 534 pr_debug("%s<%s>, requested by peer\n", ··· 579 579 tipc_link_proto_xmit(l_ptr, STATE_MSG, 580 580 1, 0, 0, 0); 581 581 l_ptr->fsm_msg_cnt++; 582 - link_set_timer(l_ptr, cont_intv / 4); 582 + link_set_timer(l_ptr, cont_intv); 583 583 } else { /* Link has failed */ 584 584 pr_debug("%s<%s>, peer not responding\n", 585 585 link_rst_msg, l_ptr->name); ··· 1725 1725 1726 1726 l_ptr->tolerance = tol; 1727 1727 l_ptr->cont_intv = msecs_to_jiffies(intv); 1728 - l_ptr->abort_limit = tol / (jiffies_to_msecs(l_ptr->cont_intv) / 4); 1728 + l_ptr->abort_limit = tol / (jiffies_to_msecs(l_ptr->cont_intv)); 1729 1729 } 1730 1730 1731 1731 void tipc_link_set_queue_limits(struct tipc_link *l, u32 win)