[openib-general] Re: [PATCH][RFC] CMA automatic port number assignment

Sean Hefty mshefty at ichips.intel.com
Mon Feb 27 12:26:37 PST 2006


James Lentini wrote:
>>> static void cma_format_hdr(void *hdr, enum rdma_port_space ps,
>>> 			   struct rdma_route *route)
>>> {
>>>@@ -1371,6 +1379,9 @@ static void cma_format_hdr(void *hdr, en
>>> 	src4 = (struct sockaddr_in *) &route->addr.src_addr;
>>> 	dst4 = (struct sockaddr_in *) &route->addr.dst_addr;
>>> +	if (!src4->sin_port)
>>>+		src4->sin_port = cma_generate_ephemeral_port();
>>
>>This only sets the port number in the header.  It would make more 
>>sense to save the port number in the rdma_cm_id's src_addr.
> 
> 
> I thought I was saving the port number in the rdma_cm_id's src_addr. 
> src4 is an alias of the rdma_id_private's rdma_cma_id's rdma_route's 
> rdma_addr's src_addr field. 
> 
> How would you do it differently?

I missed that this was setting this through an alias.  In that case, it makes 
more sense to move saving this information to another function.  Setting this 
inside 'cma_format_hdr()' seems like a unintended side effect.

- Sean





More information about the general mailing list