tipc: simplify link supervision checkpointing
authorJon Paul Maloy <jon.maloy@ericsson.com>
Thu, 14 May 2015 14:46:16 +0000 (10:46 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 14 May 2015 16:24:46 +0000 (12:24 -0400)
commitcd4eee3c2e3e01590df5cada0d56b396dd726d05
tree0c9475e8f7be10e84a3a52357685bf7657e4ecda
parenta97b9d3fa9bce0d78dc83a14a9e1ebb3bf5cc414
tipc: simplify link supervision checkpointing

We change the sequence number checkpointing that is performed
by the timer in order to discover if the peer is active. Currently,
we store a checkpoint of the next expected sequence number "rcv_nxt"
at each timer expiration, and compare it to the current expected
number at next timeout expiration. Instead, we now use the already
existing field "silent_intv_cnt" for this task. We step the counter
at each timeout expiration, and zero it at each valid received packet.
If no valid packet has been received from the peer after "abort_limit"
number of silent timer intervals, the link is declared faulty and reset.

We also remove the multiple instances of timer activation from inside
the FSM function "link_state_event()", and now do it at only one place;
at the end of the timer function itself.

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>
net/tipc/link.c
net/tipc/link.h