Re: [PATCH net-next] netpoll: Fix carrier_timeout for msleep()
From: Jakub Kicinski
Date: Mon Oct 11 2021 - 20:11:35 EST
On Mon, 11 Oct 2021 16:57:53 +0800 Yajun Deng wrote:
> It should be sleep carrier_timeout seconds rather than 4 seconds if
> carrier_timeout has been modified.
carrier_timeout is for changing the upper bound of the wait,
not for controlling how long to wait if carrier is untrustworthy.
> Add start variable, hence atleast and atmost use the same jiffies, and
> use msecs_to_jiffies() and MSEC_PER_SEC match with jiffies.
> At the same time, msleep() is not for 1ms - 20ms, use usleep_range()
> instead, see Documentation/timers/timers-howto.rst.
>
> Fixes: bff38771e106 ("netpoll: Introduce netpoll_carrier_timeout kernel option")
> Signed-off-by: Yajun Deng <yajun.deng@xxxxxxxxx>