Subject: Re: CVS commit: syssrc/sys/dev/ic
To: Perry E. Metzger <>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: tech-kern
Date: 11/08/2001 11:29:44
In message <>,
"Perry E. Metzger" writes:

>I've always been uncomfortable with using the network controllers for
>entropy and I've said so a lot.

But is your discomfort warranted? I dont think it is-- or rather, I
think it depends very much on the network controller and on the
resolution of the counter being sampled.

Interrupt latency on the receiving NetBSD box isn't reproducible to
better than microsecond resolution.  So I've never seen any problem
with sampling the low-order bits of a gigahertz counter upon packet
arrival. Even sampling low-order bits of a several-tens-of-megahertz
cycle counter from 10mbit or 100Mbit is okay, too.

We'd need to rethink that if/when NIC drivers are reworked to use a
polling-based architecture (even worse, polled off a 100Hz or 1Khz
time-of-day interrupt, which in turn drives the NTP sampling.  Or if
the underlying hardware clock resolution is inadequate.

It might be fair to say that its not safe on NetBSD ports which lack a
good high-resolution timer source. But that's a problem with those
NetBSD ports (i386 alpha,...) or hardware (decstation 3100),
not with the idea itself.