[openib-general] CMA issue: bind selects the same port after close

Tom Tucker tom at opengridcomputing.com
Tue Sep 12 18:10:17 PDT 2006


There is a whole array of Linux port management services that perform
exactly the logic that you are trying to emulate. Wouldn't our efforts be
more productively spent figuring out to use the existing services you are
currently trying to emulate? What do you do, for example, when the port
allocation policy in the kernel changes? Change your emulation?

I completely understand that the existing port management services are not
exported, but functionally, they support multiple port spaces, show up in
netstat, etc... Can someone please explain to me the reluctance to use these
services in favor of replicating them?

Sorry if this reads as a rant...but I feel we're on the wrong track...

On 9/11/06 11:27 PM, "Krishna Kumar2" <krkumar2 at in.ibm.com> wrote:

> Hi Michael,
> 
>>> The basic problem in the CMA is in cma_alloc_port().  If the port
> number (passed 
>>> in as snum) is 0, the first available port starting at
>>> sysctl_local_port_range[0] is used.  We could instead start our search
> by 
>>> adding an increasing counter or a random value to the lower-end of the
> port 
>>> range.  Then expand the code to handle searching below our starting
> value if we 
>>> failed to find one above it.
>> 
>> Sounds good.
>> 
>>> Are the port numbers assigned by TCP sequential or more random?
>> 
>> TCP ports seem to be sequential.
> 
> Are you getting sequential port numbers ? inet_csk_get_port() is actually
> using random
> number to get the *starting* value between sysctl_local_port_range[0] and
> sysctl_local_port_range[2]. Once it gets this starting number, it goes
> sequentially all the
> way to the high limit (sysctl*[1]) and then loops back from low
> (sysctl*[0]) limit until all
> the numbers in the middle are looked at.
> 
> I think we can easily use the same logic. Sean's second option seems to be
> followed
> here "> > adding a random value to the lower-end of the port range"
> 
> Thanks,
> 
> - KK
> 
> 
> _______________________________________________
> openib-general mailing list
> openib-general at openib.org
> http://openib.org/mailman/listinfo/openib-general
> 
> To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
> 






More information about the general mailing list