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;
}

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to