aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/link.c
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2011-10-27 14:17:53 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2012-02-06 16:59:18 -0500
commit7a54d4a99dcbbfdf1d4550faa19b615091137953 (patch)
tree34b685bc29547373a43b0f3bd15cf54c07c01971 /net/tipc/link.c
parentb98158e3b36645305363a598d91c544fa31446f1 (diff)
tipc: Major redesign of broadcast link ACK/NACK algorithms
Completely redesigns broadcast link ACK and NACK mechanisms to prevent spurious retransmit requests in dual LAN networks, and to prevent the broadcast link from stalling due to the failure of a receiving node to acknowledge receiving a broadcast message or request its retransmission. Note: These changes only impact the timing of when ACK and NACK messages are sent, and not the basic broadcast link protocol itself, so inter- operability with nodes using the "classic" algorithms is maintained. The revised algorithms are as follows: 1) An explicit ACK message is still sent after receiving 16 in-sequence messages, and implicit ACK information continues to be carried in other unicast link message headers (including link state messages). However, the timing of explicit ACKs is now based on the receiving node's absolute network address rather than its relative network address to ensure that the failure of another node does not delay the ACK beyond its 16 message target. 2) A NACK message is now typically sent only when a message gap persists for two consecutive incoming link state messages; this ensures that a suspected gap is not confirmed until both LANs in a dual LAN network have had an opportunity to deliver the message, thereby preventing spurious NACKs. A NACK message can also be generated by the arrival of a single link state message, if the deferred queue is so big that the current message gap cannot be the result of "normal" mis-ordering due to the use of dual LANs (or one LAN using a bonded interface). Since link state messages typically arrive at different nodes at different times the problem of multiple nodes issuing identical NACKs simultaneously is inherently avoided. 3) Nodes continue to "peek" at NACK messages sent by other nodes. If another node requests retransmission of a message gap suspected (but not yet confirmed) by the peeking node, the peeking node forgets about the gap and does not generate a duplicate retransmit request. (If the peeking node subsequently fails to receive the lost message, later link state messages will cause it to rediscover and confirm the gap and send another NACK.) 4) Message gap "equality" is now determined by the start of the gap only. This is sufficient to deal with the most common cases of message loss, and eliminates the need for complex end of gap computations. 5) A peeking node no longer tries to determine whether it should send a complementary NACK, since the most common cases of message loss don't require it to be sent. Consequently, the node no longer examines the "broadcast tag" field of a NACK message when peeking. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r--net/tipc/link.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 1150ba5a648b..cce953723ddb 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1501,14 +1501,13 @@ static void link_retransmit_failure(struct tipc_link *l_ptr,
1501 tipc_node_lock(n_ptr); 1501 tipc_node_lock(n_ptr);
1502 1502
1503 tipc_addr_string_fill(addr_string, n_ptr->addr); 1503 tipc_addr_string_fill(addr_string, n_ptr->addr);
1504 info("Multicast link info for %s\n", addr_string); 1504 info("Broadcast link info for %s\n", addr_string);
1505 info("Supportable: %d, ", n_ptr->bclink.supportable); 1505 info("Supportable: %d, ", n_ptr->bclink.supportable);
1506 info("Supported: %d, ", n_ptr->bclink.supported); 1506 info("Supported: %d, ", n_ptr->bclink.supported);
1507 info("Acked: %u\n", n_ptr->bclink.acked); 1507 info("Acked: %u\n", n_ptr->bclink.acked);
1508 info("Last in: %u, ", n_ptr->bclink.last_in); 1508 info("Last in: %u, ", n_ptr->bclink.last_in);
1509 info("Gap after: %u, ", n_ptr->bclink.gap_after); 1509 info("Oos state: %u, ", n_ptr->bclink.oos_state);
1510 info("Gap to: %u\n", n_ptr->bclink.gap_to); 1510 info("Last sent: %u\n", n_ptr->bclink.last_sent);
1511 info("Nack sync: %u\n\n", n_ptr->bclink.nack_sync);
1512 1511
1513 tipc_k_signal((Handler)link_reset_all, (unsigned long)n_ptr->addr); 1512 tipc_k_signal((Handler)link_reset_all, (unsigned long)n_ptr->addr);
1514 1513
@@ -1974,7 +1973,7 @@ void tipc_link_send_proto_msg(struct tipc_link *l_ptr, u32 msg_typ,
1974 1973
1975 msg_set_type(msg, msg_typ); 1974 msg_set_type(msg, msg_typ);
1976 msg_set_net_plane(msg, l_ptr->b_ptr->net_plane); 1975 msg_set_net_plane(msg, l_ptr->b_ptr->net_plane);
1977 msg_set_bcast_ack(msg, mod(l_ptr->owner->bclink.last_in)); 1976 msg_set_bcast_ack(msg, l_ptr->owner->bclink.last_in);
1978 msg_set_last_bcast(msg, tipc_bclink_get_last_sent()); 1977 msg_set_last_bcast(msg, tipc_bclink_get_last_sent());
1979 1978
1980 if (msg_typ == STATE_MSG) { 1979 if (msg_typ == STATE_MSG) {
@@ -2133,8 +2132,12 @@ static void link_recv_proto_msg(struct tipc_link *l_ptr, struct sk_buff *buf)
2133 2132
2134 /* Synchronize broadcast link info, if not done previously */ 2133 /* Synchronize broadcast link info, if not done previously */
2135 2134
2136 if (!tipc_node_is_up(l_ptr->owner)) 2135 if (!tipc_node_is_up(l_ptr->owner)) {
2137 l_ptr->owner->bclink.last_in = msg_last_bcast(msg); 2136 l_ptr->owner->bclink.last_sent =
2137 l_ptr->owner->bclink.last_in =
2138 msg_last_bcast(msg);
2139 l_ptr->owner->bclink.oos_state = 0;
2140 }
2138 2141
2139 l_ptr->peer_session = msg_session(msg); 2142 l_ptr->peer_session = msg_session(msg);
2140 l_ptr->peer_bearer_id = msg_bearer_id(msg); 2143 l_ptr->peer_bearer_id = msg_bearer_id(msg);
@@ -2181,7 +2184,9 @@ static void link_recv_proto_msg(struct tipc_link *l_ptr, struct sk_buff *buf)
2181 2184
2182 /* Protocol message before retransmits, reduce loss risk */ 2185 /* Protocol message before retransmits, reduce loss risk */
2183 2186
2184 tipc_bclink_check_gap(l_ptr->owner, msg_last_bcast(msg)); 2187 if (l_ptr->owner->bclink.supported)
2188 tipc_bclink_update_link_state(l_ptr->owner,
2189 msg_last_bcast(msg));
2185 2190
2186 if (rec_gap || (msg_probe(msg))) { 2191 if (rec_gap || (msg_probe(msg))) {
2187 tipc_link_send_proto_msg(l_ptr, STATE_MSG, 2192 tipc_link_send_proto_msg(l_ptr, STATE_MSG,