Add adjacency counters to the stats segment
[vpp.git] / src / vnet / srv6 / sr_localsid.c
index 09c336e..58fdbfd 100755 (executable)
@@ -887,7 +887,7 @@ sr_localsid_d_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
   from = vlib_frame_vector_args (from_frame);
   n_left_from = from_frame->n_vectors;
   next_index = node->cached_next_index;
-  u32 thread_index = vlib_get_thread_index ();
+  u32 thread_index = vm->thread_index;
 
   while (n_left_from > 0)
     {
@@ -946,13 +946,13 @@ sr_localsid_d_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
                               vnet_buffer (b0)->ip.adj_index[VLIB_TX]);
          ls1 =
            pool_elt_at_index (sm->localsids,
-                              vnet_buffer (b0)->ip.adj_index[VLIB_TX]);
+                              vnet_buffer (b1)->ip.adj_index[VLIB_TX]);
          ls2 =
            pool_elt_at_index (sm->localsids,
-                              vnet_buffer (b0)->ip.adj_index[VLIB_TX]);
+                              vnet_buffer (b2)->ip.adj_index[VLIB_TX]);
          ls3 =
            pool_elt_at_index (sm->localsids,
-                              vnet_buffer (b0)->ip.adj_index[VLIB_TX]);
+                              vnet_buffer (b3)->ip.adj_index[VLIB_TX]);
 
          ip0 = vlib_buffer_get_current (b0);
          ip1 = vlib_buffer_get_current (b1);
@@ -1190,7 +1190,7 @@ sr_localsid_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
   from = vlib_frame_vector_args (from_frame);
   n_left_from = from_frame->n_vectors;
   next_index = node->cached_next_index;
-  u32 thread_index = vlib_get_thread_index ();
+  u32 thread_index = vm->thread_index;
 
   while (n_left_from > 0)
     {
@@ -1259,13 +1259,13 @@ sr_localsid_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
                               vnet_buffer (b0)->ip.adj_index[VLIB_TX]);
          ls1 =
            pool_elt_at_index (sm->localsids,
-                              vnet_buffer (b0)->ip.adj_index[VLIB_TX]);
+                              vnet_buffer (b1)->ip.adj_index[VLIB_TX]);
          ls2 =
            pool_elt_at_index (sm->localsids,
-                              vnet_buffer (b0)->ip.adj_index[VLIB_TX]);
+                              vnet_buffer (b2)->ip.adj_index[VLIB_TX]);
          ls3 =
            pool_elt_at_index (sm->localsids,
-                              vnet_buffer (b0)->ip.adj_index[VLIB_TX]);
+                              vnet_buffer (b3)->ip.adj_index[VLIB_TX]);
 
          end_srh_processing (node, b0, ip0, sr0, ls0, &next0, ls0->end_psp,
                              prev0);