From: "flichtenheld (Code Review)" Date: Fri, 12 Dec 2025 13:44:27 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <499a6ae8e432a4e52a012c05d45af1f70aa3d940-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="F9AnpNhv+vk="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: schedule: Rework documentation for schedule_add_entry List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --F9AnpNhv+vk= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1439?usp=3Demail to review the following change. Change subject: schedule: Rework documentation for schedule_add_entry ...................................................................... schedule: Rework documentation for schedule_add_entry The previous documentation was very misleading and made it hard to understand how the sigma parameter is used. Rewrite it so that it better reflects the actual implementation. Change-Id: Idd79f7cbd38e8b0831f15866339c3677a367cd49 Signed-off-by: Frank Lichtenheld --- M src/openvpn/schedule.h 1 file changed, 20 insertions(+), 11 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/39/1439/1 diff --git a/src/openvpn/schedule.h b/src/openvpn/schedule.h index 79311c5..3e2a2ad 100644 --- a/src/openvpn/schedule.h +++ b/src/openvpn/schedule.h @@ -81,17 +81,26 @@ /* Public inline functions */ -/* - * Add a struct schedule_entry (whose storage is managed by - * caller) to the btree. tv signifies the wakeup time for - * a future event. sigma is a time interval measured - * in microseconds -- the event window being represented - * starts at (tv - sigma) and ends at (tv + sigma). - * Event signaling can occur anywere within this interval. - * Making the interval larger makes the scheduler more efficient, - * while making it smaller results in more precise scheduling. - * The caller should treat the passed struct schedule_entry as - * an opaque object. +/** + * Add a struct schedule_entry to the scheduler btree or + * update an existing entry with a new wakeup time. + * + * @p sigma is only used when the entry is already present + * in the schedule. If the originally scheduled time and the new + * time are within @p sigma microseconds of each other then the + * entry is not rescheduled and will occur at the original time. + * When adding a new entry @p sigma will be ignored. + * + * @param s scheduler tree + * @param e entry to add to the schedule + * @param tv wakeup time for the entry + * @param sigma window size for the event in microseconds + * + * @note The caller should treat @p e as opaque data. Only + * the scheduler functions should change the object. The + * caller is expected to manage the memory for the object + * and must only free it once it has been removed from the + * schedule. */ static inline void schedule_add_entry(struct schedule *s, struct schedule_entry *e, const str= uct timeval *tv, -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1439?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newchange Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Idd79f7cbd38e8b0831f15866339c3677a367cd49 Gerrit-Change-Number: 1439 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --F9AnpNhv+vk= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

V= iew Change

schedule: Rework documentation for schedule=
_add_entry

The previous documentation was very misleading and madeit hard to understand how the sigma parameter is used.

Rewrite it = so that it better reflects the actual
implementation.

Change-Id: = Idd79f7cbd38e8b0831f15866339c3677a367cd49
Signed-off-by: Frank Lichtenhe= ld <frank@...2641...>
---
M src/openvpn/schedule.h
1 file ch= anged, 20 insertions(+), 11 deletions(-)

git pul=
l ssh://gerrit.openvpn.net:29418/openvpn refs/changes/39/1439/1
dif=
f --git a/src/openvpn/schedule.h b/src/openvpn/schedule.h
i= ndex 79311c5..3e2a2ad 100644
--- a/src/openvpn/schedule.h
+++ b/src/openvpn/schedule.h
@@ -81,17 +81,2= 6 @@

/* Public inline functions */

-/*=
- * Add a struct schedule_ent= ry (whose storage is managed by
- * caller) to the btree. tv signifies the wakeup time for=
- * a future event. sigma is= a time interval measured
- * in microseconds -- the event window being represented
- * starts at (tv - sigma) and ends a= t (tv + sigma).

- * Eve= nt signaling can occur anywere within this interval.
- * Making the interval larger makes the sch= eduler more efficient,
= - * while making it smaller results in more precise scheduling.
<= span style=3D"color: hsl(0, 100%, 40%);">- * The caller should treat the pa= ssed struct schedule_entry as

- * an opaque object.
+/**
+ * Add = a struct schedule_entry to the scheduler btree or
+ * update an existing entry with a new wakeup= time.
+ *
= + * @p sigma is only used when = the entry is already present
+ * in the schedule. If the originally scheduled time and the new
+ * time are within @p= sigma microseconds of each other then the
+ * entry is not rescheduled and will occur at the or= iginal time.
+ * When= adding a new entry @p sigma will be ignored.
+ *
+ * @param s scheduler tree
+ * @param e entry to add to the schedule
= + * @param tv wakeup time fo= r the entry
+ * @para= m sigma window size for the event in microseconds
+ *
+ * @note The caller should treat @p e as opaque data. Only
+ * the scheduler functi= ons should change the object. The
+ * caller is expected to manage the memory for the object
+ * and must only free i= t once it has been removed from the
+ * schedule.
*/
static i= nline void
schedule_add_entry(struct schedule *s, struct s= chedule_entry *e, const struct timeval *tv,

To view, visit change 1439. To unsubscribe, or for help writing mail filte= rs, visit settin= gs.

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Idd79f7cbd38e8b0831f15866339= c3677a367cd49
Gerrit-Change-Number: 1439
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
= --F9AnpNhv+vk=--