Page MenuHomeFreeBSD

Fix various double-close panics with iWARP sockets.
ClosedPublic

Authored by np on Feb 24 2017, 11:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 20, 11:51 PM
Unknown Object (File)
Fri, Dec 20, 8:17 PM
Unknown Object (File)
Oct 24 2024, 9:49 PM
Unknown Object (File)
Sep 26 2024, 9:55 PM
Unknown Object (File)
Sep 17 2024, 3:03 PM
Unknown Object (File)
Sep 8 2024, 3:53 PM
Unknown Object (File)
Sep 8 2024, 2:27 PM
Unknown Object (File)
Sep 7 2024, 7:51 PM
Subscribers

Details

Summary

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.
Test Plan

I've tested this with various kernel based ULPs and userspace tools.
The change has been reviewed by Steve Wise already.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7728
Build 7875: arc lint + arc unit

Event Timeline

np retitled this revision from to Fix various double-close panics with iWARP sockets..
np updated this object.
np edited the test plan for this revision. (Show Details)
np added a reviewer: hselasky.
hselasky edited edge metadata.

ibcore parts are fine.

This revision is now accepted and ready to land.Feb 28 2017, 5:52 PM
This revision was automatically updated to reflect the committed changes.