X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fipsec%2Fipsec_sa.c;h=fc8520d5ebbe5772b14a133cb34702af4910f9fe;hb=eba31ecebed1a7d168da17194cab7a8955761f2b;hp=c4721c7afad0c1a69356d05af9bf7648221f1a7a;hpb=684586786e98bc779e269c0d879a2a4d3f1f4bce;p=vpp.git diff --git a/src/vnet/ipsec/ipsec_sa.c b/src/vnet/ipsec/ipsec_sa.c index c4721c7afad..fc8520d5ebb 100644 --- a/src/vnet/ipsec/ipsec_sa.c +++ b/src/vnet/ipsec/ipsec_sa.c @@ -16,6 +16,16 @@ #include #include +/** + * @brief + * SA packet & bytes counters + */ +vlib_combined_counter_main_t ipsec_sa_counters = { + .name = "SA", + .stat_segment_name = "/net/ipsec/sa", +}; + + static clib_error_t * ipsec_call_add_del_callbacks (ipsec_main_t * im, ipsec_sa_t * sa, u32 sa_index, int is_add) @@ -106,8 +116,12 @@ ipsec_sa_add (u32 id, fib_node_init (&sa->node, FIB_NODE_TYPE_IPSEC_SA); sa_index = sa - im->sad; + vlib_validate_combined_counter (&ipsec_sa_counters, sa_index); + vlib_zero_combined_counter (&ipsec_sa_counters, sa_index); + sa->id = id; sa->spi = spi; + sa->stat_index = sa_index; sa->protocol = proto; sa->crypto_alg = crypto_alg; clib_memcpy (&sa->crypto_key, ck, sizeof (sa->crypto_key));