From patchwork Mon Dec 15 14:46:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4681 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7001:1490:b0:7b1:439f:bdf with SMTP id bf16csp1862988mac; Mon, 15 Dec 2025 06:47:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWJkSYHctZ+VeteD6l7YNget/RUywefczwTxT9Qt6CsF9PQpd3lLTAGK4VvUi+iXFcsESv4Eqb0sGo=@openvpn.net X-Google-Smtp-Source: AGHT+IGzYs/2NtxNTkeId2DoCs070MWBqt0SWZJCNXlI+lVQLr9uqVDTqASnV9qUaeVgFcv7E2e4 X-Received: by 2002:a05:6870:8899:b0:3d1:b23f:5fc5 with SMTP id 586e51a60fabf-3f5f8a7b469mr4920938fac.22.1765810035835; Mon, 15 Dec 2025 06:47:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1765810035; cv=none; d=google.com; s=arc-20240605; b=UiSJcRClBRQ9zNgBRwyCi24FZBrxeUfsdfSqeBX3uU2srhrs36Ol+wNTGyQZmmglbZ 5kTkYElmmAyYJyITaDkLCXt5fOn5YTLrcsjMGN8RWO03TCpRqg4iMJ7DvodMY5HQszD9 kzYEcOXPjTRebCkoGs9N5ksSgpKlaVMenaQUd7s8CMD8Y3AL/DcGN9W0r0GkLp+qMUwd WFrHzFoO3361DkbEbA+jKoWezhyqD1U3PwIdqlG2ngvcPj+G4ux0rl43GWw4xlLj8Mpa dbjSLEawUTmSn5159+MnkXHMlxQ1aamNBg3HBob0p05skt3XaRqc1/FwRGV35ogC3ETD 763w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=Wg571INxK5tRXi/sKRcGsyJfnc71LPLe1u8JMklWgds=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=hqlzfOaBj6Q0RCm0HAVvu5gVNyby5BjwvBELzMO5N44M2ao0ht2JHD+kbpKwdBYAsZ QzKcMkwKykI099w3AyUaru8eFNxTTb8+WpvfevefPySp8z2OmHYCAVe7GdkuU63GdAQG yLE6erx1S6FMm7vIAwrJuEPoxumEMLyzx0fPC3iot8QGas/61KS73J+VxQcPEW/6AYcl 5Zektl/taClLXQYES/t6CtS0iUAmeIgJA0SN9+BAD7S+Cng/OjGdpy5yjX/glgqDIyhk K7Lmai9IF6vl3pvb+fdD4vzvDyeuQQWeiDvkeKXy3BAqun0t9XPlG+wY2urVpzxwBLRE DUwQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=bZ7CYbnz; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=XAGUGM4H; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=dsH2s+Oe; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 586e51a60fabf-3f614f16bf1si5736695fac.397.2025.12.15.06.47.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Dec 2025 06:47:15 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=bZ7CYbnz; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=XAGUGM4H; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=dsH2s+Oe; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Wg571INxK5tRXi/sKRcGsyJfnc71LPLe1u8JMklWgds=; b=bZ7CYbnztYPemtBbrnrNerpJ+Q HNg4Q4pQgXEhgXeJapWhUZqV3iaO/C+WnDvkKMKfgf00Ad0E6FlioM/jpvg7nd9WGL2YJTJFq5KzE v1kvBTxZ95fBN/f/8PwiJ0tNyEAEfjnP3cSPg6lYpxP0GbqeCZDkiz6Im4ZY+w+6aA7s=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1vV9qt-0006Hs-Ut; Mon, 15 Dec 2025 14:47:07 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1vV9qr-0006Hk-7v for openvpn-devel@lists.sourceforge.net; Mon, 15 Dec 2025 14:47:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=9AqY3xWNz+8cbnDT3kEQ0Qa2hFjedABYAc2Ly+XdNnQ=; b=XAGUGM4HSaAMsscKbPqYOt480+ n4CMcPKum4hyrrfnlYffobkbe3jUwkwcvPU+LqAPjy168hm3yV+V6FdIrADoM6HB30/wlCbydueXy tKaVEgHbY0Ouefh1uFXywpj9rGKMck9TllFFzCkuFKtdI71Rxii5fR+R9r8Zp0qVgDoQ=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=9AqY3xWNz+8cbnDT3kEQ0Qa2hFjedABYAc2Ly+XdNnQ=; b=dsH2s+Oe/C3JYemB/yqnyjwljU ee7Cp2mGZwkF/kr+42rQTS5B8/k8r5SnIgDTtAPPBk9f4WtJCbSNw2983FGbk4Z6sVM+Q0DawD0zy gYiWnrhwnkxmtu7iFm3G4rdo+m4ZyGGdAL185p1zQCmVxeJMOhPRsupJ5ZO0jQnW9D3M=; Received: from [193.149.48.134] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vV9qp-000128-Lo for openvpn-devel@lists.sourceforge.net; Mon, 15 Dec 2025 14:47:04 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 5BFEkui1017317 for ; Mon, 15 Dec 2025 15:46:56 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 5BFEkuHn017316 for openvpn-devel@lists.sourceforge.net; Mon, 15 Dec 2025 15:46:56 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 15 Dec 2025 15:46:50 +0100 Message-ID: <20251215144656.17299-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.51.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-2.hosts.colo.sdot.me", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Frank Lichtenheld 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. Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1vV9qp-000128-Lo Subject: [Openvpn-devel] [PATCH v2] schedule: Rework documentation for schedule_add_entry X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1851586024405599666?= X-GMAIL-MSGID: =?utf-8?q?1851586024405599666?= From: Frank Lichtenheld 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 Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1439 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1439 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering 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 struct timeval *tv,