vlib: fix counter_will_expand prediction 21/30721/2
authorMiklos Tirpak <miklos.tirpak@gmail.com>
Wed, 13 Jan 2021 09:00:38 +0000 (10:00 +0100)
committerOle Tr�an <otroan@employees.org>
Fri, 15 Jan 2021 09:46:23 +0000 (09:46 +0000)
commite700df8eb4f640762d5eced6623bbc2473ad0095
tree77dccc636ed13bae2131cc4d8c86f83ee0132a24
parentd7b9af4addb77612906d4312563039adfc5f0bf3
vlib: fix counter_will_expand prediction

vlib_validate_combined_counter_will_expand() was calling
_vec_resize_will_expand() with wrong arguments, which resulted in false
return value. Apart from the initial call, it never indicated a vector
resize.

The callers relying on this function did not perform a barrier sync
because of the wrong prediction even if the vector got extended by
a subsequent vlib_validate_combined_counter() call.

The fix introduces a new, simplified macro that is easier to call.
vec_resize_will_expand() accepts the same arguments as vec_resize().

Type: fix
Signed-off-by: Miklos Tirpak <miklos.tirpak@gmail.com>
Change-Id: Ib2c2c8afd3e665e0e3d6ae62ff5cfa287acf670f
src/vlib/counter.c
src/vppinfra/vec.h