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)
Mar 8 2024, 1:34 AM
Unknown Object (File)
Mar 8 2024, 12:31 AM
Unknown Object (File)
Jan 14 2024, 6:45 AM
Unknown Object (File)
Dec 27 2023, 3:05 PM
Unknown Object (File)
Dec 23 2023, 6:23 PM
Unknown Object (File)
Dec 20 2023, 1:25 AM
Unknown Object (File)
Nov 30 2023, 7:17 AM
Unknown Object (File)
Nov 6 2023, 7:28 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 Not Applicable
Unit
Tests Not Applicable

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.