diff options
| author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2026-08-16 19:46:34 +0000 |
|---|---|---|
| committer | Sander Vrijders <sander@ouroboros.rocks> | 2026-08-31 08:31:46 +0200 |
| commit | f921e50952334d99b6c25ee8df09e7fb1523e92f (patch) | |
| tree | aa25e0c1745ada1300f5c214198399d12706ec61 /cmake/config/lib/ssm.cmake | |
| parent | 016c3c438e9b066bb45d4934ad039a49bde7014d (diff) | |
| download | ouroboros-f921e50952334d99b6c25ee8df09e7fb1523e92f.tar.gz ouroboros-f921e50952334d99b6c25ee8df09e7fb1523e92f.zip | |
lib: Update FRCT loss recovery
Some more stability fixes in FRCT.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'cmake/config/lib/ssm.cmake')
| -rw-r--r-- | cmake/config/lib/ssm.cmake | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/cmake/config/lib/ssm.cmake b/cmake/config/lib/ssm.cmake index a9ac35c9..aa9c4f75 100644 --- a/cmake/config/lib/ssm.cmake +++ b/cmake/config/lib/ssm.cmake @@ -22,6 +22,10 @@ set(SSM_RBUFF_SIZE 1024 CACHE STRING "Number of slots in a flow's rbuff ring; must be a power of 2") set(SSM_RBUFF_TXQ_DELAY 10 CACHE STRING "Queueing delay a flow's tx ring may hold (ms); 0 is unlimited") +set(SSM_RBUFF_TXQ_PRIO_MUL 2 CACHE STRING + "Retransmissions get this multiple of the tx occupancy limit") +set(SSM_RBUFF_TXQ_PRIO_DIV 16 CACHE STRING + "Ring fraction (1/N) new data leaves to retransmissions") set(SSM_RBUFF_PREFIX "/${SHM_PREFIX}.rbuff." CACHE INTERNAL "Prefix for rbuff POSIX shared memory filenames") set(SSM_FLOW_SET_PREFIX "/${SHM_PREFIX}.set." CACHE INTERNAL @@ -148,6 +152,46 @@ message(STATUS " Blocks: ${SSM_PUP_256_BLOCKS}, ${SSM_PUP_512_BLOCKS}, " "${SSM_PUP_16K_BLOCKS}, ${SSM_PUP_64K_BLOCKS}, ${SSM_PUP_256K_BLOCKS}, " "${SSM_PUP_1M_BLOCKS}") +math(EXPR SSM_RBUFF_TXQ_RESERVE + "${SSM_RBUFF_SIZE} / ${SSM_RBUFF_TXQ_PRIO_DIV}") + +set(SSM_RBUFF_TXQ_RESERVE ${SSM_RBUFF_TXQ_RESERVE} CACHE INTERNAL + "Top-of-ring slots new data may not use") + +math(EXPR SSM_RBUFF_TXQ_DATA_MAX + "${SSM_RBUFF_SIZE} - 1 - ${SSM_RBUFF_TXQ_RESERVE}") + +# The limiter asserts its target fits SSM_RBUFF_TXQ_MAX_DELAY (1 s). +if(SSM_RBUFF_TXQ_DELAY LESS 0 OR SSM_RBUFF_TXQ_DELAY GREATER 1000) + message(FATAL_ERROR + "SSM_RBUFF_TXQ_DELAY (${SSM_RBUFF_TXQ_DELAY}) must be in " + "[0, 1000] ms; a longer target trips the limiter's own bound.") +endif() + +# What the reserve leaves new data must still clear the 4-slot floor. +if(SSM_RBUFF_TXQ_DATA_MAX LESS 4) + message(FATAL_ERROR + "SSM_RBUFF_TXQ_PRIO_DIV (${SSM_RBUFF_TXQ_PRIO_DIV}) leaves new " + "data ${SSM_RBUFF_TXQ_DATA_MAX} of ${SSM_RBUFF_SIZE} slots, " + "below the 4-slot floor: every write would be refused.") +endif() + +# Both bounds keep the retransmission headroom above zero: the divisor +# reserves it at saturation, the multiplier below it. +if(SSM_RBUFF_TXQ_PRIO_DIV LESS 2 OR SSM_RBUFF_TXQ_RESERVE LESS 1) + message(FATAL_ERROR + "SSM_RBUFF_TXQ_PRIO_DIV (${SSM_RBUFF_TXQ_PRIO_DIV}) must be in " + "[2, SSM_RBUFF_SIZE (${SSM_RBUFF_SIZE})]: it reserves " + "${SSM_RBUFF_TXQ_RESERVE} of ${SSM_RBUFF_SIZE} slots for " + "retransmissions.") +endif() + +if(SSM_RBUFF_TXQ_PRIO_MUL LESS 2) + message(FATAL_ERROR + "SSM_RBUFF_TXQ_PRIO_MUL (${SSM_RBUFF_TXQ_PRIO_MUL}) must be >= 2: " + "at 1 a retransmission gets the ceiling new data already has.") +endif() + # FRCT reorder queue must fit in every enabled size class. If RQ_SIZE >= any backing pool, the # receiver advertises a window the pool cannot back; np1_flow_write fails under load and a single # dropped fragment wedges the flow. Auto-zeroed classes are skipped. |
