[openib-general] ib_gid_is_link_local

Hal Rosenstock halr at voltaire.com
Tue Jan 2 15:46:39 PST 2007


On Tue, 2007-01-02 at 18:39, Hal Rosenstock wrote:
> Hi Jason,
> 
> On Tue, 2007-01-02 at 18:00, Jason Gunthorpe wrote:
> > On Tue, Jan 02, 2007 at 04:42:23PM -0500, Hal Rosenstock wrote:
> > 
> > > > I propose changing the routine name to ib_gid_is_default_prefix so as
> > > > not to be misleading. Comments ? Patch to follow for this.
> > > 
> > > What is confusing is the link local unicast GID definition in Figure 39.
> > > It says 54 bits of and is green (which I think means 0 as in Figure 40)
> > > on p. 144-145.
> > 
> > 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 ?

How about the following (untested as yet):

diff --git a/osm/include/iba/ib_types.h b/osm/include/iba/ib_types.h
index 573b294..0f710e1 100644
--- a/osm/include/iba/ib_types.h
+++ b/osm/include/iba/ib_types.h
@@ -2168,7 +2168,8 @@ static inline boolean_t   OSM_API
 ib_gid_is_link_local(
        IN      const   ib_gid_t* const         p_gid )
 {
-       return( ib_gid_get_subnet_prefix( p_gid ) == IB_DEFAULT_SUBNET_PREFIX );
+       return( ( ib_gid_get_subnet_prefix( p_gid ) &
+               CL_HTON64( 0xFFE0000000000000ULL ) ) == IB_DEFAULT_SUBNET_PREFIX
 }
 /*
 * PARAMETERS

> 
> > BTW, I think ib_gid_is_link_local is a fine name for the function as
> > is and matches the various specifications. The test you described:
> 
> Agreed. I came back around to that conclusion once I became
> unconfused...
> 
> > > > > 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)...
> 
> > It looks like you are making alot of progress here on router support -
> > I'm looking forward to trying it!
> 
> Thanks and I look forward to getting feedback from real routers :-)
> 
> -- Hal
> 
> > Jason
> 
> 
> _______________________________________________
> 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