ip: extend show cmd of ip reassembly configuration
[vpp.git] / src / vnet / ip / reass / ip6_full_reass.c
index 15ee3e3..8403bc5 100644 (file)
@@ -319,6 +319,13 @@ ip6_full_reass_add_trace (vlib_main_t * vm, vlib_node_runtime_t * node,
   vlib_buffer_t *b = vlib_get_buffer (vm, bi);
   vnet_buffer_opaque_t *vnb = vnet_buffer (b);
   bool is_after_handoff = false;
+  if (pool_is_free_index
+      (vm->trace_main.trace_buffer_pool, vlib_buffer_get_trace_index (b)))
+    {
+      // this buffer's trace is gone
+      b->flags &= ~VLIB_BUFFER_IS_TRACED;
+      return;
+    }
   if (vlib_buffer_get_trace_thread (b) != vm->thread_index)
     {
       is_after_handoff = true;
@@ -508,16 +515,17 @@ again:
 
   if (!clib_bihash_search_48_8 (&rm->hash, &kv->kv, &kv->kv))
     {
-      reass =
-       pool_elt_at_index (rm->per_thread_data
-                          [kv->v.memory_owner_thread_index].pool,
-                          kv->v.reass_index);
       if (vm->thread_index != kv->v.memory_owner_thread_index)
        {
          *do_handoff = 1;
-         return reass;
+         return NULL;
        }
 
+      reass =
+       pool_elt_at_index (rm->per_thread_data
+                          [kv->v.memory_owner_thread_index].pool,
+                          kv->v.reass_index);
+
       if (now > reass->last_heard + rm->timeout)
        {
          ip6_full_reass_on_timeout (vm, node, rm, reass, icmp_bi);
@@ -1519,13 +1527,13 @@ ip6_full_reass_walk_expired (vlib_main_t * vm,
 
          vec_reset_length (pool_indexes_to_free);
           /* *INDENT-OFF* */
-          pool_foreach_index (index, rt->pool, ({
+          pool_foreach_index (index, rt->pool)  {
                                 reass = pool_elt_at_index (rt->pool, index);
                                 if (now > reass->last_heard + rm->timeout)
                                   {
                                     vec_add1 (pool_indexes_to_free, index);
                                   }
-                              }));
+                              }
           /* *INDENT-ON* */
          int *i;
           /* *INDENT-OFF* */
@@ -1664,9 +1672,9 @@ show_ip6_full_reass (vlib_main_t * vm, unformat_input_t * input,
       if (details)
        {
           /* *INDENT-OFF* */
-          pool_foreach (reass, rt->pool, {
+          pool_foreach (reass, rt->pool) {
             vlib_cli_output (vm, "%U", format_ip6_full_reass, vm, reass);
-          });
+          }
           /* *INDENT-ON* */
        }
       sum_reass_n += rt->reass_n;
@@ -1678,6 +1686,10 @@ show_ip6_full_reass (vlib_main_t * vm, unformat_input_t * input,
   vlib_cli_output (vm,
                   "Maximum configured concurrent full IP6 reassemblies per worker-thread: %lu\n",
                   (long unsigned) rm->max_reass_n);
+  vlib_cli_output (vm,
+                  "Maximum configured amount of fragments "
+                  "per full IP6 reassembly: %lu\n",
+                  (long unsigned) rm->max_reass_len);
   vlib_cli_output (vm,
                   "Maximum configured full IP6 reassembly timeout: %lums\n",
                   (long unsigned) rm->timeout_ms);