From e11203e5b8fd61986573e0cba9e47cefcf50e60d Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Tue, 21 Sep 2021 12:34:19 +0000 Subject: ipsec: Record the number of packets lost from an SA Type: feature Gaps in the sequence numbers received on an SA indicate packets that were lost. Gaps are identified using the anti-replay window that records the sequences seen. Publish the number of lost packets in the stats segment at /net/ipsec/sa/lost Signed-off-by: Neale Ranns Change-Id: I8af1c09b7b25a705e18bf82e1623b3ce19e5a74d --- src/vlib/counter.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/vlib') diff --git a/src/vlib/counter.h b/src/vlib/counter.h index 9f5654292b9..56701e8b391 100644 --- a/src/vlib/counter.h +++ b/src/vlib/counter.h @@ -64,6 +64,20 @@ typedef struct /** The number of counters (not the number of per-thread counters) */ u32 vlib_simple_counter_n_counters (const vlib_simple_counter_main_t * cm); +/** Pre-fetch a per-thread simple counter for the given object index */ +always_inline void +vlib_prefetch_simple_counter (const vlib_simple_counter_main_t *cm, + u32 thread_index, u32 index) +{ + counter_t *my_counters; + + /* + * This CPU's index is assumed to already be in cache + */ + my_counters = cm->counters[thread_index]; + clib_prefetch_store (my_counters + index); +} + /** Increment a simple counter @param cm - (vlib_simple_counter_main_t *) simple counter main pointer @param thread_index - (u32) the current cpu index -- cgit 1.2.3-korg