[openib-general] ib_gid_is_link_local

Jason Gunthorpe jgunthorpe at obsidianresearch.com
Wed Jan 3 15:14:51 PST 2007


On Wed, Jan 03, 2007 at 05:40:36PM -0500, Hal Rosenstock wrote:

> That function could be made more precise with a routing lookup. I
> presume an invalid link local GID would fail the lookup as opposed to
> now where it "passes".

I think it depends how you code it.. In IP-like terms you have two
processes going on here, a route lookup and a 'neighbour lookup' (GID
to LID/etc conversion) for the link address.

An non-existing link local GID should pass the routing lookup, but fail the
neighbour lookup since there is no LID.

So typically you'd do the routing lookup and end up with an on-link
GID. Then you'd do the neighbour lookup and get a link address (IB path).

> >  Since IBA defines the link local
> > addresses to be fe80::xxxx/64 it must test the full /64 (like ethernet
> > does).
> 
> Why ? I thought that the 54 bits (after the inital 10 bits 0xFE80) were
> constrained to be 0. If they are not, I agree but then I'm confused
> about the discussion of those 54 bits.

They are constrained to be 0, that is why you have to test them when
doing the routing checks (since non-zero values will be rejected by
the HCA).

But to test if the _scope_ of the address is link local you only look
at the first 10 bits.

> > Well, I'd say you have a hard wired routing table with 3 entires:
> > 
> > fe80::/64 onlink
> > DEFAULT_PREFIX::/64 onlink
> > default unreachable
> 
> Perhaps default is assumed "reachable" in experimental router mode.

As an initial start I'd like to see support for an entry like this:

default via fe80::17:77ff:feff:5

Where fe80::17:77ff:feff:5 is the GID of a router. A full table for a
routing environment might look like:
 
fe80::/64 onlink
fe80::/10 unreachable ; IBA requires link local scope addresses never
                      ; to be routed
ff00::/8 onlink       ; Multicast is 'on link'
DEFAULT_PREFIX::/64 onlink
default via fe80::17:77ff:feff:5

Matching is always done by longest prefix match.

Jason




More information about the general mailing list