From 63c67f59bf589475b18ccfe7c76c3cbbccfd7e8d Mon Sep 17 00:00:00 2001 From: Viktor Liu Date: Wed, 22 Apr 2026 12:07:39 +0200 Subject: [PATCH] device: clarify that MaxBatchSizeOverride=0 means 'no override', not 'unlimited' --- device/pool_size.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/device/pool_size.go b/device/pool_size.go index 70b55f8..3a6bc16 100644 --- a/device/pool_size.go +++ b/device/pool_size.go @@ -7,8 +7,10 @@ package device // MaxBatchSizeOverride, when nonzero, replaces the per-Device batch size used // to size eager buffer allocations in RoutineReceiveIncoming and -// RoutineReadFromTUN. Changes affect Devices created after this assignment. -// Use SetMaxBatchSizeOverride to change it safely at runtime. +// RoutineReadFromTUN. Zero means "do not override" (Devices fall back to the +// larger of bind.BatchSize() and tun.BatchSize()); zero is NOT "unlimited". +// Changes affect Devices created after this assignment; use +// SetMaxBatchSizeOverride to set it. var MaxBatchSizeOverride uint32 = 0 // SetPreallocatedBuffersPerPool sets the cap on the number of buffers held by