vppinfra: fix pool_get_aligned_will_expand for fixed pools 07/9407/2
authorFlorin Coras <fcoras@cisco.com>
Tue, 14 Nov 2017 01:44:51 +0000 (17:44 -0800)
committerDave Wallace <dwallacelf@gmail.com>
Tue, 14 Nov 2017 16:53:31 +0000 (16:53 +0000)
Change-Id: Ia66ac0a2fa23a3d29370b54e2014900838a8d3ac
Signed-off-by: Florin Coras <fcoras@cisco.com>
src/vppinfra/pool.h

index 62d5b54..14c6a75 100644 (file)
@@ -233,9 +233,10 @@ do {                                                                    \
   _pool_var (l) = 0;                                                    \
   if (P)                                                                \
     {                                                                   \
-    if (_pool_var (p)->max_elts)                                        \
-      return 0;                                                         \
-    _pool_var (l) = vec_len (_pool_var (p)->free_indices);              \
+      if (_pool_var (p)->max_elts)                                      \
+        _pool_var (l) = _pool_var (p)->max_elts;                       \
+      else                                                             \
+        _pool_var (l) = vec_len (_pool_var (p)->free_indices);          \
     }                                                                   \
                                                                         \
   /* Free elements, certainly won't expand */                           \