]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r314400:
authornp <np@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 3 Mar 2017 17:57:17 +0000 (17:57 +0000)
committernp <np@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 3 Mar 2017 17:57:17 +0000 (17:57 +0000)
commit925c92d2ed77a30186f5e00d3210991256166735
tree16489c94ef440065e40693743a78af535b5bc3a9
parent31d666e3341e511c3d579db5e1d899e90ed75876
MFC r314400:

cxgbe/iw_cxgbe: fix various double-close panics with iWARP sockets.

Sockets representing the TCP endpoints for iWARP connections are
allocated by the ibcore module.  Before this revision they were closed
either by the ibcore module or the iw_cxgbe hardware driver depending on
the state transitions during connection teardown.  This is error prone
and there were cases where both iw_cxgbe and ibcore closed the socket
leading to double-free panics.  The fix is to let ibcore close the
sockets it creates and never do it in the driver.

- Use sodisconnect instead of soclose (preceded by solinger = 0) in the
  driver to tear down an RDMA connection abruptly.  This does what's
  intended without releasing the socket's fd reference.

- Close the socket in ibcore when the iWARP iw_cm_id is destroyed.  This
  works for all kinds of sockets: clients that initiate connections,
  listeners, and sockets accepted off of listeners.

Sponsored by: Chelsio Communications

git-svn-id: svn://svn.freebsd.org/base/stable/10@314606 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/dev/cxgbe/iw_cxgbe/cm.c
sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h
sys/ofed/drivers/infiniband/core/cma.c
sys/ofed/drivers/infiniband/core/iwcm.c