tcp: avoid rcv wnd more than RX fifo can enqueue
[vpp.git] / src / vppinfra / clib.h
index 6961d10..be21cad 100644 (file)
@@ -253,6 +253,12 @@ is_pow2 (uword x)
   return 0 == (x & (x - 1));
 }
 
+always_inline uword
+round_down_pow2 (uword x, uword pow2)
+{
+  return (x) & ~(pow2 - 1);
+}
+
 always_inline uword
 round_pow2 (uword x, uword pow2)
 {