diff options
author | Brian Russell <brian@graphiant.com> | 2021-01-27 11:34:33 +0000 |
---|---|---|
committer | Neale Ranns <neale@graphiant.com> | 2021-02-02 14:58:07 +0000 |
commit | a71ed7869fa59884a61356a997cea81344c19dde (patch) | |
tree | 8dd85694d6366d7b26d70ab514e1161a0391b2b4 /src/vnet/policer/police_inlines.h | |
parent | bad1d35d7d4ed37f046d17fe7a0b6f7d8897d3d6 (diff) |
policer: add counters
Add counters to the policer against each of the 3 possible results:
conform, exceed and violate.
Type: improvement
Signed-off-by: Brian Russell <brian@graphiant.com>
Change-Id: Ia98a2f5655df6873259197d6bbf0ff2709b7d60e
Diffstat (limited to 'src/vnet/policer/police_inlines.h')
-rw-r--r-- | src/vnet/policer/police_inlines.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vnet/policer/police_inlines.h b/src/vnet/policer/police_inlines.h index afcc7724cef..0ed973079a6 100644 --- a/src/vnet/policer/police_inlines.h +++ b/src/vnet/policer/police_inlines.h @@ -68,10 +68,16 @@ vnet_policer_police (vlib_main_t * vm, policer_read_response_type_st *pol; vnet_policer_main_t *pm = &vnet_policer_main; + /* Speculative prefetch assuming a conform result */ + vlib_prefetch_combined_counter (&policer_counters[POLICE_CONFORM], + vm->thread_index, policer_index); + len = vlib_buffer_length_in_chain (vm, b); pol = &pm->policers[policer_index]; col = vnet_police_packet (pol, len, packet_color, time_in_policer_periods); act = pol->action[col]; + vlib_increment_combined_counter (&policer_counters[col], vm->thread_index, + policer_index, 1, len); if (PREDICT_TRUE (act == SSE2_QOS_ACTION_MARK_AND_TRANSMIT)) vnet_policer_mark (b, pol->mark_dscp[col]); |