From 89cd74427277692f77f2d38e79495592ad440a68 Mon Sep 17 00:00:00 2001 From: Brian Russell Date: Tue, 19 Jan 2021 16:46:08 +0000 Subject: policer: add thread index to policer Add a thread index field to the policer structure. The policer is not thread safe. The thread index will be used to tie it to one worker thread and other workers can use thread handoff. Type: improvement Signed-off-by: Brian Russell Change-Id: I650e983a9ed800bf660d6f06368717484c4a83bf --- src/vnet/policer/policer.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/vnet/policer/policer.c') diff --git a/src/vnet/policer/policer.c b/src/vnet/policer/policer.c index 9611fe0fa4e..7ad87a6ebdf 100644 --- a/src/vnet/policer/policer.c +++ b/src/vnet/policer/policer.c @@ -87,6 +87,7 @@ policer_add_del (vlib_main_t * vm, pi = policer - pm->policers; hash_set_mem (pm->policer_index_by_name, name, pi); *policer_index = pi; + policer->thread_index = ~0; } else { -- cgit 1.2.3-korg