Thanks, For all the sample code, the call rdma_resolve_addr() specify
a port number, which is the same as port number when calling
rdma_bind_addr()
on the other side, 

I hope port number is not necessary for rdma_resolve_addr() call.

--CQ

> -----Original Message-----
> From: Steve Wise [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, October 17, 2007 9:38 AM
> To: Tang, Changqing
> Cc: Sean Hefty; [email protected]
> Subject: Re: [ofa-general] librdmacm port selection for 
> rdma_bind_addr()
> 
> 
> 
> Tang, Changqing wrote:
> > Below is the piece of rping.c code, how do I pick the 
> returned port ? 
> > Do you reset sin.sin_port inside rdma_bind_addr() if I pass 0 to 
> > sin.sin_port ?
> > 
> 
> Yes.
> 
> > I need the returned port to tell client side to call 
> > rdma_resolve_addr(). If I am right, rdma_resolve_addr() needs dest 
> > port number.
> >
> 
> Sean, Does resolve_addr really need anything more than the ip 
> address? 
> For iWARP it doesn't.
> 
> 
> > 
> > static int rping_bind_server(struct rping_cb *cb) {
> >     struct sockaddr_in sin;
> >     int ret;
> > 
> >     memset(&sin, 0, sizeof(sin));
> >     sin.sin_family = AF_INET;
> >     sin.sin_addr.s_addr = cb->addr;
> >     sin.sin_port = 0;       ///////////cb->port;
> > 
> >     ret = rdma_bind_addr(cb->cm_id, (struct sockaddr *) &sin);
> >     if (ret) {
> >             fprintf(stderr, "rdma_bind_addr error %d\n", ret);
> >             return ret;
> >     }
> >     DEBUG_LOG("rdma_bind_addr successful\n");
> > 
> > --CQ
> > 
> >> -----Original Message-----
> >> From: Sean Hefty [mailto:[EMAIL PROTECTED]
> >> Sent: Tuesday, October 16, 2007 11:40 AM
> >> To: Tang, Changqing
> >> Cc: [email protected]
> >> Subject: Re: [ofa-general] librdmacm port selection for
> >> rdma_bind_addr()
> >>
> >>>   Is there a way to let system choose a port for me ? 
> >> like TCP/IP, if
> >>> port is set to 0, system will return an unused port.
> >> Yes - binding to port 0 will return a usable port.
> >>
> > _______________________________________________
> > general mailing list
> > [email protected]
> > http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
> > 
> > To unsubscribe, please visit 
> > http://openib.org/mailman/listinfo/openib-general
> 
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to