diff options
author | Jon Paul Maloy <jon.maloy@ericsson.com> | 2015-03-25 12:07:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-25 14:05:56 -0400 |
commit | 8b4ed8634f8b3f9aacfc42b4a872d30c36b9e255 (patch) | |
tree | a53fedc6a39f617600e4aebf4957d67195d7a37a /net/tipc/msg.h | |
parent | 3127a0200d4a46cf279bb388cc0f71827cd60699 (diff) | |
download | linux-stable-8b4ed8634f8b3f9aacfc42b4a872d30c36b9e255.tar.gz linux-stable-8b4ed8634f8b3f9aacfc42b4a872d30c36b9e255.tar.bz2 linux-stable-8b4ed8634f8b3f9aacfc42b4a872d30c36b9e255.zip |
tipc: eliminate race condition at dual link establishment
Despite recent improvements, the establishment of dual parallel
links still has a small glitch where messages can bypass each
other. When the second link in a dual-link configuration is
established, part of the first link's traffic will be steered over
to the new link. Although we do have a mechanism to ensure that
packets sent before and after the establishment of the new link
arrive in sequence to the destination node, this is not enough.
The arriving messages will still be delivered upwards in different
threads, something entailing a risk of message disordering during
the transition phase.
To fix this, we introduce a synchronization mechanism between the
two parallel links, so that traffic arriving on the new link cannot
be added to its input queue until we are guaranteed that all
pre-establishment messages have been delivered on the old, parallel
link.
This problem seems to always have been around, but its occurrence is
so rare that it has not been noticed until recent intensive testing.
Reviewed-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/msg.h')
-rw-r--r-- | net/tipc/msg.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/tipc/msg.h b/net/tipc/msg.h index 6445db09c0c4..d273207ede28 100644 --- a/net/tipc/msg.h +++ b/net/tipc/msg.h @@ -554,6 +554,14 @@ static inline void msg_set_node_capabilities(struct tipc_msg *m, u32 n) msg_set_bits(m, 1, 15, 0x1fff, n); } +static inline bool msg_dup(struct tipc_msg *m) +{ + if (likely(msg_user(m) != CHANGEOVER_PROTOCOL)) + return false; + if (msg_type(m) != DUPLICATE_MSG) + return false; + return true; +} /* * Word 2 |