aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/node.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/node.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/node.h')
-rw-r--r--net/tipc/node.h31
1 files changed, 3 insertions, 28 deletions
diff --git a/net/tipc/node.h b/net/tipc/node.h
index 65e2728f66a6..406c6fe0dbb2 100644
--- a/net/tipc/node.h
+++ b/net/tipc/node.h
@@ -47,33 +47,7 @@
47 47
48#define INVALID_BEARER_ID -1 48#define INVALID_BEARER_ID -1
49 49
50/* Node FSM states and events:
51 */
52enum {
53 SELF_DOWN_PEER_DOWN = 0xdd,
54 SELF_UP_PEER_UP = 0xaa,
55 SELF_DOWN_PEER_LEAVING = 0xd1,
56 SELF_UP_PEER_COMING = 0xac,
57 SELF_COMING_PEER_UP = 0xca,
58 SELF_LEAVING_PEER_DOWN = 0x1d,
59 NODE_FAILINGOVER = 0xf0,
60 NODE_SYNCHING = 0xcc
61};
62
63enum {
64 SELF_ESTABL_CONTACT_EVT = 0xece,
65 SELF_LOST_CONTACT_EVT = 0x1ce,
66 PEER_ESTABL_CONTACT_EVT = 0xfece,
67 PEER_LOST_CONTACT_EVT = 0xf1ce,
68 NODE_FAILOVER_BEGIN_EVT = 0xfbe,
69 NODE_FAILOVER_END_EVT = 0xfee,
70 NODE_SYNCH_BEGIN_EVT = 0xcbe,
71 NODE_SYNCH_END_EVT = 0xcee
72};
73
74/* Flags used to take different actions according to flag type 50/* Flags used to take different actions according to flag type
75 * TIPC_WAIT_PEER_LINKS_DOWN: wait to see that peer's links are down
76 * TIPC_WAIT_OWN_LINKS_DOWN: wait until peer node is declared down
77 * TIPC_NOTIFY_NODE_DOWN: notify node is down 51 * TIPC_NOTIFY_NODE_DOWN: notify node is down
78 * TIPC_NOTIFY_NODE_UP: notify node is up 52 * TIPC_NOTIFY_NODE_UP: notify node is up
79 * TIPC_DISTRIBUTE_NAME: publish or withdraw link state name type 53 * TIPC_DISTRIBUTE_NAME: publish or withdraw link state name type
@@ -133,6 +107,8 @@ struct tipc_link_entry {
133 * @links: array containing references to all links to node 107 * @links: array containing references to all links to node
134 * @action_flags: bit mask of different types of node actions 108 * @action_flags: bit mask of different types of node actions
135 * @bclink: broadcast-related info 109 * @bclink: broadcast-related info
110 * @state: connectivity state vs peer node
111 * @sync_point: sequence number where synch/failover is finished
136 * @list: links to adjacent nodes in sorted list of cluster's nodes 112 * @list: links to adjacent nodes in sorted list of cluster's nodes
137 * @working_links: number of working links to node (both active and standby) 113 * @working_links: number of working links to node (both active and standby)
138 * @link_cnt: number of links to node 114 * @link_cnt: number of links to node
@@ -156,6 +132,7 @@ struct tipc_node {
156 struct tipc_node_bclink bclink; 132 struct tipc_node_bclink bclink;
157 struct list_head list; 133 struct list_head list;
158 int state; 134 int state;
135 u16 sync_point;
159 int link_cnt; 136 int link_cnt;
160 u16 working_links; 137 u16 working_links;
161 u16 capabilities; 138 u16 capabilities;
@@ -180,8 +157,6 @@ bool tipc_node_update_dest(struct tipc_node *n, struct tipc_bearer *bearer,
180void tipc_node_delete_links(struct net *net, int bearer_id); 157void tipc_node_delete_links(struct net *net, int bearer_id);
181void tipc_node_attach_link(struct tipc_node *n_ptr, struct tipc_link *l_ptr); 158void tipc_node_attach_link(struct tipc_node *n_ptr, struct tipc_link *l_ptr);
182void tipc_node_detach_link(struct tipc_node *n_ptr, struct tipc_link *l_ptr); 159void tipc_node_detach_link(struct tipc_node *n_ptr, struct tipc_link *l_ptr);
183void tipc_node_link_down(struct tipc_node *n_ptr, int bearer_id);
184void tipc_node_link_up(struct tipc_node *n_ptr, int bearer_id);
185bool tipc_node_is_up(struct tipc_node *n); 160bool tipc_node_is_up(struct tipc_node *n);
186int tipc_node_get_linkname(struct net *net, u32 bearer_id, u32 node, 161int tipc_node_get_linkname(struct net *net, u32 bearer_id, u32 node,
187 char *linkname, size_t len); 162 char *linkname, size_t len);