• Ralph Campbell's avatar
    IB/core: Fix handling of multicast response failures · 57cb61d5
    Ralph Campbell authored
    I was looking at the code for multicast.c and noticed that
    ib_sa_join_multicast() calls queue_join() which puts the
    request at the front of the group->pending_list.  If this
    is a second request, it seems like it would interfere with
    process_join_error() since group->last_join won't point
    to the member at the head of the pending_list. The sequence
    would thus be:
    
    1. ib_sa_join_multicast()
       puts member1 on head of pending_list and starts work thread
    2. mcast_work_handler()
       calls send_join() which sets group->last_join to member1
    3. ib_sa_join_multicast()
       puts member2 on head of pending_list
    4. join operation for member1 receives failures response from SA.
    5. join_handler() is called with error status
    6. process_join_error() fails to process member1 since
       it doesn't match the first entry in the group->pending_list.
    
    The impact is that the failed join request is tossed.  The second
    request is processed, and after it completes, the original request ends
    up being retried.
    
    This change also results in join requests being processed in FIFO
    order.
    Signed-off-by: default avatarRalph Campbell <ralph.campbell@qlogic.com>
    Signed-off-by: default avatarSean Hefty <sean.hefty@intel.com>
    Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
    57cb61d5
multicast.c 21 KB