]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
RDMA/iw_cxgb4: atomically lookup ep and get a reference
authorHariprasad S <hariprasad@chelsio.com>
Fri, 6 May 2016 16:48:03 +0000 (22:18 +0530)
committerDoug Ledford <dledford@redhat.com>
Fri, 13 May 2016 23:38:08 +0000 (19:38 -0400)
commit944661dd97f4f257cd914fffec7eb80832ff9141
tree43010858762fa5b904579bb271a2b6b8d5bf6620
parent761e19a504afa55ec0ede0ed490cddb99b2596a5
RDMA/iw_cxgb4: atomically lookup ep and get a reference

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: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/cxgb4/cm.c