From 06e0085a6721d0c3650c9af2cae9b5aa2dc72f88 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Sun, 31 Oct 2021 19:56:44 +0100 Subject: ip: fix build without vector unit Change-Id: I102f84d6d72a7f17e62fb8c16a1d4a3234753476 Type: fix Signed-off-by: Damjan Marion --- src/vnet/ip/ip4_source_and_port_range_check.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/vnet') diff --git a/src/vnet/ip/ip4_source_and_port_range_check.c b/src/vnet/ip/ip4_source_and_port_range_check.c index 4c311eb8335..2edbeeddf10 100644 --- a/src/vnet/ip/ip4_source_and_port_range_check.c +++ b/src/vnet/ip/ip4_source_and_port_range_check.c @@ -99,7 +99,9 @@ static inline u32 check_adj_port_range_x1 (const protocol_port_range_dpo_t * ppr_dpo, u16 dst_port, u32 next) { +#ifdef CLIB_HAVE_VEC128 u16x8 key = u16x8_splat (dst_port); +#endif int i; if (NULL == ppr_dpo || dst_port == 0) @@ -107,9 +109,20 @@ check_adj_port_range_x1 (const protocol_port_range_dpo_t * ppr_dpo, for (i = 0; i < ppr_dpo->n_used_blocks; i++) +#ifdef CLIB_HAVE_VEC128 if (!u16x8_is_all_zero ((ppr_dpo->blocks[i].low.as_u16x8 <= key) & (ppr_dpo->blocks[i].hi.as_u16x8 >= key))) return next; +#else + { + for (int j = 0; j < 8; j++) + { + if ((ppr_dpo->blocks[i].low.as_u16[j] <= dst_port) && + (ppr_dpo->blocks[i].hi.as_u16[j] >= dst_port)) + return next; + } + }; +#endif return IP4_SOURCE_AND_PORT_RANGE_CHECK_NEXT_DROP; } -- cgit 1.2.3-korg