ip: reassembly - pacing reassembly timeouts

Type: fix

Pace the main thread activity for reassembly timeouts, to avoid barrier syncs

Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com>
Change-Id: If8c62a05c7d28bfa6ac530c2cd5124834b4e8a70
diff --git a/src/vppinfra/pool.h b/src/vppinfra/pool.h
index 2a35629..dd581ef 100644
--- a/src/vppinfra/pool.h
+++ b/src/vppinfra/pool.h
@@ -555,11 +555,22 @@
   _pool_var(rv);                                                        \
 })
 
-#define pool_foreach_index(i,v)		\
-  if (v)					\
-    for (i = pool_get_first_index (v);		\
-	 i < vec_len (v);			\
-	 i = pool_get_next_index (v, i))	\
+#define pool_foreach_index(i, v)                                              \
+  if (v)                                                                      \
+    for (i = pool_get_first_index (v); i < vec_len (v);                       \
+	 i = pool_get_next_index (v, i))
+
+/* Iterate pool by index from s to e */
+#define pool_foreach_stepping_index(i, s, e, v, body)                         \
+  for ((i) = (s); (i) < (e); (i) = pool_get_next_index (v, i))                \
+    {                                                                         \
+      if (!pool_is_free_index ((v), (i)))                                     \
+	do                                                                    \
+	  {                                                                   \
+	    body;                                                             \
+	  }                                                                   \
+	while (0);                                                            \
+    }
 
 /**
  * @brief Remove all elements from a pool in a safe way