Thread (46 messages) 46 messages, 2 authors, 2025-03-10

Re: [PATCH v21 19/24] ovpn: implement peer add/get/dump/delete via netlink

flat view

From: Sabrina Dubroca <sd@queasysnail.net>
Date: 2025-03-04 14:35:29
Also in: linux-kselftest, lkml

2025-03-04, 01:33:49 +0100, Antonio Quartulli wrote:
quoted hunk ↗ jump to hunk
@@ -1317,11 +1336,16 @@ void ovpn_peer_keepalive_work(struct work_struct *work)
 
 	/* prevent rearming if the interface is being destroyed */
 	if (next_run > 0 && ovpn->registered) {
+		time64_t delta = next_run - now;
+
 		netdev_dbg(ovpn->dev,
 			   "scheduling keepalive work: now=%llu next_run=%llu delta=%llu\n",
-			   next_run, now, next_run - now);
+			   next_run, now, delta > 0 ? delta : 0);
+		/* due to the waiting above, the next_run deadline may have
+		 * passed: in this case we reschedule the worker immediately
+		 */
I don't understand this bit. I don't see what waiting you're refering
to (in particular within this patch), and I don't see how we could get
next_run < now based on how next_run is computed in
ovpn_peer_keepalive_work_single (next_run1/next_run2 is always set to
now + X or something that we just tested to be > now).

Am I missing something?
quoted hunk ↗ jump to hunk
 		schedule_delayed_work(&ovpn->keepalive_work,
-				      (next_run - now) * HZ);
+				      delta * HZ > 0 ? delta * HZ : 0);
 	}
 	unlock_ovpn(ovpn, &release_list);
 }
-- 
Sabrina
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help