[ofa-general] Re: [PATCH] Update mad formatting functions.

Sasha Khapyorsky sashak at voltaire.com
Wed Apr 15 17:09:34 PDT 2009


On 14:03 Wed 15 Apr     , Ira Weiny wrote:
> > 
> > ib_mad_f table also has a name string field. I think it can be useful
> > too - will help to unify outputs. Of course this can be done as
> > subsequent patch.
> 
> Yes but I don't think we should force users to use any specific output.  If
> they want to print the "name" of a field that should be a separate specifier
> __not__ automatic.  Is this what you mean?

Yes, exactly - using separate convesion symbol, not both in %F.

> > Lids are printed as decimals.
> 
> Well I thought I copied the output from the example but I see that it is
> printing decimal.  So??  :-/  I fixed it.
> 
> As an aside, not all LID's are decimal.  Should we change this?

Yes, it is better to have things unified.

> from fields.c
> ...
> 	{BE_OFFS(256, 16), "DrSmpDLID", mad_dump_hex},
> 	{BE_OFFS(272, 16), "DrSmpSLID", mad_dump_hex},
> ...
> 	{BITSOFFS(224, 16), "RedirectLID", mad_dump_hex},
> 	{BITSOFFS(480, 16), "TrapLID", mad_dump_hex},
> ...
> 	{BITSOFFS(320, 16), "PathRecDLid", mad_dump_hex},
> 	{BITSOFFS(336, 16), "PathRecSLid", mad_dump_hex},
> ...
> 	{BITSOFFS(288, 16), "McastMemMLid", mad_dump_hex},

Old stuff...

> > Now instead of reimplementing *printf() functions with potential need
> > to follow their extensions/conventions/update/etc wouldn't it be easier
> > (and in long term safer) to just rebuild format string by resolving
> > known %X conversions and then to pass it with rest parameters to
> > standard libc's *printf()?
> > 
> > In this way we will support all what *printf()s know + our conversions.
> > 
> 
> I thought about that but decided not to do it.  I can't remember why though...
> ;-)  So maybe I agree with you, let me try and remember and if I can't I will
> change it.

Thanks.

Sasha



More information about the general mailing list