[openib-general] Re: Incorrect cm_find_port result.

Sean Hefty mshefty at ichips.intel.com
Wed Jan 26 15:17:38 PST 2005


Libor Michalek wrote:
>   I took a look at the actual port number being passed to cached pkey,
> port->port_num, and in the unmodified code the result from cm_find_port()
> has port_num set as 0, which seems incorrect since port numbering should
> be 1 based, right?

The cached functions are supposed to be 1 based, so that is correct.

If you walk through the following functions:

cm_add_one: records port_num as 1 based

cm_init_av: calls cm_find_port

cm_find_port: calls ib_find_cached_gid

ib_find_cached_gid: returns 0 based port_num

cm_find_port: uses returned port_num - 1 as an index into an array. 
This should walk off into oblivion if port_num is 0.  (I should 
probably check that the returned port_num is > 0.)

ib_find_cached_pkey: uses the port returned from cm_find_port, which is 
off in space somewhere

At least that's what I think is happening.

- Sean



More information about the general mailing list