[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e640386e-46dd-4215-8824-751fc6655ed4@openvpn.net>
Date: Sun, 2 Mar 2025 22:00:43 +0100
From: Antonio Quartulli <antonio@...nvpn.net>
To: Sabrina Dubroca <sd@...asysnail.net>
Cc: netdev@...r.kernel.org, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Donald Hunter <donald.hunter@...il.com>, Shuah Khan <shuah@...nel.org>,
ryazanov.s.a@...il.com, Andrew Lunn <andrew+netdev@...n.ch>,
Simon Horman <horms@...nel.org>, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, Xiao Liang <shaw.leon@...il.com>
Subject: Re: [PATCH net-next v20 20/25] ovpn: implement peer
add/get/dump/delete via netlink
On 02/03/2025 19:24, Sabrina Dubroca wrote:
> 2025-02-27, 02:21:45 +0100, Antonio Quartulli wrote:
>> @@ -1310,9 +1329,12 @@ void ovpn_peer_keepalive_work(struct work_struct *work)
>> if (next_run > 0 && ovpn->registered) {
>> netdev_dbg(ovpn->dev,
>> "scheduling keepalive work: now=%llu next_run=%llu delta=%llu\n",
>> - next_run, now, next_run - now);
>> + next_run, now, next_run - now ?: 0);
>
> nit: I don't think this "?: 0" does anything
Ouch, I missed the ">= 0".
The idea is that now may have outgrown next_run and in that case we must
reschedule the worker immediately (while also avoid passing a negative
number as delay).
Will get this fixed.
Cheers,
>
>> + /* due to the waiting above, the next_run deadline may have
>> + * passed: in this case we reschedule the worker immediately
>> + */
>> schedule_delayed_work(&ovpn->keepalive_work,
>> - (next_run - now) * HZ);
>> + (next_run - now) * HZ ?: 0);
>
> nit: same here
>
--
Antonio Quartulli
OpenVPN Inc.
Powered by blists - more mailing lists