summaryrefslogtreecommitdiffstats
path: root/net/tipc/msg.h
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2015-07-30 18:24:19 -0400
committerDavid S. Miller <davem@davemloft.net>2015-07-30 20:25:14 -0400
commit6e498158a827fd515b514842e9a06bdf0f75ab86 (patch)
tree0f9312078445c1bd7d2ed669c564ca6c7a330764 /net/tipc/msg.h
parent66996b6c47ed7f6bbb01a768e23fae262c7db8e0 (diff)
tipc: move link synch and failover to link aggregation level
Link failover and synchronization have until now been handled by the links themselves, forcing them to have knowledge about and to access parallel links in order to make the two algorithms work correctly. In this commit, we move the control part of this functionality to the link aggregation level in node.c, which is the right location for this. As a result, the two algorithms become easier to follow, and the link implementation becomes simpler. Tested-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>
Diffstat (limited to 'net/tipc/msg.h')
-rw-r--r--net/tipc/msg.h32
1 files changed, 11 insertions, 21 deletions
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index 234fb0531d1d..115bb2aa6bed 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -110,7 +110,6 @@ struct tipc_skb_cb {
110 struct sk_buff *tail; 110 struct sk_buff *tail;
111 bool validated; 111 bool validated;
112 bool wakeup_pending; 112 bool wakeup_pending;
113 bool bundling;
114 u16 chain_sz; 113 u16 chain_sz;
115 u16 chain_imp; 114 u16 chain_imp;
116}; 115};
@@ -559,15 +558,6 @@ static inline void msg_set_node_capabilities(struct tipc_msg *m, u32 n)
559 msg_set_bits(m, 1, 15, 0x1fff, n); 558 msg_set_bits(m, 1, 15, 0x1fff, n);
560} 559}
561 560
562static inline bool msg_dup(struct tipc_msg *m)
563{
564 if (likely(msg_user(m) != TUNNEL_PROTOCOL))
565 return false;
566 if (msg_type(m) != SYNCH_MSG)
567 return false;
568 return true;
569}
570
571/* 561/*
572 * Word 2 562 * Word 2
573 */ 563 */
@@ -621,12 +611,12 @@ static inline void msg_set_fragm_no(struct tipc_msg *m, u32 n)
621} 611}
622 612
623 613
624static inline u32 msg_next_sent(struct tipc_msg *m) 614static inline u16 msg_next_sent(struct tipc_msg *m)
625{ 615{
626 return msg_bits(m, 4, 0, 0xffff); 616 return msg_bits(m, 4, 0, 0xffff);
627} 617}
628 618
629static inline void msg_set_next_sent(struct tipc_msg *m, u32 n) 619static inline void msg_set_next_sent(struct tipc_msg *m, u16 n)
630{ 620{
631 msg_set_bits(m, 4, 0, 0xffff, n); 621 msg_set_bits(m, 4, 0, 0xffff, n);
632} 622}
@@ -727,12 +717,12 @@ static inline char *msg_media_addr(struct tipc_msg *m)
727/* 717/*
728 * Word 9 718 * Word 9
729 */ 719 */
730static inline u32 msg_msgcnt(struct tipc_msg *m) 720static inline u16 msg_msgcnt(struct tipc_msg *m)
731{ 721{
732 return msg_bits(m, 9, 16, 0xffff); 722 return msg_bits(m, 9, 16, 0xffff);
733} 723}
734 724
735static inline void msg_set_msgcnt(struct tipc_msg *m, u32 n) 725static inline void msg_set_msgcnt(struct tipc_msg *m, u16 n)
736{ 726{
737 msg_set_bits(m, 9, 16, 0xffff, n); 727 msg_set_bits(m, 9, 16, 0xffff, n);
738} 728}
@@ -767,19 +757,19 @@ static inline void msg_set_link_tolerance(struct tipc_msg *m, u32 n)
767 msg_set_bits(m, 9, 0, 0xffff, n); 757 msg_set_bits(m, 9, 0, 0xffff, n);
768} 758}
769 759
770static inline bool msg_is_traffic(struct tipc_msg *m) 760static inline bool msg_peer_link_is_up(struct tipc_msg *m)
771{ 761{
772 if (likely(msg_user(m) != LINK_PROTOCOL)) 762 if (likely(msg_user(m) != LINK_PROTOCOL))
773 return true; 763 return true;
774 if ((msg_type(m) == RESET_MSG) || (msg_type(m) == ACTIVATE_MSG)) 764 if (msg_type(m) == STATE_MSG)
775 return false; 765 return true;
776 return true; 766 return false;
777} 767}
778 768
779static inline bool msg_peer_is_up(struct tipc_msg *m) 769static inline bool msg_peer_node_is_up(struct tipc_msg *m)
780{ 770{
781 if (likely(msg_is_traffic(m))) 771 if (msg_peer_link_is_up(m))
782 return false; 772 return true;
783 return msg_redundant_link(m); 773 return msg_redundant_link(m);
784} 774}
785 775