safe_pause_us() is always at least 1 millisecond long

Miłosz Kaniewski milosz.kaniewski at gmail.com
Tue Oct 20 20:58:46 UTC 2020


Hi,

I was recently doing some tests and found out that on the iflib e1000
driver I can do much less media status checks per second compared to the
non-iflib driver. I found out that this is caused by the definition of
safe_pause_us() which calls:

pause("e1000_delay", max(1, x/(1000000/hz)));

If I understand everything correctly then it means that safe_pase_us() is
always at least 1 millisecond long (if a clock is 1000 Hz). Shouldn't it
use min() instead?

Thanks,
Milosz


More information about the freebsd-net mailing list