diff options
author | Damjan Marion <damarion@cisco.com> | 2022-03-01 15:51:18 +0100 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2022-03-09 13:51:31 +0000 |
commit | 8973b07eecbbfe23a5267975f8052a5c6339c756 (patch) | |
tree | fe4d3507ff24c18743d3241cd9ab049ee2add062 /src/plugins/lacp | |
parent | 317cace6185ae134d78a38e1a20249baf751035e (diff) |
stats: refactor
Type: refactor
Change-Id: Ifd533a095d979dc55bfbe5fac7e0b7510a4d900c
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/lacp')
-rw-r--r-- | src/plugins/lacp/input.c | 14 | ||||
-rw-r--r-- | src/plugins/lacp/lacp.c | 26 |
2 files changed, 20 insertions, 20 deletions
diff --git a/src/plugins/lacp/input.c b/src/plugins/lacp/input.c index ebca2ad9185..3997af897eb 100644 --- a/src/plugins/lacp/input.c +++ b/src/plugins/lacp/input.c @@ -16,7 +16,7 @@ #define _GNU_SOURCE #include <vnet/bonding/node.h> #include <lacp/node.h> -#include <vpp/stats/stat_segment.h> +#include <vlib/stats/stats.h> static int lacp_packet_scan (vlib_main_t * vm, member_if_t * mif) @@ -213,12 +213,12 @@ lacp_input (vlib_main_t * vm, vlib_buffer_t * b0, u32 bi0) /* Actually scan the packet */ e = lacp_packet_scan (vm, mif); bif = bond_get_bond_if_by_dev_instance (mif->bif_dev_instance); - stat_segment_set_state_counter (bm->stats[bif->sw_if_index] - [mif->sw_if_index].actor_state, - mif->actor.state); - stat_segment_set_state_counter (bm->stats[bif->sw_if_index] - [mif->sw_if_index].partner_state, - mif->partner.state); + vlib_stats_set_gauge ( + bm->stats[bif->sw_if_index][mif->sw_if_index].actor_state, + mif->actor.state); + vlib_stats_set_gauge ( + bm->stats[bif->sw_if_index][mif->sw_if_index].partner_state, + mif->partner.state); mif->last_packet_signature_valid = 1; mif->last_packet_signature = last_packet_signature; } diff --git a/src/plugins/lacp/lacp.c b/src/plugins/lacp/lacp.c index 44a32aa23a9..ad7710266f9 100644 --- a/src/plugins/lacp/lacp.c +++ b/src/plugins/lacp/lacp.c @@ -21,7 +21,7 @@ #include <vppinfra/hash.h> #include <vnet/bonding/node.h> #include <lacp/node.h> -#include <vpp/stats/stat_segment.h> +#include <vlib/stats/stats.h> lacp_main_t lacp_main; @@ -173,16 +173,16 @@ lacp_periodic (vlib_main_t * vm) if (actor_state != mif->actor.state) { bif = bond_get_bond_if_by_dev_instance (mif->bif_dev_instance); - stat_segment_set_state_counter (bm->stats[bif->sw_if_index] - [mif->sw_if_index].actor_state, - mif->actor.state); + vlib_stats_set_gauge ( + bm->stats[bif->sw_if_index][mif->sw_if_index].actor_state, + mif->actor.state); } if (partner_state != mif->partner.state) { bif = bond_get_bond_if_by_dev_instance (mif->bif_dev_instance); - stat_segment_set_state_counter (bm->stats[bif->sw_if_index] - [mif->sw_if_index].partner_state, - mif->partner.state); + vlib_stats_set_gauge ( + bm->stats[bif->sw_if_index][mif->sw_if_index].partner_state, + mif->partner.state); } } /* *INDENT-ON* */ @@ -380,12 +380,12 @@ lacp_init_state_machines (vlib_main_t * vm, member_if_t * mif) lacp_init_mux_machine (vm, mif); lacp_init_ptx_machine (vm, mif); lacp_init_rx_machine (vm, mif); - stat_segment_set_state_counter (bm->stats[bif->sw_if_index] - [mif->sw_if_index].actor_state, - mif->actor.state); - stat_segment_set_state_counter (bm->stats[bif->sw_if_index] - [mif->sw_if_index].partner_state, - mif->partner.state); + vlib_stats_set_gauge ( + bm->stats[bif->sw_if_index][mif->sw_if_index].actor_state, + mif->actor.state); + vlib_stats_set_gauge ( + bm->stats[bif->sw_if_index][mif->sw_if_index].partner_state, + mif->partner.state); } VLIB_INIT_FUNCTION (lacp_periodic_init); |