[openib-general] [PATCHv2][RFC] kDAPL: use cm timers instead of own
Tom Duffy
tduffy at sun.com
Thu Jun 2 10:20:16 PDT 2005
On Thu, 2005-06-02 at 10:17 -0400, James Lentini wrote:
>
> On Tue, 31 May 2005, Tom Duffy wrote:
>
> > On Tue, 2005-05-31 at 14:17 -0400, James Lentini wrote:
> >> Here's the specification's exact description:
> >>
> >> timeout: Duration of time, in microseconds, that a consumer waits for
> >> connection establishment. The value of DAT_TIMEOUT_INFINITE
> >> represents no timeout, indefinite wait. Values must be
> >> positive.
> >
> > Let me make sure I got this right: timeout is in µs (10^-6 seconds), not
> > ms (10^-3 seconds). If so, I am off by 3 orders of magnitude in my
> > calculation. Right?
>
> Correct, the value was intended to be in microseconds.
OK, so this should be the conversion function:
/*
* approximately transforms microseconds to 4.096us*2^x
* 63(+8) is max return
*/
static inline u8 dapl_convert_us_to_kookyib(unsigned long us) {
unsigned long ms = us/1000UL, converged = 2;
u8 i;
if (2 > ms)
return 8;
for (i = 1; i < 63; i++) {
if (converged >= ms)
break;
converged = 2*converged;
}
return i+8;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20050602/38649ac1/attachment.sig>
More information about the general
mailing list