summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/clib.h
diff options
context:
space:
mode:
authorRyujiro Shibuya <ryujiro.shibuya@owmobility.com>2020-06-24 08:36:14 +0100
committerFlorin Coras <florin.coras@gmail.com>2020-06-30 04:25:41 +0000
commitcc1085647b2ae36e6c086d65b4e81b9f1cf9fc9a (patch)
treea2d1d71bfa5c884c257d3f69ae8b32a42edaceec /src/vppinfra/clib.h
parentec1d61efe6d01a1a687f39e57a601ac693833b07 (diff)
tcp: avoid rcv wnd more than RX fifo can enqueue
Type: fix Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com> Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie358b731f8ecb1fcaebd6e79f5ce5c10802c2814
Diffstat (limited to 'src/vppinfra/clib.h')
-rw-r--r--src/vppinfra/clib.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vppinfra/clib.h b/src/vppinfra/clib.h
index 6961d100a75..be21cad604b 100644
--- a/src/vppinfra/clib.h
+++ b/src/vppinfra/clib.h
@@ -254,6 +254,12 @@ is_pow2 (uword x)
}
always_inline uword
+round_down_pow2 (uword x, uword pow2)
+{
+ return (x) & ~(pow2 - 1);
+}
+
+always_inline uword
round_pow2 (uword x, uword pow2)
{
return (x + pow2 - 1) & ~(pow2 - 1);