map: use ip6-full-reassembly instead of own code
[vpp.git] / src / vlib / main.c
index 1c6b9ba..dc11128 100644 (file)
@@ -52,8 +52,6 @@ CJ_GLOBAL_LOG_PROTOTYPE;
    speculative vector enqueues which overflow vector data in next frame. */
 #define VLIB_FRAME_SIZE_ALLOC (VLIB_FRAME_SIZE + 4)
 
-u32 wraps;
-
 always_inline u32
 vlib_frame_bytes (u32 n_scalar_bytes, u32 n_vector_bytes)
 {
@@ -1376,6 +1374,12 @@ dispatch_pending_node (vlib_main_t * vm, uword pending_frame_index,
                                   VLIB_NODE_TYPE_INTERNAL,
                                   VLIB_NODE_STATE_POLLING,
                                   f, last_time_stamp);
+  /* Internal node vector-rate accounting, for summary stats */
+  vm->internal_node_vectors += f->n_vectors;
+  vm->internal_node_calls++;
+  vm->internal_node_last_vectors_per_main_loop =
+    (f->n_vectors > vm->internal_node_last_vectors_per_main_loop) ?
+    f->n_vectors : vm->internal_node_last_vectors_per_main_loop;
 
   f->frame_flags &= ~(VLIB_FRAME_PENDING | VLIB_FRAME_NO_APPEND);
 
@@ -1915,7 +1919,6 @@ vlib_main_or_worker_loop (vlib_main_t * vm, int is_main)
            }
        }
       vlib_increment_main_loop_counter (vm);
-
       /* Record time stamp in case there are no enabled nodes and above
          calls do not update time stamp. */
       cpu_time_now = clib_cpu_time_now ();
@@ -2202,7 +2205,7 @@ vlib_pcap_dispatch_trace_configure (vlib_pcap_dispatch_trace_args_t * a)
     return -81;                        /* VNET_API_ERROR_VALUE_EXIST */
 
   /* Change number of packets to capture while capturing */
-  if (vm->dispatch_pcap_enable
+  if (vm->dispatch_pcap_enable && a->enable
       && (pm->n_packets_to_capture != a->packets_to_capture))
     return -8;                 /* VNET_API_ERROR_INVALID_VALUE_2 */
 
@@ -2254,7 +2257,7 @@ vlib_pcap_dispatch_trace_configure (vlib_pcap_dispatch_trace_args_t * a)
          vlib_cli_output (vm, "Write %d packets to %s, and stop capture...",
                           pm->n_packets_captured, pm->file_name);
          error = pcap_write (pm);
-         if (pm->file_descriptor >= 0)
+         if (pm->flags & PCAP_MAIN_INIT_DONE)
            pcap_close (pm);
          /* Report I/O errors... */
          if (error)