• J
    tipc: use message to abort connections when losing contact to node · 02be61a9
    Jon Paul Maloy 提交于
    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: NJon Maloy <jon.maloy@ericsson.com>
    Reviewed-by: NErik Hugne <erik.hugne@ericsson.com>
    Reviewed-by: NYing Xue <ying.xue@windriver.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    02be61a9
node.c 15.4 KB