[ewg] [PATCH RFC v3] RDMA/CMA: Allocate PS_TCP ports from the host TCP port space.

Tung, Chien Tin chien.tin.tung at intel.com
Wed Nov 12 08:28:38 PST 2008


>I understand that now the value of the port allocated by the network 
>stack is being kept by the rdma-cm, can you clarify what was 
>the outcome 
>of not keeping it?

The code flow for the failed case is:

1) For active open, sin_port 0 get pass in to cma_get_tcp_port().
2) The port number for the allocated socket is not filled in, the port 
	number stays 0 for id_priv->id.route.addr.src's sin_port.
2) cma_any_port(sin_port) evaluates to true
3) and calls cma_alloc_any_port() to allocate a port number which may
	not correspond to the port number for the bound socket.

With the addition of getnam(), sin_port is filled in with the reserved
port number and cma_any_port will evaluate to false and the reserved
port will get used instead.

I hope that was clearer.

Chien


More information about the ewg mailing list