[openib-general] Re: [PATCH] CMA: allow/require bind before connect
Michael S. Tsirkin
mst at mellanox.co.il
Sun Mar 26 07:34:42 PST 2006
Quoting r. Tom Tucker <tom at opengridcomputing.com>:
> Subject: Re: [PATCH] CMA: allow/require bind before connect
>
> On Sun, 2006-03-26 at 16:59 +0200, Michael S. Tsirkin wrote:
> > Sean, CMA currently bails out if I bind to ANY address before connect.
> > I think in TCP you bind before connect
>
> It is not typical to use bind on the active side before connect. When it
> is done, is when the application wants to control which local port
> and/or interface to use when connecting to a remove peer. bind(2) is
> typically used on the passive side before listen.
Tom, I have a connection bind on a local port to control which local port
to use when connecting to a remove peer.
Further, I think TCP connections autobind to a local port on connect,
even if you don't do it explicitly.
I think a local port is required for the communication to work in TCP.
At the level I work in SDP, Linux net core calls bind before connect if the
socket source port is 0. I could override this but I don't think its a good
idea since the point is to emulate TCP: TCP connections always have a source
port and so should CMA connections.
Since bind to port 0 isn't supported in CMA yet, I proposed making an
explicit bind a requirement before resolve_addr - not a serious
overhead and it keeps the code simple.
--
Michael S. Tsirkin
Staff Engineer, Mellanox Technologies
More information about the general
mailing list