[ofa-general] Re: [PATCH 19/20] IB/ipath - add calls to new 7220 code and enable in build
Ralph Campbell
ralph.campbell at qlogic.com
Fri Apr 4 14:42:24 PDT 2008
On Fri, 2008-04-04 at 14:15 -0700, Roland Dreier wrote:
> > +enum ib_rate ipath_mult_to_ib_rate(unsigned mult)
> > +{
> > + switch (mult) {
> > + case 8: return IB_RATE_2_5_GBPS;
> > + case 4: return IB_RATE_5_GBPS;
> > + case 2: return IB_RATE_10_GBPS;
> > + case 1: return IB_RATE_20_GBPS;
> > + default: return IB_RATE_PORT_CURRENT;
> > + }
> > +}
>
> Looks suspiciously like a copy of the existing mult_to_ib_rate() except
> it handles fewer cases... is there a reason to copy this?
>
> - R.
It looks similar but the values are reversed. This is converting
the ib_rate enum to a multiplier of the DDR clock rate which is
used as a counter to delay packets. So IB_RATE_2_5_GBPS is 8
times slower than IB_RATE_20_GBPS. The standard functions map
the enum to a multiplier of the slowest rate so
IB_RATE_2_5_GBPS is one. If I used the standard functions, I would
still need a lookup table to map 8->1, 1->8, etc.
More information about the general
mailing list