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

Sasha Khapyorsky sashak at voltaire.com
Mon Nov 19 14:00:04 PST 2007


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.

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