[ofa-general] [PATCH] libibmad/dump.c: Support link speed and width vendor extensions

Hal Rosenstock hrosenstock at xsigo.com
Mon Nov 19 14:27:11 PST 2007


On Mon, 2007-11-19 at 22:00 +0000, Sasha Khapyorsky wrote:
> On 13:53 Sat 17 Nov     , Jason Gunthorpe wrote:
> > On Tue, Nov 13, 2007 at 07:38:43AM -0800, Hal Rosenstock wrote:
> > > libibmad/dump.c: Support link speed and width vendor extensions
> > > 
> > > When decoding values, handle vendor extensions to link speed and width
> > > including accommodating a "documentation" change between IBA 1.2 and
> > > 1.2.1
> > 
> > Isn't this better done with a bitmap match?
> 
> Yes, it is better IMO.

I think this is applicable elsewhere as well. I'll see if I can cook up
a patch in my spare time.

-- Hal

> Sasha
> 
> > 
> > const unsigned int widths[] = {1,4,8,12};
> > 
> > char S[300];
> > int off = 0;
> > for (unsigned int I = 0; I != sizeof(width)/sizeof(width[0]) && off < sizeof(S); I++)
> >    if ((width >> I) & 1)
> >       off += snprintf(S,sizeof(S)-off,"%uX ",widths[I]);
> > 
> > Regards,
> > Jason



More information about the general mailing list