summaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
authorRadu Nicolau <radu.nicolau@intel.com>2020-12-02 11:45:11 +0000
committerRay Kinsella <mdr@ashroe.eu>2021-01-25 10:07:10 +0000
commit5f48784da3ac653b3ff0609469ebf9b99fa34322 (patch)
tree3bfd053ec64b7dc453e13e449d383bafaebbe35f /src/vppinfra
parent9479838d080ce89d764668c2234c89b14a1ad2e4 (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 (cherry picked from commit 5a48b3b9d88fa2793793e2bf3db8bf156fe2951f)
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/cpu.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/vppinfra/cpu.h b/src/vppinfra/cpu.h
index 750b3934df9..8e127fe5480 100644
--- a/src/vppinfra/cpu.h
+++ b/src/vppinfra/cpu.h
@@ -84,9 +84,29 @@ clib_march_select_fn_ptr (clib_march_fn_registration * r)
return rv;
}
+static_always_inline void *
+clib_march_select_fn_ptr_by_name (clib_march_fn_registration * r, char *name)
+{
+ void *rv = 0;
+
+ while (r)
+ {
+ if (strncmp (name, r->name, vec_len (r->name) - 1) == 0)
+ {
+ rv = r->function;
+ break;
+ }
+ r = r->next;
+ }
+ return rv;
+}
+
#define CLIB_MARCH_FN_POINTER(fn) \
clib_march_select_fn_ptr (fn##_march_fn_registrations);
+#define CLIB_MARCH_FN_POINTER_BY_NAME(fn, name) \
+ clib_march_select_fn_ptr_by_name (fn##_march_fn_registrations, name);
+
#define _CLIB_MARCH_FN_REGISTRATION(fn) \
static clib_march_fn_registration \
CLIB_MARCH_SFX(fn##_march_fn_registration) = \