• Jon Maloy's avatar
    tipc: send out join messages as soon as new member is discovered · d12d2e12
    Jon Maloy authored
    When a socket is joining a group, we look up in the binding table to
    find if there are already other members of the group present. This is
    used for being able to return EAGAIN instead of EHOSTUNREACH if the
    user proceeds directly to a send attempt.
    
    However, the information in the binding table can be used to directly
    set the created member in state MBR_PUBLISHED and send a JOIN message
    to the peer, instead of waiting for a topology PUBLISH event to do this.
    When there are many members in a group, the propagation time for such
    events can be significant, and we can save time during the join
    operation if we use the initial lookup result fully.
    
    In this commit, we eliminate the member state MBR_DISCOVERED which has
    been the result of the initial lookup, and do instead go directly to
    MBR_PUBLISHED, which initiates the setup.
    
    After this change, the tipc_member FSM looks as follows:
    
         +-----------+
    ---->| PUBLISHED |-----------------------------------------------+
    PUB- +-----------+                                 LEAVE/WITHRAW |
    LISH       |JOIN                                                 |
               |     +-------------------------------------------+   |
               |     |                            LEAVE/WITHDRAW |   |
               |     |                +------------+             |   |
               |     |   +----------->|  PENDING   |---------+   |   |
               |     |   |msg/maxactv +-+---+------+  LEAVE/ |   |   |
               |     |   |              |   |       WITHDRAW |   |   |
               |     |   |   +----------+   |                |   |   |
               |     |   |   |revert/maxactv|                |   |   |
               |     |   |   V              V                V   V   V
               |   +----------+  msg  +------------+       +-----------+
               +-->|  JOINED  |------>|   ACTIVE   |------>|  LEAVING  |--->
               |   +----------+       +--- -+------+ LEAVE/+-----------+DOWN
               |        A   A               |      WITHDRAW A   A    A   EVT
               |        |   |               |RECLAIM        |   |    |
               |        |   |REMIT          V               |   |    |
               |        |   |== adv   +------------+        |   |    |
               |        |   +---------| RECLAIMING |--------+   |    |
               |        |             +-----+------+  LEAVE/    |    |
               |        |                   |REMIT   WITHDRAW   |    |
               |        |                   |< adv              |    |
               |        |msg/               V            LEAVE/ |    |
               |        |adv==ADV_IDLE+------------+   WITHDRAW |    |
               |        +-------------|  REMITTED  |------------+    |
               |                      +------------+                 |
               |PUBLISH                                              |
    JOIN +-----------+                                LEAVE/WITHDRAW |
    ---->|  JOINING  |-----------------------------------------------+
         +-----------+
    Acked-by: default avatarYing Xue <ying.xue@windriver.com>
    Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    d12d2e12
socket.c 86 KB