[openib-general] ib_gid_is_link_local
Jason Gunthorpe
jgunthorpe at obsidianresearch.com
Tue Jan 2 17:24:41 PST 2007
On Tue, Jan 02, 2007 at 06:39:21PM -0500, Hal Rosenstock wrote:
> > I think you are right about the 0s (see definition of GID Prefix).
> > Based on the definition of GID Prefix (and the IPv6 addressing
> > architecture this section is clearly derived from) I'd also change
> > ib_gid_is_link_local to check only the scope bits (ie compare a /10
> > not a /64..)
>
> I was wondering about that too and was about to go there. So you are
> saying that any link local scope GID is fine (and doesn't need complete
> 64 bit matching but only the first 10 bits), right ?
Well, there is a quibble here that is worth noting.
I would expect a function like ib_gid_is_link_local to behave
similarly to the POSIX IN6_IS_ADDR_LINKLOCAL function, in that it
tests the scope of the address for the link local property. For this
purpose /10 is correct.
However, the current usage of ib_gid_is_link_local is really a
placeholder for a routing lookup. Since IBA defines the link local
addresses to be fe80::xxxx/64 it must test the full /64 (like ethernet
does).
> > > > > Shouldn't it be either the default subnet prefix or the one supplied in
> > > > > PortInfo:GidPrefix (which might not be the default one) ?
> >
> > Would be better described as ib_gid_is_on_link. on-link being a term
> > used to refer to an address where a routing table says it is present
> > on the local link rather than reachable through a router.
>
> Yes, that is better terminology but I can't use this yet as there is no
> routing table (at least yet)...
Well, I'd say you have a hard wired routing table with 3 entires:
fe80::/64 onlink
DEFAULT_PREFIX::/64 onlink
default unreachable
Which is what the tests in the code accomplish.
One thought would be to implement the route lookup function with a
useable signature and move the hard codeded tests into it as a
placeholder for an alterable routing table.
Jason
More information about the general
mailing list