#include <vnet/pg/pg.h>
#include <vppinfra/error.h>
#include <vnet/ip/ip.h>
-#include <vnet/sr/sr.h>
+#include <vnet/srv6/sr.h>
#include <ioam/ip6/ioam_cache.h>
#include <vnet/ip/ip6_hop_by_hop.h>
#include <vnet/ip/ip6_hop_by_hop_packet.h>
return s;
}
-vlib_node_registration_t ioam_cache_ts_node;
-
#define foreach_cache_ts_error \
_(RECORDED, "ip6 iOAM headers cached")
clib_net_to_host_u32
(tcp0->seq_number) + 1,
no_of_responses, now,
- vm->cpu_index, &pool_index0))
+ vm->thread_index, &pool_index0))
{
cache_ts_added++;
}
hbh0 = (ip6_hop_by_hop_header_t *) (ip0 + 1);
/* $$$ tune, rewrite_length is a multiple of 8 */
- clib_memcpy (hbh0, rewrite, rewrite_length);
+ clib_memcpy_fast (hbh0, rewrite, rewrite_length);
e2e =
(ioam_e2e_cache_option_t *) ((u8 *) hbh0 +
cm->rewrite_pool_index_offset);
- e2e->pool_id = (u8) vm->cpu_index;
+ e2e->pool_id = (u8) vm->thread_index;
e2e->pool_index = pool_index0;
ioam_e2e_id_rewrite_handler ((ioam_e2e_id_option_t *)
((u8 *) e2e +
sizeof (ioam_e2e_cache_option_t)),
- b0);
+ &cm->sr_localsid_ts);
/* Patch the protocol chain, insert the h-b-h (type 0) header */
hbh0->protocol = ip0->protocol;
ip0->protocol = 0;
clib_net_to_host_u32
(tcp1->seq_number) + 1,
no_of_responses, now,
- vm->cpu_index, &pool_index1))
+ vm->thread_index, &pool_index1))
{
cache_ts_added++;
}
hbh1 = (ip6_hop_by_hop_header_t *) (ip1 + 1);
/* $$$ tune, rewrite_length is a multiple of 8 */
- clib_memcpy (hbh1, rewrite, rewrite_length);
+ clib_memcpy_fast (hbh1, rewrite, rewrite_length);
e2e =
(ioam_e2e_cache_option_t *) ((u8 *) hbh1 +
cm->rewrite_pool_index_offset);
- e2e->pool_id = (u8) vm->cpu_index;
+ e2e->pool_id = (u8) vm->thread_index;
e2e->pool_index = pool_index1;
ioam_e2e_id_rewrite_handler ((ioam_e2e_id_option_t *)
((u8 *) e2e +
sizeof (ioam_e2e_cache_option_t)),
- b1);
+ &cm->sr_localsid_ts);
/* Patch the protocol chain, insert the h-b-h (type 0) header */
hbh1->protocol = ip1->protocol;
ip1->protocol = 0;
clib_net_to_host_u32
(tcp0->seq_number) + 1,
no_of_responses, now,
- vm->cpu_index, &pool_index0))
+ vm->thread_index, &pool_index0))
{
cache_ts_added++;
}
hbh0 = (ip6_hop_by_hop_header_t *) (ip0 + 1);
/* $$$ tune, rewrite_length is a multiple of 8 */
- clib_memcpy (hbh0, rewrite, rewrite_length);
+ clib_memcpy_fast (hbh0, rewrite, rewrite_length);
e2e =
(ioam_e2e_cache_option_t *) ((u8 *) hbh0 +
cm->rewrite_pool_index_offset);
- e2e->pool_id = (u8) vm->cpu_index;
+ e2e->pool_id = (u8) vm->thread_index;
e2e->pool_index = pool_index0;
ioam_e2e_id_rewrite_handler ((ioam_e2e_id_option_t *)
((u8 *) e2e +
sizeof (ioam_e2e_cache_option_t)),
- b0);
+ &cm->sr_localsid_ts);
/* Patch the protocol chain, insert the h-b-h (type 0) header */
hbh0->protocol = ip0->protocol;
ip0->protocol = 0;
ioam_cache_main_t *cm = &ioam_cache_main;
int i;
u32 pool_index;
- u32 thread_index = os_get_cpu_number ();
+ u32 thread_index = vlib_get_thread_index ();
u32 count = 0;
for (i = 0; i < vec_len (expired_timers); i++)
vlib_frame_t * f)
{
ioam_cache_main_t *cm = &ioam_cache_main;
- u32 my_thread_index = os_get_cpu_number ();
+ u32 my_thread_index = vlib_get_thread_index ();
struct timespec ts, tsrem;
tw_timer_expire_timers_16t_2w_512sl (&cm->timer_wheels[my_thread_index],