From 7808df2e2fd0fd61a27e5a5322dc6dafe40924e5 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Mon, 2 Nov 2020 18:00:32 -0800 Subject: session: allow small pacer bursts Instead of enforcing a "strict" release of data, which relies on frequent rescheduling of sessions, allow some pacer coalescing, i.e., short bursts, that can minimize load on scheduler/session layer and potentially leverage tso. Type: improvement Signed-off-by: Florin Coras Change-Id: I67e38e5b8dc335bd214113b70c68c27ae92bd6da --- src/vppinfra/clib.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/vppinfra/clib.h') diff --git a/src/vppinfra/clib.h b/src/vppinfra/clib.h index 9474350c6da..22377c61440 100644 --- a/src/vppinfra/clib.h +++ b/src/vppinfra/clib.h @@ -332,6 +332,14 @@ extract_bits (uword x, int start, int count) _x < _y ? _x : _y; \ }) +#define clib_clamp(x,lo,hi) \ +({ \ + __typeof__ (x) _x = (x); \ + __typeof__ (lo) _lo = (lo); \ + __typeof__ (hi) _hi = (hi); \ + _x < _lo ? _lo : (_x > _hi ? _hi : _x); \ +}) + #define clib_abs(x) \ ({ \ __typeof__ (x) _x = (x); \ -- cgit 1.2.3-korg