aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/node.h
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2014-08-22 18:09:08 -0400
committerDavid S. Miller <davem@davemloft.net>2014-08-23 14:18:33 -0400
commit02be61a981fb5ca5f1526323336198ee92cadf95 (patch)
tree2cd5f3dc25025a071ab2806b2e10981851b21bc5 /net/tipc/node.h
parent50100a5e39461b2a61d6040e73c384766c29975d (diff)
tipc: use message to abort connections when losing contact to node
In the current implementation, each 'struct tipc_node' instance keeps a linked list of those ports/sockets that are connected to the node represented by that struct. The purpose of this is to let the node object know which sockets to alert when it loses contact with its peer node, i.e., which sockets need to have their connections aborted. This entails an unwanted direct reference from the node structure back to the port/socket structure, and a need to grab port_lock when we have to make an upcall to the port. We want to get rid of this unecessary BH entry point into the socket, and also eliminate its use of port_lock. In this commit, we instead let the node struct keep list of "connected socket" structs, which each represents a connected socket, but is allocated independently by the node at the moment of connection. If the node loses contact with its peer node, the list is traversed, and a "connection abort" message is created for each entry in the list. The message is sent to it respective connected socket using the ordinary data path, and the receiving socket aborts its connections upon reception of the message. This enables us to get rid of the direct reference from 'struct node' to ´struct port', and another unwanted BH access point to the latter. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Reviewed-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/node.h')
-rw-r--r--net/tipc/node.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/tipc/node.h b/net/tipc/node.h
index 2ebf9e8b50fd..522d6f3157b3 100644
--- a/net/tipc/node.h
+++ b/net/tipc/node.h
@@ -117,6 +117,7 @@ struct tipc_node {
117 u32 signature; 117 u32 signature;
118 struct list_head nsub; 118 struct list_head nsub;
119 struct sk_buff_head waiting_sks; 119 struct sk_buff_head waiting_sks;
120 struct list_head conn_sks;
120 struct rcu_head rcu; 121 struct rcu_head rcu;
121}; 122};
122 123
@@ -135,6 +136,8 @@ struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space)
135struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space); 136struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space);
136int tipc_node_get_linkname(u32 bearer_id, u32 node, char *linkname, size_t len); 137int tipc_node_get_linkname(u32 bearer_id, u32 node, char *linkname, size_t len);
137void tipc_node_unlock(struct tipc_node *node); 138void tipc_node_unlock(struct tipc_node *node);
139int tipc_node_add_conn(u32 dnode, u32 port, u32 peer_port);
140void tipc_node_remove_conn(u32 dnode, u32 port);
138 141
139static inline void tipc_node_lock(struct tipc_node *node) 142static inline void tipc_node_lock(struct tipc_node *node)
140{ 143{