changeset 40:d73b6ec27ae6

twjit: allow starting fill level to be 1 In most use cases, the smallest useful setting for starting fill level is 2. However, our job is to provide mechanism rather than policy, and the theoretical minimum is 1 - so let's support the latter configuration.
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 20 Dec 2024 20:07:01 +0000
parents 1485211d4492
children bda6b24385f7
files src/twjit_in.c src/twjit_vty.c
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/twjit_in.c	Fri Dec 20 09:01:24 2024 +0000
+++ b/src/twjit_in.c	Fri Dec 20 20:07:01 2024 +0000
@@ -113,6 +113,13 @@
 	sb->depth = 1;
 	memcpy(&sb->conf, twjit->ext_config, sizeof(struct twrtp_jibuf_config));
 	sb->drop_int_count = 0;
+	/* The setting of delta_ms is needed in order to pacify the check
+	 * in twjit_out.c:starting_sb_is_ready() in configurations with
+	 * bd_start=1.  An alternative would be to enforce start_min_delta
+	 * being not set with bd_start=1, but the present solution is
+	 * simpler than doing cross-enforcement between two different
+	 * parameter settings in vty. */
+	sb->delta_ms = UINT32_MAX;
 }
 
 enum input_decision {
--- a/src/twjit_vty.c	Fri Dec 20 09:01:24 2024 +0000
+++ b/src/twjit_vty.c	Fri Dec 20 20:07:01 2024 +0000
@@ -38,7 +38,7 @@
 }
 
 DEFUN(cfg_buffer_depth, cfg_buffer_depth_cmd,
-      "buffer-depth <2-65535> <2-65535>",
+      "buffer-depth <1-65535> <2-65535>",
       "Buffer depth configuration\n"
       "Minimum fill required to start flow\n"
       "High water mark fill level\n")