[ofa-general] implicit address binding by rdma_resolve_addr
Sean Hefty
mshefty at ichips.intel.com
Tue Aug 7 11:14:52 PDT 2007
> Correct me if I am wrong, but implementing this scenario for UD will
> look like this:
> /* accept handling not shown... */
> rdma_bind_addr(id, ...);
> rdma_listen(id)
> while(1) {
> read_request();
> do_work();
> if(new_client) { /* check if we already connected to client */
> /* following is not going to work because local address
> is already bound */
> rdma_resolve_addr(my_local_already_bound_addr,
> client_addr);
There could very well be a bug with the state management in the rdma cm
that disallows this. (Have you tried this and seen it fail?)
rdma_resolve_addr() only binds if the id is not already bound. So, call
sequence such as:
rdma_bind_addr(id..)
rdma_resolve_addr(id..)
should work fine.
Likewise,
rdma_resolve_addr(id..)
rdma_resolve_route(id..)
rdma_connect(id..)
*should* work, but may not if the connection state isn't being reset
properly for UD.
Note that you don't have to use the same id that you send on to resolve
the address. You can use a temporary ID that you allocate for the
purpose of obtaining the remote address handle.
As an alternative to calling rdma_resolve_addr() from the server, you
can use the receive completion from the client to create an address
handle. See the udaddy.c sample program with the librdmacm -
specifically create_reply_ah().
- Sean
More information about the general
mailing list