summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2021-05-14 15:48:52 +0200
committerFlorin Coras <florin.coras@gmail.com>2021-05-14 15:45:05 +0000
commitc389de2aa8819030f8a9a15f2e3d67ca853bb43b (patch)
treedd45d0188567de6a899b538e5cb7d2fbb0de495e /src/vnet/interface
parent4fca744234286374a24afd31507be809383fd763 (diff)
interface: update tx queue runtime if vector size changes
Fixes issue which causes crash in case when VPP only runs with main thread. Type: fix Change-Id: Ia0ca973bb7e7ff81f15b37764ae248e2502bdcec Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/interface')
-rw-r--r--src/vnet/interface/runtime.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/vnet/interface/runtime.c b/src/vnet/interface/runtime.c
index e318e43dd01..7ec1049d8c7 100644
--- a/src/vnet/interface/runtime.c
+++ b/src/vnet/interface/runtime.c
@@ -169,7 +169,11 @@ vnet_hw_if_update_runtime_data (vnet_main_t *vnm, u32 hw_if_index)
new_out_runtimes =
vec_dup_aligned (hi->output_node_thread_runtimes, CLIB_CACHE_LINE_BYTES);
- vec_validate_aligned (new_out_runtimes, n_threads, CLIB_CACHE_LINE_BYTES);
+ vec_validate_aligned (new_out_runtimes, n_threads - 1,
+ CLIB_CACHE_LINE_BYTES);
+
+ if (vec_len (hi->output_node_thread_runtimes) != vec_len (new_out_runtimes))
+ something_changed_on_tx = 1;
for (int i = 0; i < vec_len (hi->tx_queue_indices); i++)
{