diff options
author | Radu Nicolau <radu.nicolau@intel.com> | 2020-12-02 11:45:11 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2021-01-25 08:37:40 +0000 |
commit | 5a48b3b9d88fa2793793e2bf3db8bf156fe2951f (patch) | |
tree | 2bca0953b744b4f37265924cc90fa1033e04dc3c /src/vlib/node_init.c | |
parent | 78de92de0ddb5de67ceb70bd30ff6dfae345baf1 (diff) |
vlib: startup multi-arch variant configuration fix for interfaces
Propagate the multi-arch variant selection to interfaces.
Type: fix
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Change-Id: I99c4a7896f172f0d14d2ded22a27383825529a7d
Diffstat (limited to 'src/vlib/node_init.c')
-rw-r--r-- | src/vlib/node_init.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/vlib/node_init.c b/src/vlib/node_init.c index 47d288c6ef0..232eeb35e3c 100644 --- a/src/vlib/node_init.c +++ b/src/vlib/node_init.c @@ -40,6 +40,7 @@ #include <sys/types.h> #include <fcntl.h> #include <vlib/vlib.h> +#include <vnet/vnet.h> typedef struct _vlib_node_march_variant { @@ -89,9 +90,9 @@ unformat_vlib_node_variant (unformat_input_t * input, va_list * args) } static_always_inline void -vlib_update_nr_variant_default (vlib_node_registration_t * nr, u8 * variant) +vlib_update_nr_variant_default (vlib_node_fn_registration_t * fnr, + u8 * variant) { - vlib_node_fn_registration_t *fnr = nr->node_fn_registrations; vlib_node_fn_registration_t *p_reg = 0; vlib_node_fn_registration_t *v_reg = 0; u32 tmp; @@ -127,6 +128,8 @@ vlib_early_node_config (vlib_main_t * vm, unformat_input_t * input) { clib_error_t *error = 0; vlib_node_registration_t *nr, **all; + vnet_device_class_t *c; + vnet_main_t *vnm = vnet_get_main (); unformat_input_t sub_input; uword *hash = 0, *p; u8 *variant = 0; @@ -161,10 +164,20 @@ vlib_early_node_config (vlib_main_t * vm, unformat_input_t * input) nr = vm->node_main.node_registrations; while (nr) { - vlib_update_nr_variant_default (nr, variant); + vlib_update_nr_variant_default (nr->node_fn_registrations, + variant); nr = nr->next_registration; } + /* also apply it to interfaces */ + c = vnm->device_class_registrations; + while (c) + { + vlib_update_nr_variant_default (c->tx_fn_registrations, + variant); + c = c->next_class_registration; + } + vec_free (variant); } } @@ -192,7 +205,8 @@ vlib_early_node_config (vlib_main_t * vm, unformat_input_t * input) "please specify a valid node variant"); vec_add1 (variant, 0); - vlib_update_nr_variant_default (nr, variant); + vlib_update_nr_variant_default (nr->node_fn_registrations, + variant); vec_free (variant); } |