X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fip%2Fip4_source_and_port_range_check.c;h=2edbeeddf1030108ef13088629a54d4da29d2b78;hb=f840880c2fd8fbd6acfa79948224aafe6e4a62d1;hp=00ab51e244006bc15c3e3a2e79afed77059c179c;hpb=a32416ded5aef52015155ce405708d98838be6b1;p=vpp.git 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 00ab51e2440..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; } @@ -749,7 +762,8 @@ set_ip_source_and_port_range_check_fn (vlib_main_t * vm, * @cliexend * * Example of how to enable range checking on TX: - * @cliexcmd{set interface ip source-and-port-range-check GigabitEthernet2/0/0 udp-in-vrf 7} + * @cliexcmd{set interface ip source-and-port-range-check GigabitEthernet2/0/0 + * udp-in-vrf 7} * * Example of graph node after range checking is enabled: * @cliexstart{show vlib graph ip4-source-and-port-range-check-tx} @@ -758,7 +772,7 @@ set_ip_source_and_port_range_check_fn (vlib_main_t * vm, * interface-output [1] * @cliexend * - * Example of how to display the features enabed on an interface: + * Example of how to display the features enabled on an interface: * @cliexstart{show ip interface features GigabitEthernet2/0/0} * IP feature paths configured on GigabitEthernet2/0/0... * @@ -1367,7 +1381,7 @@ show_source_and_port_range_check_fn (vlib_main_t * vm, * @cliexstart{show ip source-and-port-range-check vrf 7 172.16.2.0} * 172.16.2.0: 23 - 101 * @cliexend - * Example of how to test to determine of a given Pv4 address and port + * Example of how to test to determine of a given iPv4 address and port * are being validated: * @cliexstart{show ip source-and-port-range-check vrf 7 172.16.2.2 port 23} * 172.16.2.2 port 23 PASS