[openib-general] [PATCH] RDMA CM: assign port numbers when binding a cm_id to an address

Sean Hefty sean.hefty at intel.com
Thu Apr 20 12:06:11 PDT 2006


>rdma_create_id()
>rdma_resolve_addr()
>rdma_resolve_route()
>rdma_create_qp()
>rdma_connect()
>
>We don't need to call rdma_bind_addr(), and hence won't have a port
>number assigned.
>
>Did you consider automatically assigning a port in connect? Something
>along the lines of
>
> if (cma_any_port())
>	cma_alloc_port()
>

rdma_bind_addr() is called for the user in rdma_resolve_addr(), unless the user
has already bound the cm_id.


>> +static int cma_get_port(struct rdma_id_private *id_priv)
>> +{
>> +	struct idr *ps;
>> +	int ret;
>> +
>> +	switch (id_priv->id.ps) {
>> +	case RDMA_PS_SDP:
>> +		ps = &sdp_ps;
>> +		break;
>> +	case RDMA_PS_TCP:
>> +		ps = &tcp_ps;
>> +		break;
>> +	default:
>> +		return -EPROTONOSUPPORT;
>> +	}
>
>Do you plan to add support for UDP and SCTP since they have
>rdma_port_space values? Is it as simple as adding a UDP and SCTP idr?

Adding the port space values should be as simple as adding the UDP / SCTP idr's.
I'm just not as sure that SCTP support is handled in other locations in the
code, and I don't think it makes sense to have UDP connections.  I deferred both
of these for now.

- Sean



More information about the general mailing list