From eba31ecebed1a7d168da17194cab7a8955761f2b Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Sun, 17 Feb 2019 18:04:27 +0000 Subject: IPSEC: move SA counters into the stats segment 1) stats are accessed via the stat segment which is more condusive to monitoring 2) stats are accurate in the presence of multiple threads. There's no guarantee that an SA is access from only one worker. Change-Id: Id5e217ea253ddfc9480aaedb0d008dea031b1148 Signed-off-by: Neale Ranns --- test/vpp_ipsec.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/vpp_ipsec.py') diff --git a/test/vpp_ipsec.py b/test/vpp_ipsec.py index 917574ee977..0241fdf02b6 100644 --- a/test/vpp_ipsec.py +++ b/test/vpp_ipsec.py @@ -213,7 +213,7 @@ class VppIpsecSA(VppObject): self.tun_dst = ip_address(text_type(tun_dst)) def add_vpp_config(self): - self.test.vapi.ipsec_sad_entry_add_del( + r = self.test.vapi.ipsec_sad_entry_add_del( self.id, self.spi, self.integ_alg, @@ -224,6 +224,7 @@ class VppIpsecSA(VppObject): (self.tun_src if self.tun_src else []), (self.tun_dst if self.tun_dst else []), flags=self.flags) + self.stat_index = r.stat_index self.test.registry.register(self, self.test.logger) def remove_vpp_config(self): @@ -252,3 +253,7 @@ class VppIpsecSA(VppObject): if b.entry.sad_id == self.id: return True return False + + def get_stats(self): + c = self.test.statistics.get_counter("/net/ipsec/sa") + return c[0][self.stat_index] -- cgit 1.2.3-korg