• Hariprasad S's avatar
    RDMA/iw_cxgb4: atomically lookup ep and get a reference · 944661dd
    Hariprasad S authored
    There is a race between ULP threads calling c4iw_ep_disconnect() via
    c4iw_modify_rc_qp() and the ingress CPL thread where the ULP thread
    can free the endpoint just after the ingress CPL thread finds the ep
    pointer in the tid table.  To avoid this, we now use the hwtid_idr table
    for lookups instead of the LLD tid table so we can lock around insert,
    remove, and lookup+get_ep to avoid the race.  The CPL handlers now will
    either find the ep ptr and have a ref on it, or not find it and they
    can discard the CPL.  Callers of get_ep_from_tid() will have a ref
    on the ep if found, and thus must deref when they are done.
    Negative advice in peer_abort_intr() need to dereference the ep.
    therefore peer_abort() is scheduled to dereference the ep later.
    Signed-off-by: default avatarSteve Wise <swise@opengridcomputing.com>
    Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
    Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
    944661dd
cm.c 115 KB