Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015 Cisco and/or its affiliates. |
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | * you may not use this file except in compliance with the License. |
| 5 | * You may obtain a copy of the License at: |
| 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
| 9 | * Unless required by applicable law or agreed to in writing, software |
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | * See the License for the specific language governing permissions and |
| 13 | * limitations under the License. |
| 14 | */ |
| 15 | #include <vnet/ip/ip.h> |
| 16 | #include <vnet/classify/vnet_classify.h> |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 17 | #include <vnet/classify/in_out_acl.h> |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 18 | |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 19 | typedef struct |
| 20 | { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 21 | u32 sw_if_index; |
| 22 | u32 next_index; |
| 23 | u32 table_index; |
| 24 | u32 offset; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 25 | } |
| 26 | ip_in_out_acl_trace_t; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 27 | |
| 28 | /* packet trace format function */ |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 29 | static u8 * |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 30 | format_ip_in_out_acl_trace (u8 * s, u32 is_output, va_list * args) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 31 | { |
| 32 | CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *); |
| 33 | CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *); |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 34 | ip_in_out_acl_trace_t *t = va_arg (*args, ip_in_out_acl_trace_t *); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 35 | |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 36 | s = format (s, "%s: sw_if_index %d, next_index %d, table %d, offset %d", |
| 37 | is_output ? "OUTACL" : "INACL", |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 38 | t->sw_if_index, t->next_index, t->table_index, t->offset); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 39 | return s; |
| 40 | } |
| 41 | |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 42 | static u8 * |
| 43 | format_ip_inacl_trace (u8 * s, va_list * args) |
| 44 | { |
| 45 | return format_ip_in_out_acl_trace (s, 0 /* is_output */ , args); |
| 46 | } |
| 47 | |
| 48 | static u8 * |
| 49 | format_ip_outacl_trace (u8 * s, va_list * args) |
| 50 | { |
| 51 | return format_ip_in_out_acl_trace (s, 1 /* is_output */ , args); |
| 52 | } |
| 53 | |
Filip Tehlar | 26ea14e | 2019-03-11 05:30:21 -0700 | [diff] [blame] | 54 | extern vlib_node_registration_t ip4_inacl_node; |
| 55 | extern vlib_node_registration_t ip4_outacl_node; |
| 56 | extern vlib_node_registration_t ip6_inacl_node; |
| 57 | extern vlib_node_registration_t ip6_outacl_node; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 58 | |
| 59 | #define foreach_ip_inacl_error \ |
| 60 | _(MISS, "input ACL misses") \ |
| 61 | _(HIT, "input ACL hits") \ |
| 62 | _(CHAIN_HIT, "input ACL hits after chain walk") |
| 63 | |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 64 | #define foreach_ip_outacl_error \ |
| 65 | _(MISS, "output ACL misses") \ |
| 66 | _(HIT, "output ACL hits") \ |
| 67 | _(CHAIN_HIT, "output ACL hits after chain walk") |
| 68 | |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 69 | typedef enum |
| 70 | { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 71 | #define _(sym,str) IP_INACL_ERROR_##sym, |
| 72 | foreach_ip_inacl_error |
| 73 | #undef _ |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 74 | IP_INACL_N_ERROR, |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 75 | } |
| 76 | ip_inacl_error_t; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 77 | |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 78 | static char *ip_inacl_error_strings[] = { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 79 | #define _(sym,string) string, |
| 80 | foreach_ip_inacl_error |
| 81 | #undef _ |
| 82 | }; |
| 83 | |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 84 | typedef enum |
| 85 | { |
| 86 | #define _(sym,str) IP_OUTACL_ERROR_##sym, |
| 87 | foreach_ip_outacl_error |
| 88 | #undef _ |
| 89 | IP_OUTACL_N_ERROR, |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 90 | } |
| 91 | ip_outacl_error_t; |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 92 | |
| 93 | static char *ip_outacl_error_strings[] = { |
| 94 | #define _(sym,string) string, |
| 95 | foreach_ip_outacl_error |
| 96 | #undef _ |
| 97 | }; |
| 98 | |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 99 | static_always_inline void |
Arthur de Kerhor | 1031098 | 2021-12-22 10:58:30 +0100 | [diff] [blame] | 100 | ip_in_out_acl_inline_trace ( |
| 101 | vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, |
| 102 | vlib_buffer_t **b, u16 *next, u32 n_left, u32 *hits__, u32 *misses__, |
| 103 | u32 *chain_hits__, const vlib_error_t error_none, |
| 104 | const vlib_error_t error_deny, const vlib_error_t error_miss, |
| 105 | vnet_classify_table_t *tables, const u32 *table_index_by_sw_if_index, |
| 106 | u32 *fib_index_by_sw_if_index, vnet_config_main_t *cm, |
| 107 | const vlib_rx_or_tx_t way, const int is_output, const int do_trace) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 108 | { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 109 | f64 now = vlib_time_now (vm); |
| 110 | u32 hits = 0; |
| 111 | u32 misses = 0; |
| 112 | u32 chain_hits = 0; |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 113 | u32 n_next_nodes = node->n_next_nodes; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 114 | u8 *h[4]; |
| 115 | u32 sw_if_index[4]; |
| 116 | u32 table_index[4]; |
| 117 | vnet_classify_table_t *t[4] = { 0, 0 }; |
| 118 | u64 hash[4]; |
| 119 | |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 120 | /* calculate hashes for b[0] & b[1] */ |
| 121 | if (n_left >= 2) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 122 | { |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 123 | /* ~0 is used as a wildcard to say 'always use sw_if_index 0' |
| 124 | * aka local0. It is used when we do not care about the sw_if_index, as |
| 125 | * when punting */ |
| 126 | sw_if_index[2] = ~0 == way ? 0 : vnet_buffer (b[0])->sw_if_index[way]; |
| 127 | sw_if_index[3] = ~0 == way ? 0 : vnet_buffer (b[1])->sw_if_index[way]; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 128 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 129 | table_index[2] = table_index_by_sw_if_index[sw_if_index[2]]; |
| 130 | table_index[3] = table_index_by_sw_if_index[sw_if_index[3]]; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 131 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 132 | t[2] = pool_elt_at_index (tables, table_index[2]); |
| 133 | t[3] = pool_elt_at_index (tables, table_index[3]); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 134 | |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 135 | if (t[2]->current_data_flag == CLASSIFY_FLAG_USE_CURR_DATA) |
| 136 | h[2] = |
| 137 | (void *) vlib_buffer_get_current (b[0]) + t[2]->current_data_offset; |
Steve Shin | 25e26dc | 2016-11-08 10:47:10 -0800 | [diff] [blame] | 138 | else |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 139 | h[2] = b[0]->data; |
| 140 | |
| 141 | if (t[3]->current_data_flag == CLASSIFY_FLAG_USE_CURR_DATA) |
| 142 | h[3] = |
| 143 | (void *) vlib_buffer_get_current (b[1]) + t[3]->current_data_offset; |
| 144 | else |
| 145 | h[3] = b[1]->data; |
Steve Shin | 25e26dc | 2016-11-08 10:47:10 -0800 | [diff] [blame] | 146 | |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 147 | if (is_output) |
| 148 | { |
| 149 | /* Save the rewrite length, since we are using the l2_classify struct */ |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 150 | vnet_buffer (b[0])->l2_classify.pad.l2_len = |
| 151 | vnet_buffer (b[0])->ip.save_rewrite_length; |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 152 | /* advance the match pointer so the matching happens on IP header */ |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 153 | h[2] += vnet_buffer (b[0])->l2_classify.pad.l2_len; |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 154 | |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 155 | /* Save the rewrite length, since we are using the l2_classify struct */ |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 156 | vnet_buffer (b[1])->l2_classify.pad.l2_len = |
| 157 | vnet_buffer (b[1])->ip.save_rewrite_length; |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 158 | /* advance the match pointer so the matching happens on IP header */ |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 159 | h[3] += vnet_buffer (b[1])->l2_classify.pad.l2_len; |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 160 | } |
| 161 | |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 162 | hash[2] = vnet_classify_hash_packet_inline (t[2], (u8 *) h[2]); |
| 163 | hash[3] = vnet_classify_hash_packet_inline (t[3], (u8 *) h[3]); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 164 | |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 165 | vnet_buffer (b[0])->l2_classify.hash = hash[2]; |
| 166 | vnet_buffer (b[1])->l2_classify.hash = hash[3]; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 167 | |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 168 | vnet_buffer (b[0])->l2_classify.table_index = table_index[2]; |
| 169 | vnet_buffer (b[1])->l2_classify.table_index = table_index[3]; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 170 | |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 171 | vnet_buffer (b[0])->l2_classify.opaque_index = ~0; |
| 172 | vnet_buffer (b[1])->l2_classify.opaque_index = ~0; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 173 | |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 174 | vnet_classify_prefetch_bucket (t[2], |
| 175 | vnet_buffer (b[0])->l2_classify.hash); |
| 176 | vnet_classify_prefetch_bucket (t[3], |
| 177 | vnet_buffer (b[1])->l2_classify.hash); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 178 | } |
| 179 | |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 180 | while (n_left >= 2) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 181 | { |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 182 | vnet_classify_entry_t *e[2] = { 0, 0 }; |
| 183 | u32 _next[2] = { ACL_NEXT_INDEX_DENY, ACL_NEXT_INDEX_DENY }; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 184 | |
| 185 | h[0] = h[2]; |
| 186 | h[1] = h[3]; |
| 187 | t[0] = t[2]; |
| 188 | t[1] = t[3]; |
| 189 | |
| 190 | sw_if_index[0] = sw_if_index[2]; |
| 191 | sw_if_index[1] = sw_if_index[3]; |
| 192 | |
| 193 | table_index[0] = table_index[2]; |
| 194 | table_index[1] = table_index[3]; |
| 195 | |
| 196 | hash[0] = hash[2]; |
| 197 | hash[1] = hash[3]; |
| 198 | |
| 199 | /* prefetch next iteration */ |
| 200 | if (n_left >= 6) |
| 201 | { |
| 202 | vlib_prefetch_buffer_header (b[4], LOAD); |
| 203 | vlib_prefetch_buffer_header (b[5], LOAD); |
| 204 | |
Damjan Marion | af7fb04 | 2021-07-15 11:54:41 +0200 | [diff] [blame] | 205 | clib_prefetch_load (b[4]->data); |
| 206 | clib_prefetch_load (b[5]->data); |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 207 | } |
| 208 | |
| 209 | /* calculate hashes for b[2] & b[3] */ |
| 210 | if (n_left >= 4) |
| 211 | { |
| 212 | sw_if_index[2] = |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 213 | ~0 == way ? 0 : vnet_buffer (b[2])->sw_if_index[way]; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 214 | sw_if_index[3] = |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 215 | ~0 == way ? 0 : vnet_buffer (b[3])->sw_if_index[way]; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 216 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 217 | table_index[2] = table_index_by_sw_if_index[sw_if_index[2]]; |
| 218 | table_index[3] = table_index_by_sw_if_index[sw_if_index[3]]; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 219 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 220 | t[2] = pool_elt_at_index (tables, table_index[2]); |
| 221 | t[3] = pool_elt_at_index (tables, table_index[3]); |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 222 | |
| 223 | if (t[2]->current_data_flag == CLASSIFY_FLAG_USE_CURR_DATA) |
| 224 | h[2] = |
| 225 | (void *) vlib_buffer_get_current (b[2]) + |
| 226 | t[2]->current_data_offset; |
| 227 | else |
| 228 | h[2] = b[2]->data; |
| 229 | |
| 230 | if (t[3]->current_data_flag == CLASSIFY_FLAG_USE_CURR_DATA) |
| 231 | h[3] = |
| 232 | (void *) vlib_buffer_get_current (b[3]) + |
| 233 | t[3]->current_data_offset; |
| 234 | else |
| 235 | h[3] = b[3]->data; |
| 236 | |
| 237 | if (is_output) |
| 238 | { |
| 239 | /* Save the rewrite length, since we are using the l2_classify struct */ |
| 240 | vnet_buffer (b[2])->l2_classify.pad.l2_len = |
| 241 | vnet_buffer (b[2])->ip.save_rewrite_length; |
| 242 | /* advance the match pointer so the matching happens on IP header */ |
| 243 | h[2] += vnet_buffer (b[2])->l2_classify.pad.l2_len; |
| 244 | |
| 245 | /* Save the rewrite length, since we are using the l2_classify struct */ |
| 246 | vnet_buffer (b[3])->l2_classify.pad.l2_len = |
| 247 | vnet_buffer (b[3])->ip.save_rewrite_length; |
| 248 | /* advance the match pointer so the matching happens on IP header */ |
| 249 | h[3] += vnet_buffer (b[3])->l2_classify.pad.l2_len; |
| 250 | } |
| 251 | |
| 252 | hash[2] = vnet_classify_hash_packet_inline (t[2], (u8 *) h[2]); |
| 253 | hash[3] = vnet_classify_hash_packet_inline (t[3], (u8 *) h[3]); |
| 254 | |
| 255 | vnet_buffer (b[2])->l2_classify.hash = hash[2]; |
| 256 | vnet_buffer (b[3])->l2_classify.hash = hash[3]; |
| 257 | |
| 258 | vnet_buffer (b[2])->l2_classify.table_index = table_index[2]; |
| 259 | vnet_buffer (b[3])->l2_classify.table_index = table_index[3]; |
| 260 | |
| 261 | vnet_buffer (b[2])->l2_classify.opaque_index = ~0; |
| 262 | vnet_buffer (b[3])->l2_classify.opaque_index = ~0; |
| 263 | |
| 264 | vnet_classify_prefetch_bucket (t[2], |
| 265 | vnet_buffer (b[2])-> |
| 266 | l2_classify.hash); |
| 267 | vnet_classify_prefetch_bucket (t[3], |
| 268 | vnet_buffer (b[3])-> |
| 269 | l2_classify.hash); |
| 270 | } |
| 271 | |
| 272 | /* find entry for b[0] & b[1] */ |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 273 | vnet_get_config_data (cm, &b[0]->current_config_index, &_next[0], |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 274 | /* # bytes of config data */ 0); |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 275 | vnet_get_config_data (cm, &b[1]->current_config_index, &_next[1], |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 276 | /* # bytes of config data */ 0); |
| 277 | |
| 278 | if (PREDICT_TRUE (table_index[0] != ~0)) |
| 279 | { |
| 280 | e[0] = |
| 281 | vnet_classify_find_entry_inline (t[0], (u8 *) h[0], hash[0], now); |
| 282 | if (e[0]) |
| 283 | { |
| 284 | vnet_buffer (b[0])->l2_classify.opaque_index |
| 285 | = e[0]->opaque_index; |
| 286 | vlib_buffer_advance (b[0], e[0]->advance); |
| 287 | |
| 288 | _next[0] = (e[0]->next_index < n_next_nodes) ? |
| 289 | e[0]->next_index : _next[0]; |
| 290 | |
| 291 | hits++; |
| 292 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 293 | b[0]->error = |
| 294 | (_next[0] == ACL_NEXT_INDEX_DENY) ? error_deny : error_none; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 295 | |
| 296 | if (!is_output) |
| 297 | { |
| 298 | if (e[0]->action == CLASSIFY_ACTION_SET_IP4_FIB_INDEX || |
| 299 | e[0]->action == CLASSIFY_ACTION_SET_IP6_FIB_INDEX) |
| 300 | vnet_buffer (b[0])->sw_if_index[VLIB_TX] = e[0]->metadata; |
| 301 | else if (e[0]->action == CLASSIFY_ACTION_SET_METADATA) |
Arthur de Kerhor | 1031098 | 2021-12-22 10:58:30 +0100 | [diff] [blame] | 302 | { |
| 303 | vnet_buffer (b[0])->ip.adj_index[VLIB_TX] = |
| 304 | e[0]->metadata; |
| 305 | /* For source check in case we skip the lookup node */ |
| 306 | ip_lookup_set_buffer_fib_index (fib_index_by_sw_if_index, |
| 307 | b[0]); |
| 308 | } |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 309 | } |
| 310 | } |
| 311 | else |
| 312 | { |
| 313 | while (1) |
| 314 | { |
| 315 | if (PREDICT_TRUE (t[0]->next_table_index != ~0)) |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 316 | t[0] = pool_elt_at_index (tables, t[0]->next_table_index); |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 317 | else |
| 318 | { |
| 319 | _next[0] = (t[0]->miss_next_index < n_next_nodes) ? |
| 320 | t[0]->miss_next_index : _next[0]; |
| 321 | |
| 322 | misses++; |
| 323 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 324 | b[0]->error = (_next[0] == ACL_NEXT_INDEX_DENY) ? |
| 325 | error_miss : |
| 326 | error_none; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 327 | break; |
| 328 | } |
| 329 | |
| 330 | if (t[0]->current_data_flag == CLASSIFY_FLAG_USE_CURR_DATA) |
| 331 | h[0] = |
| 332 | (void *) vlib_buffer_get_current (b[0]) + |
| 333 | t[0]->current_data_offset; |
| 334 | else |
| 335 | h[0] = b[0]->data; |
| 336 | |
| 337 | /* advance the match pointer so the matching happens on IP header */ |
| 338 | if (is_output) |
| 339 | h[0] += vnet_buffer (b[0])->l2_classify.pad.l2_len; |
| 340 | |
| 341 | hash[0] = |
| 342 | vnet_classify_hash_packet_inline (t[0], (u8 *) h[0]); |
| 343 | e[0] = |
| 344 | vnet_classify_find_entry_inline (t[0], (u8 *) h[0], |
| 345 | hash[0], now); |
| 346 | if (e[0]) |
| 347 | { |
| 348 | vnet_buffer (b[0])->l2_classify.opaque_index |
| 349 | = e[0]->opaque_index; |
| 350 | vlib_buffer_advance (b[0], e[0]->advance); |
| 351 | _next[0] = (e[0]->next_index < n_next_nodes) ? |
| 352 | e[0]->next_index : _next[0]; |
| 353 | hits++; |
| 354 | chain_hits++; |
| 355 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 356 | b[0]->error = (_next[0] == ACL_NEXT_INDEX_DENY) ? |
| 357 | error_deny : |
| 358 | error_none; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 359 | |
| 360 | if (!is_output) |
| 361 | { |
| 362 | if (e[0]->action == |
| 363 | CLASSIFY_ACTION_SET_IP4_FIB_INDEX |
| 364 | || e[0]->action == |
| 365 | CLASSIFY_ACTION_SET_IP6_FIB_INDEX) |
| 366 | vnet_buffer (b[0])->sw_if_index[VLIB_TX] = |
| 367 | e[0]->metadata; |
| 368 | else if (e[0]->action == |
| 369 | CLASSIFY_ACTION_SET_METADATA) |
Arthur de Kerhor | 1031098 | 2021-12-22 10:58:30 +0100 | [diff] [blame] | 370 | { |
| 371 | vnet_buffer (b[0])->ip.adj_index[VLIB_TX] = |
| 372 | e[0]->metadata; |
| 373 | /* For source check in case we skip the lookup |
| 374 | * node */ |
| 375 | ip_lookup_set_buffer_fib_index ( |
| 376 | fib_index_by_sw_if_index, b[0]); |
| 377 | } |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 378 | } |
| 379 | break; |
| 380 | } |
| 381 | } |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | if (PREDICT_TRUE (table_index[1] != ~0)) |
| 386 | { |
| 387 | e[1] = |
| 388 | vnet_classify_find_entry_inline (t[1], (u8 *) h[1], hash[1], now); |
| 389 | if (e[1]) |
| 390 | { |
| 391 | vnet_buffer (b[1])->l2_classify.opaque_index |
| 392 | = e[1]->opaque_index; |
| 393 | vlib_buffer_advance (b[1], e[1]->advance); |
| 394 | |
| 395 | _next[1] = (e[1]->next_index < n_next_nodes) ? |
| 396 | e[1]->next_index : _next[1]; |
| 397 | |
| 398 | hits++; |
| 399 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 400 | b[1]->error = |
| 401 | (_next[1] == ACL_NEXT_INDEX_DENY) ? error_deny : error_none; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 402 | |
| 403 | if (!is_output) |
| 404 | { |
| 405 | if (e[1]->action == CLASSIFY_ACTION_SET_IP4_FIB_INDEX || |
| 406 | e[1]->action == CLASSIFY_ACTION_SET_IP6_FIB_INDEX) |
| 407 | vnet_buffer (b[1])->sw_if_index[VLIB_TX] = e[1]->metadata; |
| 408 | else if (e[1]->action == CLASSIFY_ACTION_SET_METADATA) |
Arthur de Kerhor | 1031098 | 2021-12-22 10:58:30 +0100 | [diff] [blame] | 409 | { |
| 410 | vnet_buffer (b[1])->ip.adj_index[VLIB_TX] = |
| 411 | e[1]->metadata; |
| 412 | /* For source check in case we skip the lookup node */ |
| 413 | ip_lookup_set_buffer_fib_index (fib_index_by_sw_if_index, |
| 414 | b[1]); |
| 415 | } |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 416 | } |
| 417 | } |
| 418 | else |
| 419 | { |
| 420 | while (1) |
| 421 | { |
| 422 | if (PREDICT_TRUE (t[1]->next_table_index != ~0)) |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 423 | t[1] = pool_elt_at_index (tables, t[1]->next_table_index); |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 424 | else |
| 425 | { |
| 426 | _next[1] = (t[1]->miss_next_index < n_next_nodes) ? |
| 427 | t[1]->miss_next_index : _next[1]; |
| 428 | |
| 429 | misses++; |
| 430 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 431 | b[1]->error = (_next[1] == ACL_NEXT_INDEX_DENY) ? |
| 432 | error_miss : |
| 433 | error_none; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 434 | break; |
| 435 | } |
| 436 | |
| 437 | if (t[1]->current_data_flag == CLASSIFY_FLAG_USE_CURR_DATA) |
| 438 | h[1] = |
| 439 | (void *) vlib_buffer_get_current (b[1]) + |
| 440 | t[1]->current_data_offset; |
| 441 | else |
| 442 | h[1] = b[1]->data; |
| 443 | |
| 444 | /* advance the match pointer so the matching happens on IP header */ |
| 445 | if (is_output) |
| 446 | h[1] += vnet_buffer (b[1])->l2_classify.pad.l2_len; |
| 447 | |
| 448 | hash[1] = |
| 449 | vnet_classify_hash_packet_inline (t[1], (u8 *) h[1]); |
| 450 | e[1] = |
| 451 | vnet_classify_find_entry_inline (t[1], (u8 *) h[1], |
| 452 | hash[1], now); |
| 453 | if (e[1]) |
| 454 | { |
| 455 | vnet_buffer (b[1])->l2_classify.opaque_index |
| 456 | = e[1]->opaque_index; |
| 457 | vlib_buffer_advance (b[1], e[1]->advance); |
| 458 | _next[1] = (e[1]->next_index < n_next_nodes) ? |
| 459 | e[1]->next_index : _next[1]; |
| 460 | hits++; |
| 461 | chain_hits++; |
| 462 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 463 | b[1]->error = (_next[1] == ACL_NEXT_INDEX_DENY) ? |
| 464 | error_deny : |
| 465 | error_none; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 466 | |
| 467 | if (!is_output) |
| 468 | { |
| 469 | if (e[1]->action == |
| 470 | CLASSIFY_ACTION_SET_IP4_FIB_INDEX |
| 471 | || e[1]->action == |
| 472 | CLASSIFY_ACTION_SET_IP6_FIB_INDEX) |
| 473 | vnet_buffer (b[1])->sw_if_index[VLIB_TX] = |
| 474 | e[1]->metadata; |
| 475 | else if (e[1]->action == |
| 476 | CLASSIFY_ACTION_SET_METADATA) |
Arthur de Kerhor | 1031098 | 2021-12-22 10:58:30 +0100 | [diff] [blame] | 477 | { |
| 478 | vnet_buffer (b[1])->ip.adj_index[VLIB_TX] = |
| 479 | e[1]->metadata; |
| 480 | /* For source check in case we skip the lookup |
| 481 | * node */ |
| 482 | ip_lookup_set_buffer_fib_index ( |
| 483 | fib_index_by_sw_if_index, b[1]); |
| 484 | } |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 485 | } |
| 486 | break; |
| 487 | } |
| 488 | } |
| 489 | } |
| 490 | } |
| 491 | |
| 492 | if (do_trace && b[0]->flags & VLIB_BUFFER_IS_TRACED) |
| 493 | { |
| 494 | ip_in_out_acl_trace_t *_t = |
| 495 | vlib_add_trace (vm, node, b[0], sizeof (*_t)); |
| 496 | _t->sw_if_index = |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 497 | ~0 == way ? 0 : vnet_buffer (b[0])->sw_if_index[way]; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 498 | _t->next_index = _next[0]; |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 499 | _t->table_index = t[0] ? t[0] - tables : ~0; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 500 | _t->offset = (e[0] |
| 501 | && t[0]) ? vnet_classify_get_offset (t[0], e[0]) : ~0; |
| 502 | } |
| 503 | |
| 504 | if (do_trace && b[1]->flags & VLIB_BUFFER_IS_TRACED) |
| 505 | { |
| 506 | ip_in_out_acl_trace_t *_t = |
| 507 | vlib_add_trace (vm, node, b[1], sizeof (*_t)); |
| 508 | _t->sw_if_index = |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 509 | ~0 == way ? 0 : vnet_buffer (b[1])->sw_if_index[way]; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 510 | _t->next_index = _next[1]; |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 511 | _t->table_index = t[1] ? t[1] - tables : ~0; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 512 | _t->offset = (e[1] |
| 513 | && t[1]) ? vnet_classify_get_offset (t[1], e[1]) : ~0; |
| 514 | } |
| 515 | |
| 516 | if ((_next[0] == ACL_NEXT_INDEX_DENY) && is_output) |
| 517 | { |
| 518 | /* on output, for the drop node to work properly, go back to ip header */ |
| 519 | vlib_buffer_advance (b[0], vnet_buffer (b[0])->l2.l2_len); |
| 520 | } |
| 521 | |
| 522 | if ((_next[1] == ACL_NEXT_INDEX_DENY) && is_output) |
| 523 | { |
| 524 | /* on output, for the drop node to work properly, go back to ip header */ |
| 525 | vlib_buffer_advance (b[1], vnet_buffer (b[1])->l2.l2_len); |
| 526 | } |
| 527 | |
| 528 | next[0] = _next[0]; |
| 529 | next[1] = _next[1]; |
| 530 | |
| 531 | /* _next */ |
| 532 | next += 2; |
| 533 | b += 2; |
| 534 | n_left -= 2; |
| 535 | } |
| 536 | |
| 537 | while (n_left > 0) |
| 538 | { |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 539 | u8 *h0; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 540 | u32 sw_if_index0; |
| 541 | u32 table_index0; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 542 | vnet_classify_table_t *t0 = 0; |
| 543 | vnet_classify_entry_t *e0 = 0; |
| 544 | u32 next0 = ACL_NEXT_INDEX_DENY; |
| 545 | u64 hash0; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 546 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 547 | sw_if_index0 = ~0 == way ? 0 : vnet_buffer (b[0])->sw_if_index[way]; |
| 548 | table_index0 = table_index_by_sw_if_index[sw_if_index0]; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 549 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 550 | t0 = pool_elt_at_index (tables, table_index0); |
Steve Shin | 25e26dc | 2016-11-08 10:47:10 -0800 | [diff] [blame] | 551 | |
| 552 | if (t0->current_data_flag == CLASSIFY_FLAG_USE_CURR_DATA) |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 553 | h0 = |
| 554 | (void *) vlib_buffer_get_current (b[0]) + t0->current_data_offset; |
Steve Shin | 25e26dc | 2016-11-08 10:47:10 -0800 | [diff] [blame] | 555 | else |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 556 | h0 = b[0]->data; |
Steve Shin | 25e26dc | 2016-11-08 10:47:10 -0800 | [diff] [blame] | 557 | |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 558 | if (is_output) |
| 559 | { |
| 560 | /* Save the rewrite length, since we are using the l2_classify struct */ |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 561 | vnet_buffer (b[0])->l2_classify.pad.l2_len = |
| 562 | vnet_buffer (b[0])->ip.save_rewrite_length; |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 563 | /* advance the match pointer so the matching happens on IP header */ |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 564 | h0 += vnet_buffer (b[0])->l2_classify.pad.l2_len; |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 565 | } |
| 566 | |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 567 | vnet_buffer (b[0])->l2_classify.hash = |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 568 | vnet_classify_hash_packet (t0, (u8 *) h0); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 569 | |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 570 | vnet_buffer (b[0])->l2_classify.table_index = table_index0; |
| 571 | vnet_buffer (b[0])->l2_classify.opaque_index = ~0; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 572 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 573 | vnet_get_config_data (cm, &b[0]->current_config_index, &next0, |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 574 | /* # bytes of config data */ 0); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 575 | |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 576 | if (PREDICT_TRUE (table_index0 != ~0)) |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 577 | { |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 578 | hash0 = vnet_buffer (b[0])->l2_classify.hash; |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 579 | t0 = pool_elt_at_index (tables, table_index0); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 580 | |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 581 | if (t0->current_data_flag == CLASSIFY_FLAG_USE_CURR_DATA) |
| 582 | h0 = |
| 583 | (void *) vlib_buffer_get_current (b[0]) + |
| 584 | t0->current_data_offset; |
| 585 | else |
| 586 | h0 = b[0]->data; |
| 587 | |
| 588 | /* advance the match pointer so the matching happens on IP header */ |
| 589 | if (is_output) |
| 590 | h0 += vnet_buffer (b[0])->l2_classify.pad.l2_len; |
| 591 | |
| 592 | e0 = vnet_classify_find_entry_inline (t0, (u8 *) h0, hash0, now); |
| 593 | if (e0) |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 594 | { |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 595 | vnet_buffer (b[0])->l2_classify.opaque_index = e0->opaque_index; |
| 596 | vlib_buffer_advance (b[0], e0->advance); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 597 | |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 598 | next0 = (e0->next_index < n_next_nodes) ? |
| 599 | e0->next_index : next0; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 600 | |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 601 | hits++; |
| 602 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 603 | b[0]->error = |
| 604 | (next0 == ACL_NEXT_INDEX_DENY) ? error_deny : error_none; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 605 | |
| 606 | if (!is_output) |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 607 | { |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 608 | if (e0->action == CLASSIFY_ACTION_SET_IP4_FIB_INDEX || |
| 609 | e0->action == CLASSIFY_ACTION_SET_IP6_FIB_INDEX) |
| 610 | vnet_buffer (b[0])->sw_if_index[VLIB_TX] = e0->metadata; |
| 611 | else if (e0->action == CLASSIFY_ACTION_SET_METADATA) |
Arthur de Kerhor | 1031098 | 2021-12-22 10:58:30 +0100 | [diff] [blame] | 612 | { |
| 613 | vnet_buffer (b[0])->ip.adj_index[VLIB_TX] = e0->metadata; |
| 614 | /* For source check in case we skip the lookup node */ |
| 615 | ip_lookup_set_buffer_fib_index (fib_index_by_sw_if_index, |
| 616 | b[0]); |
| 617 | } |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 618 | } |
| 619 | } |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 620 | else |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 621 | { |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 622 | while (1) |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 623 | { |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 624 | if (PREDICT_TRUE (t0->next_table_index != ~0)) |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 625 | t0 = pool_elt_at_index (tables, t0->next_table_index); |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 626 | else |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 627 | { |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 628 | next0 = (t0->miss_next_index < n_next_nodes) ? |
| 629 | t0->miss_next_index : next0; |
| 630 | |
| 631 | misses++; |
| 632 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 633 | b[0]->error = (next0 == ACL_NEXT_INDEX_DENY) ? |
| 634 | error_miss : |
| 635 | error_none; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 636 | break; |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 637 | } |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 638 | |
| 639 | if (t0->current_data_flag == CLASSIFY_FLAG_USE_CURR_DATA) |
| 640 | h0 = |
| 641 | (void *) vlib_buffer_get_current (b[0]) + |
| 642 | t0->current_data_offset; |
| 643 | else |
| 644 | h0 = b[0]->data; |
| 645 | |
| 646 | /* advance the match pointer so the matching happens on IP header */ |
| 647 | if (is_output) |
| 648 | h0 += vnet_buffer (b[0])->l2_classify.pad.l2_len; |
| 649 | |
| 650 | hash0 = vnet_classify_hash_packet_inline (t0, (u8 *) h0); |
| 651 | e0 = vnet_classify_find_entry_inline |
| 652 | (t0, (u8 *) h0, hash0, now); |
| 653 | if (e0) |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 654 | { |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 655 | vnet_buffer (b[0])->l2_classify.opaque_index |
| 656 | = e0->opaque_index; |
| 657 | vlib_buffer_advance (b[0], e0->advance); |
| 658 | next0 = (e0->next_index < n_next_nodes) ? |
| 659 | e0->next_index : next0; |
| 660 | hits++; |
| 661 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 662 | b[0]->error = (next0 == ACL_NEXT_INDEX_DENY) ? |
| 663 | error_deny : |
| 664 | error_none; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 665 | |
| 666 | if (!is_output) |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 667 | { |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 668 | if (e0->action == |
| 669 | CLASSIFY_ACTION_SET_IP4_FIB_INDEX |
| 670 | || e0->action == |
| 671 | CLASSIFY_ACTION_SET_IP6_FIB_INDEX) |
| 672 | vnet_buffer (b[0])->sw_if_index[VLIB_TX] = |
| 673 | e0->metadata; |
| 674 | else if (e0->action == CLASSIFY_ACTION_SET_METADATA) |
Arthur de Kerhor | 1031098 | 2021-12-22 10:58:30 +0100 | [diff] [blame] | 675 | { |
| 676 | vnet_buffer (b[0])->ip.adj_index[VLIB_TX] = |
| 677 | e0->metadata; |
| 678 | /* For source check in case we skip the lookup |
| 679 | * node */ |
| 680 | ip_lookup_set_buffer_fib_index ( |
| 681 | fib_index_by_sw_if_index, b[0]); |
| 682 | } |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 683 | } |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 684 | break; |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 685 | } |
| 686 | } |
| 687 | } |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 688 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 689 | |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 690 | if (do_trace && b[0]->flags & VLIB_BUFFER_IS_TRACED) |
| 691 | { |
| 692 | ip_in_out_acl_trace_t *t = |
| 693 | vlib_add_trace (vm, node, b[0], sizeof (*t)); |
| 694 | t->sw_if_index = |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 695 | ~0 == way ? 0 : vnet_buffer (b[0])->sw_if_index[way]; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 696 | t->next_index = next0; |
Klement Sekera | 849b474 | 2021-10-25 13:39:13 +0200 | [diff] [blame] | 697 | t->table_index = t0 - tables; |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 698 | t->offset = (e0 && t0) ? vnet_classify_get_offset (t0, e0) : ~0; |
| 699 | } |
| 700 | |
| 701 | if ((next0 == ACL_NEXT_INDEX_DENY) && is_output) |
| 702 | { |
| 703 | /* on output, for the drop node to work properly, go back to ip header */ |
| 704 | vlib_buffer_advance (b[0], vnet_buffer (b[0])->l2.l2_len); |
| 705 | } |
| 706 | |
| 707 | next[0] = next0; |
| 708 | |
| 709 | /* next */ |
| 710 | next++; |
| 711 | b++; |
| 712 | n_left--; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 713 | } |
| 714 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 715 | *hits__ = hits; |
| 716 | *misses__ = misses; |
| 717 | *chain_hits__ = chain_hits; |
| 718 | } |
| 719 | |
| 720 | static_always_inline uword |
| 721 | ip_in_out_acl_inline (vlib_main_t *vm, vlib_node_runtime_t *node, |
| 722 | vlib_frame_t *frame, const in_out_acl_table_id_t tid, |
Arthur de Kerhor | 1031098 | 2021-12-22 10:58:30 +0100 | [diff] [blame] | 723 | u32 *fib_index_by_sw_if_index, |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 724 | const vlib_node_registration_t *parent_error_node, |
| 725 | const u32 error_none_index, const u32 error_deny_index, |
| 726 | const u32 error_miss_index, const vlib_rx_or_tx_t way, |
| 727 | const int is_output) |
| 728 | { |
| 729 | const in_out_acl_main_t *am = &in_out_acl_main; |
| 730 | vnet_classify_table_t *tables = am->vnet_classify_main->tables; |
| 731 | u32 *from = vlib_frame_vector_args (frame); |
| 732 | const u32 *table_index_by_sw_if_index = |
| 733 | am->classify_table_index_by_sw_if_index[is_output][tid]; |
| 734 | vnet_config_main_t *cm = am->vnet_config_main[is_output][tid]; |
| 735 | const vlib_node_runtime_t *error_node = |
| 736 | vlib_node_get_runtime (vm, parent_error_node->index); |
| 737 | const vlib_error_t error_none = error_node->errors[error_none_index]; |
| 738 | const vlib_error_t error_deny = error_node->errors[error_deny_index]; |
| 739 | const vlib_error_t error_miss = error_node->errors[error_miss_index]; |
| 740 | vlib_buffer_t *bufs[VLIB_FRAME_SIZE]; |
| 741 | u16 nexts[VLIB_FRAME_SIZE]; |
| 742 | u32 hits, misses, chain_hits; |
| 743 | |
| 744 | vlib_get_buffers (vm, from, bufs, frame->n_vectors); |
| 745 | |
| 746 | #define ip_in_out_acl_inline_trace__(do_trace) \ |
| 747 | ip_in_out_acl_inline_trace ( \ |
| 748 | vm, node, frame, bufs, nexts, frame->n_vectors, &hits, &misses, \ |
| 749 | &chain_hits, error_deny, error_miss, error_none, tables, \ |
Arthur de Kerhor | 1031098 | 2021-12-22 10:58:30 +0100 | [diff] [blame] | 750 | table_index_by_sw_if_index, fib_index_by_sw_if_index, cm, way, is_output, \ |
| 751 | do_trace) |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 752 | |
| 753 | if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE)) |
| 754 | ip_in_out_acl_inline_trace__ (1 /* do_trace */); |
| 755 | else |
| 756 | ip_in_out_acl_inline_trace__ (0 /* do_trace */); |
| 757 | |
| 758 | vlib_node_increment_counter ( |
| 759 | vm, node->node_index, |
| 760 | is_output ? IP_OUTACL_ERROR_MISS : IP_INACL_ERROR_MISS, misses); |
| 761 | vlib_node_increment_counter ( |
| 762 | vm, node->node_index, is_output ? IP_OUTACL_ERROR_HIT : IP_INACL_ERROR_HIT, |
| 763 | hits); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 764 | vlib_node_increment_counter (vm, node->node_index, |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 765 | is_output ? IP_OUTACL_ERROR_CHAIN_HIT : |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 766 | IP_INACL_ERROR_CHAIN_HIT, |
| 767 | chain_hits); |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 768 | |
| 769 | vlib_buffer_enqueue_to_next (vm, node, from, nexts, frame->n_vectors); |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 770 | return frame->n_vectors; |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 771 | } |
| 772 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 773 | VLIB_NODE_FN (ip4_inacl_node) |
| 774 | (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame) |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 775 | { |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 776 | return ip_in_out_acl_inline ( |
Arthur de Kerhor | 1031098 | 2021-12-22 10:58:30 +0100 | [diff] [blame] | 777 | vm, node, frame, IN_OUT_ACL_TABLE_IP4, ip4_main.fib_index_by_sw_if_index, |
| 778 | &ip4_input_node, IP4_ERROR_NONE, IP4_ERROR_INACL_SESSION_DENY, |
| 779 | IP4_ERROR_INACL_TABLE_MISS, VLIB_RX, 0 /* is_output */); |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 780 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 781 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 782 | VLIB_NODE_FN (ip4_punt_acl_node) |
| 783 | (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame) |
| 784 | { |
| 785 | return ip_in_out_acl_inline ( |
Arthur de Kerhor | 1031098 | 2021-12-22 10:58:30 +0100 | [diff] [blame] | 786 | vm, node, frame, IN_OUT_ACL_TABLE_IP4_PUNT, |
| 787 | ip4_main.fib_index_by_sw_if_index, &ip4_input_node, IP4_ERROR_NONE, |
| 788 | IP4_ERROR_INACL_SESSION_DENY, IP4_ERROR_INACL_TABLE_MISS, ~0 /* way */, |
| 789 | 0 /* is_output */); |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 790 | } |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 791 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 792 | VLIB_NODE_FN (ip4_outacl_node) |
| 793 | (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame) |
| 794 | { |
| 795 | return ip_in_out_acl_inline ( |
Arthur de Kerhor | 1031098 | 2021-12-22 10:58:30 +0100 | [diff] [blame] | 796 | vm, node, frame, IN_OUT_ACL_TABLE_IP4, NULL, &ip4_input_node, |
| 797 | IP4_ERROR_NONE, IP4_ERROR_INACL_SESSION_DENY, IP4_ERROR_INACL_TABLE_MISS, |
| 798 | VLIB_TX, 1 /* is_output */); |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 799 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 800 | |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 801 | /* *INDENT-OFF* */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 802 | VLIB_REGISTER_NODE (ip4_inacl_node) = { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 803 | .name = "ip4-inacl", |
| 804 | .vector_size = sizeof (u32), |
| 805 | .format_trace = format_ip_inacl_trace, |
| 806 | .n_errors = ARRAY_LEN(ip_inacl_error_strings), |
| 807 | .error_strings = ip_inacl_error_strings, |
| 808 | |
| 809 | .n_next_nodes = ACL_NEXT_INDEX_N_NEXT, |
| 810 | .next_nodes = { |
Vijayabhaskar Katamreddy | ce07412 | 2017-11-15 13:50:26 -0800 | [diff] [blame] | 811 | [ACL_NEXT_INDEX_DENY] = "ip4-drop", |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 812 | }, |
| 813 | }; |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 814 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 815 | VLIB_REGISTER_NODE (ip4_punt_acl_node) = { |
| 816 | .name = "ip4-punt-acl", |
| 817 | .vector_size = sizeof (u32), |
| 818 | .format_trace = format_ip_inacl_trace, |
| 819 | .n_errors = ARRAY_LEN(ip_inacl_error_strings), |
| 820 | .error_strings = ip_inacl_error_strings, |
| 821 | |
| 822 | .n_next_nodes = ACL_NEXT_INDEX_N_NEXT, |
| 823 | .next_nodes = { |
| 824 | [ACL_NEXT_INDEX_DENY] = "ip4-drop", |
| 825 | }, |
| 826 | }; |
| 827 | |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 828 | VLIB_REGISTER_NODE (ip4_outacl_node) = { |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 829 | .name = "ip4-outacl", |
| 830 | .vector_size = sizeof (u32), |
| 831 | .format_trace = format_ip_outacl_trace, |
| 832 | .n_errors = ARRAY_LEN(ip_outacl_error_strings), |
| 833 | .error_strings = ip_outacl_error_strings, |
| 834 | |
| 835 | .n_next_nodes = ACL_NEXT_INDEX_N_NEXT, |
| 836 | .next_nodes = { |
| 837 | [ACL_NEXT_INDEX_DENY] = "ip4-drop", |
| 838 | }, |
| 839 | }; |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 840 | /* *INDENT-ON* */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 841 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 842 | VNET_FEATURE_INIT (ip4_punt_acl_feature) = { |
| 843 | .arc_name = "ip4-punt", |
| 844 | .node_name = "ip4-punt-acl", |
| 845 | .runs_after = VNET_FEATURES ("ip4-punt-policer"), |
| 846 | }; |
| 847 | |
Filip Tehlar | 26ea14e | 2019-03-11 05:30:21 -0700 | [diff] [blame] | 848 | VLIB_NODE_FN (ip6_inacl_node) (vlib_main_t * vm, vlib_node_runtime_t * node, |
| 849 | vlib_frame_t * frame) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 850 | { |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 851 | return ip_in_out_acl_inline ( |
Arthur de Kerhor | 1031098 | 2021-12-22 10:58:30 +0100 | [diff] [blame] | 852 | vm, node, frame, IN_OUT_ACL_TABLE_IP6, ip6_main.fib_index_by_sw_if_index, |
| 853 | &ip6_input_node, IP6_ERROR_NONE, IP6_ERROR_INACL_SESSION_DENY, |
| 854 | IP6_ERROR_INACL_TABLE_MISS, VLIB_RX, 0 /* is_output */); |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 855 | } |
Ray Kinsella | 8899ce0 | 2020-03-12 15:52:41 +0000 | [diff] [blame] | 856 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 857 | VLIB_NODE_FN (ip6_punt_acl_node) |
| 858 | (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame) |
| 859 | { |
| 860 | return ip_in_out_acl_inline ( |
Arthur de Kerhor | 1031098 | 2021-12-22 10:58:30 +0100 | [diff] [blame] | 861 | vm, node, frame, IN_OUT_ACL_TABLE_IP6_PUNT, |
| 862 | ip4_main.fib_index_by_sw_if_index, &ip6_input_node, IP6_ERROR_NONE, |
| 863 | IP6_ERROR_INACL_SESSION_DENY, IP6_ERROR_INACL_TABLE_MISS, ~0 /* way */, |
| 864 | 0 /* is_output */); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 865 | } |
| 866 | |
Filip Tehlar | 26ea14e | 2019-03-11 05:30:21 -0700 | [diff] [blame] | 867 | VLIB_NODE_FN (ip6_outacl_node) (vlib_main_t * vm, vlib_node_runtime_t * node, |
| 868 | vlib_frame_t * frame) |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 869 | { |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 870 | return ip_in_out_acl_inline ( |
Arthur de Kerhor | 1031098 | 2021-12-22 10:58:30 +0100 | [diff] [blame] | 871 | vm, node, frame, IN_OUT_ACL_TABLE_IP6, NULL, &ip6_input_node, |
| 872 | IP6_ERROR_NONE, IP6_ERROR_INACL_SESSION_DENY, IP6_ERROR_INACL_TABLE_MISS, |
| 873 | VLIB_TX, 1 /* is_output */); |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 874 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 875 | |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 876 | /* *INDENT-OFF* */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 877 | VLIB_REGISTER_NODE (ip6_inacl_node) = { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 878 | .name = "ip6-inacl", |
| 879 | .vector_size = sizeof (u32), |
| 880 | .format_trace = format_ip_inacl_trace, |
| 881 | .n_errors = ARRAY_LEN(ip_inacl_error_strings), |
| 882 | .error_strings = ip_inacl_error_strings, |
| 883 | |
| 884 | .n_next_nodes = ACL_NEXT_INDEX_N_NEXT, |
| 885 | .next_nodes = { |
Vijayabhaskar Katamreddy | ce07412 | 2017-11-15 13:50:26 -0800 | [diff] [blame] | 886 | [ACL_NEXT_INDEX_DENY] = "ip6-drop", |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 887 | }, |
| 888 | }; |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 889 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 890 | VLIB_REGISTER_NODE (ip6_punt_acl_node) = { |
| 891 | .name = "ip6-punt-acl", |
| 892 | .vector_size = sizeof (u32), |
| 893 | .format_trace = format_ip_inacl_trace, |
| 894 | .n_errors = ARRAY_LEN(ip_inacl_error_strings), |
| 895 | .error_strings = ip_inacl_error_strings, |
| 896 | |
| 897 | .n_next_nodes = ACL_NEXT_INDEX_N_NEXT, |
| 898 | .next_nodes = { |
| 899 | [ACL_NEXT_INDEX_DENY] = "ip6-drop", |
| 900 | }, |
| 901 | }; |
| 902 | |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 903 | VLIB_REGISTER_NODE (ip6_outacl_node) = { |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 904 | .name = "ip6-outacl", |
| 905 | .vector_size = sizeof (u32), |
| 906 | .format_trace = format_ip_outacl_trace, |
| 907 | .n_errors = ARRAY_LEN(ip_outacl_error_strings), |
| 908 | .error_strings = ip_outacl_error_strings, |
| 909 | |
| 910 | .n_next_nodes = ACL_NEXT_INDEX_N_NEXT, |
| 911 | .next_nodes = { |
| 912 | [ACL_NEXT_INDEX_DENY] = "ip6-drop", |
| 913 | }, |
| 914 | }; |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 915 | /* *INDENT-ON* */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 916 | |
Benoît Ganne | abb2a42 | 2021-09-30 13:41:00 +0200 | [diff] [blame] | 917 | VNET_FEATURE_INIT (ip6_punt_acl_feature) = { |
| 918 | .arc_name = "ip6-punt", |
| 919 | .node_name = "ip6-punt-acl", |
| 920 | .runs_after = VNET_FEATURES ("ip6-punt-policer"), |
| 921 | }; |
| 922 | |
Filip Tehlar | 26ea14e | 2019-03-11 05:30:21 -0700 | [diff] [blame] | 923 | #ifndef CLIB_MARCH_VARIANT |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 924 | static clib_error_t * |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 925 | ip_in_out_acl_init (vlib_main_t * vm) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 926 | { |
| 927 | return 0; |
| 928 | } |
| 929 | |
Andrew Yourtchenko | 815d7d5 | 2018-02-07 11:37:02 +0100 | [diff] [blame] | 930 | VLIB_INIT_FUNCTION (ip_in_out_acl_init); |
Filip Tehlar | 26ea14e | 2019-03-11 05:30:21 -0700 | [diff] [blame] | 931 | #endif /* CLIB_MARCH_VARIANT */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 932 | |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 933 | |
| 934 | /* |
| 935 | * fd.io coding-style-patch-verification: ON |
| 936 | * |
| 937 | * Local Variables: |
| 938 | * eval: (c-set-style "gnu") |
| 939 | * End: |
| 940 | */ |