From 72e31bc2d9b910147c09e1c329713fccc873a018 Mon Sep 17 00:00:00 2001 From: Vladimir Isaev Date: Tue, 4 Feb 2020 11:54:27 +0300 Subject: stats: fix state counter removal Avoid using vec_del1() for directory vector to keep indexes valid all the time. There are state counters for each slave in LACP bond mode which can be dynamically created and removed. Vector index is used to access these counters. But also vec_del1() is used to remove counter from vector. This function changes the index of the last element, so after this we are unable to access ex-last element using old index. As a result it is not possible to add-del-add two interfaces to the LACP bond: DBGvpp# create bond mode lacp BondEthernet0 DBGvpp# create packet-generator interface pg1 DBGvpp# create packet-generator interface pg2 DBGvpp# bond add BondEthernet0 pg1 DBGvpp# bond add BondEthernet0 pg2 DBGvpp# bond del pg1 DBGvpp# bond del pg2 DBGvpp# bond add BondEthernet0 pg1 DBGvpp# bond add BondEthernet0 pg2 bond add: /if/lacp/1/3/partner-state is already register Type: fix Signed-off-by: Vladimir Isaev Change-Id: I2c86e13905eefdef6233369cd4ab5c1b53d123bd --- src/vpp-api/client/stat_client.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/vpp-api') diff --git a/src/vpp-api/client/stat_client.c b/src/vpp-api/client/stat_client.c index 9a7a0e59daa..9c6ff33c2d1 100644 --- a/src/vpp-api/client/stat_client.c +++ b/src/vpp-api/client/stat_client.c @@ -274,6 +274,9 @@ copy_data (stat_segment_directory_entry_t * ep, stat_client_main_t * sm) } break; + case STAT_DIR_TYPE_EMPTY: + break; + default: fprintf (stderr, "Unknown type: %d\n", ep->type); } -- cgit 1.2.3-korg