Re: [PATCH net-next v5 17/25] ovpn: implement keepalive mechanism
From: Antonio Quartulli <antonio@openvpn.net>
Date: 2024-07-18 08:18:29
Hi Eyal, thanks a lot for chiming in. On 17/07/2024 18:19, Eyal Birger wrote:
Hi, On Wed, Jul 17, 2024 at 8:29 AM Antonio Quartulli [off-list ref] wrote:quoted
On 15/07/2024 16:44, Sabrina Dubroca wrote:quoted
quoted
This (and ovpn_peer_keepalive_xmit_reset) is going to be called for each packet. I wonder how well the timer subsystem deals with one timer getting updated possibly thousands of time per second.May it even introduce some performance penalty? Maybe we should get rid of the timer object and introduce a periodic (1s) worker which checks some last_recv timestamp on every known peer? What do you think?FWIW In NATT keepalive for IPsec the first RFC was using timers and the workqueue approach was suggested [1], and later implemented [2]. The code is currently in net-next. Eyal. [1] https://linux-ipsec.org/pipermail/devel/2023/000283.html [2] https://patchwork.kernel.org/project/netdevbpf/patch/20240528032914.2551267-1-eyal.birger@gmail.com/
Thanks for these pointers. Basically this is pretty much what I had in mind, but rather than running the worker every second, the next run is scheduled based on the closest expiration time. I like it! Since this worker has no other housekeeping to do, I will go with this approach as well. Thanks! Regards, -- Antonio Quartulli OpenVPN Inc.