[ofa-general] Re: [PATCH] ibsim/sim.h: Fix NodeDescription size

Hal Rosenstock hrosenstock at xsigo.com
Mon May 12 09:28:16 PDT 2008


On Mon, 2008-05-12 at 18:41 +0000, Sasha Khapyorsky wrote:
> On 14:01 Sun 04 May     , Hal Rosenstock wrote:
> > ibsim/sim.h: Fix NodeDescription size so can have maximum size
> > NodeDescription per IBA spec rather than truncating them
> > 
> > Signed-off-by: Hal Rosenstock <hal at xsigo.com>
> > 
> > diff --git a/ibsim/sim.h b/ibsim/sim.h
> > index bea136a..dbf1220 100644
> > --- a/ibsim/sim.h
> > +++ b/ibsim/sim.h
> > @@ -67,7 +67,7 @@
> >  
> >  #define NODEIDBASE	20
> >  #define NODEPREFIX	20
> > -#define NODEIDLEN	(NODEIDBASE+NODEPREFIX+1)
> > +#define NODEIDLEN	65
> >  #define ALIASLEN 	40
> 
> nodeid filed in struct Node still have length 64, so it looks that using
> NODEIDLEN value larger than this introduces overflow. I think bigger
> change is needed there.

I made NODEIDLEN 65 rather than 64 due to the +1 in the original define.
How about defining it as 64 as in the below ? Does that get around the
overflow issue ?

-- Hal

ibsim/sim.h: Fix NodeDescription size so can have maximum size
NodeDescription per IBA spec rather than truncating them
 
Signed-off-by: Hal Rosenstock <hal at xsigo.com>

diff --git a/ibsim/sim.h b/ibsim/sim.h
index bea136a..0bf14fd 100644
--- a/ibsim/sim.h
+++ b/ibsim/sim.h
@@ -65,9 +65,8 @@
 #define        DEFAULT_LINKWIDTH       LINKWIDTH_4x
 #define DEFAULT_LINKSPEED      LINKSPEED_SDR
 
-#define NODEIDBASE     20
 #define NODEPREFIX     20
-#define NODEIDLEN      (NODEIDBASE+NODEPREFIX+1)
+#define NODEIDLEN      64
 #define ALIASLEN       40
 
 #define MAXHOPS 16

> Sasha




More information about the general mailing list