Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Oct 2020 22:58:25 +0200
From:      =?UTF-8?Q?Mi=C5=82osz_Kaniewski?= <milosz.kaniewski@gmail.com>
To:        freebsd-net@freebsd.org
Subject:   safe_pause_us() is always at least 1 millisecond long
Message-ID:  <CAC4mxp7NKjE5ziCtSSgfevjpLzb_xtefk6WFrNAJmdCyUs6EKw@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAC4mxp7NKjE5ziCtSSgfevjpLzb_xtefk6WFrNAJmdCyUs6EKw>