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/l2/l2_xcrw.h> |
| 16 | |
Chris Luke | 16bcf7d | 2016-09-01 14:31:46 -0400 | [diff] [blame] | 17 | /** |
| 18 | * @file |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 19 | * General L2 / L3 cross-connect, used to set up |
| 20 | * "L2 interface <--> your-favorite-tunnel-encap" tunnels. |
| 21 | * |
| 22 | * We set up a typical L2 cross-connect or (future) bridge |
| 23 | * to hook L2 interface(s) up to the L3 stack in arbitrary ways. |
| 24 | * |
| 25 | * Each l2_xcrw adjacency specifies 3 things: |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 26 | * |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 27 | * 1. The next graph node (presumably in the L3 stack) to |
| 28 | * process the (L2 -> L3) packet |
| 29 | * |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 30 | * 2. A new value for vnet_buffer(b)->sw_if_index[VLIB_TX] |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 31 | * (i.e. a lookup FIB index), |
| 32 | * |
| 33 | * 3. A rewrite string to apply. |
| 34 | * |
| 35 | * Example: to cross-connect an L2 interface or (future) bridge |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 36 | * to an mpls-o-gre tunnel, set up the L2 rewrite string as shown in |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 37 | * mpls_gre_rewrite, and use "mpls-post-rewrite" to fix the |
| 38 | * GRE IP header checksum and length fields. |
| 39 | */ |
| 40 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 41 | typedef struct |
| 42 | { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 43 | u32 next_index; |
| 44 | u32 tx_fib_index; |
| 45 | } l2_xcrw_trace_t; |
| 46 | |
| 47 | /* packet trace format function */ |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 48 | static u8 * |
| 49 | format_l2_xcrw_trace (u8 * s, va_list * args) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 50 | { |
| 51 | CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *); |
| 52 | CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *); |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 53 | l2_xcrw_trace_t *t = va_arg (*args, l2_xcrw_trace_t *); |
| 54 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 55 | s = format (s, "L2_XCRW: next index %d tx_fib_index %d", |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 56 | t->next_index, t->tx_fib_index); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 57 | return s; |
| 58 | } |
| 59 | |
Filip Tehlar | 44f0f71 | 2019-03-11 04:26:37 -0700 | [diff] [blame] | 60 | extern l2_xcrw_main_t l2_xcrw_main; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 61 | |
Filip Tehlar | 44f0f71 | 2019-03-11 04:26:37 -0700 | [diff] [blame] | 62 | #ifndef CLIB_MARCH_VARIANT |
| 63 | l2_xcrw_main_t l2_xcrw_main; |
| 64 | #endif /* CLIB_MARCH_VARIANT */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 65 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 66 | static char *l2_xcrw_error_strings[] = { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 67 | #define _(sym,string) string, |
| 68 | foreach_l2_xcrw_error |
| 69 | #undef _ |
| 70 | }; |
| 71 | |
Filip Tehlar | 44f0f71 | 2019-03-11 04:26:37 -0700 | [diff] [blame] | 72 | VLIB_NODE_FN (l2_xcrw_node) (vlib_main_t * vm, |
| 73 | vlib_node_runtime_t * node, vlib_frame_t * frame) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 74 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 75 | u32 n_left_from, *from, *to_next; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 76 | l2_xcrw_next_t next_index; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 77 | l2_xcrw_main_t *xcm = &l2_xcrw_main; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 78 | vlib_node_t *n = vlib_get_node (vm, l2_xcrw_node.index); |
| 79 | u32 node_counter_base_index = n->error_heap_index; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 80 | vlib_error_main_t *em = &vm->error_main; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 81 | |
| 82 | from = vlib_frame_vector_args (frame); |
| 83 | n_left_from = frame->n_vectors; |
| 84 | next_index = node->cached_next_index; |
| 85 | |
| 86 | while (n_left_from > 0) |
| 87 | { |
| 88 | u32 n_left_to_next; |
| 89 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 90 | vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 91 | |
| 92 | while (n_left_from >= 4 && n_left_to_next >= 2) |
| 93 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 94 | u32 bi0, bi1; |
| 95 | vlib_buffer_t *b0, *b1; |
| 96 | u32 next0, next1; |
| 97 | u32 sw_if_index0, sw_if_index1; |
| 98 | l2_xcrw_adjacency_t *adj0, *adj1; |
| 99 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 100 | /* Prefetch next iteration. */ |
| 101 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 102 | vlib_buffer_t *p2, *p3; |
| 103 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 104 | p2 = vlib_get_buffer (vm, from[2]); |
| 105 | p3 = vlib_get_buffer (vm, from[3]); |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 106 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 107 | vlib_prefetch_buffer_header (p2, LOAD); |
| 108 | vlib_prefetch_buffer_header (p3, LOAD); |
| 109 | |
Damjan Marion | af7fb04 | 2021-07-15 11:54:41 +0200 | [diff] [blame] | 110 | clib_prefetch_store (p2->data); |
| 111 | clib_prefetch_store (p3->data); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 112 | } |
| 113 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 114 | /* speculatively enqueue b0 and b1 to the current next frame */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 115 | to_next[0] = bi0 = from[0]; |
| 116 | to_next[1] = bi1 = from[1]; |
| 117 | from += 2; |
| 118 | to_next += 2; |
| 119 | n_left_from -= 2; |
| 120 | n_left_to_next -= 2; |
| 121 | |
| 122 | b0 = vlib_get_buffer (vm, bi0); |
| 123 | b1 = vlib_get_buffer (vm, bi1); |
| 124 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 125 | sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX]; |
| 126 | sw_if_index1 = vnet_buffer (b1)->sw_if_index[VLIB_RX]; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 127 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 128 | adj0 = vec_elt_at_index (xcm->adj_by_sw_if_index, sw_if_index0); |
| 129 | adj1 = vec_elt_at_index (xcm->adj_by_sw_if_index, sw_if_index1); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 130 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 131 | next0 = adj0->rewrite_header.next_index; |
| 132 | vnet_buffer (b0)->sw_if_index[VLIB_TX] = |
| 133 | adj0->rewrite_header.sw_if_index; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 134 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 135 | next1 = adj1->rewrite_header.next_index; |
| 136 | vnet_buffer (b1)->sw_if_index[VLIB_TX] = |
| 137 | adj1->rewrite_header.sw_if_index; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 138 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 139 | em->counters[node_counter_base_index + next1]++; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 140 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 141 | if (PREDICT_TRUE (next0 > 0)) |
| 142 | { |
| 143 | u8 *h0 = vlib_buffer_get_current (b0); |
| 144 | vnet_rewrite_one_header (adj0[0], h0, |
| 145 | adj0->rewrite_header.data_bytes); |
| 146 | vlib_buffer_advance (b0, -adj0->rewrite_header.data_bytes); |
| 147 | em->counters[node_counter_base_index + L2_XCRW_ERROR_FWD]++; |
| 148 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 149 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 150 | if (PREDICT_TRUE (next1 > 0)) |
| 151 | { |
| 152 | u8 *h1 = vlib_buffer_get_current (b1); |
| 153 | vnet_rewrite_one_header (adj1[0], h1, |
| 154 | adj1->rewrite_header.data_bytes); |
| 155 | vlib_buffer_advance (b1, -adj1->rewrite_header.data_bytes); |
| 156 | em->counters[node_counter_base_index + L2_XCRW_ERROR_FWD]++; |
| 157 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 158 | |
| 159 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 160 | if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE))) |
| 161 | { |
| 162 | if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE) |
| 163 | && (b0->flags & VLIB_BUFFER_IS_TRACED))) |
| 164 | { |
| 165 | l2_xcrw_trace_t *t = |
| 166 | vlib_add_trace (vm, node, b0, sizeof (*t)); |
| 167 | t->next_index = next0; |
| 168 | t->tx_fib_index = adj0->rewrite_header.sw_if_index; |
| 169 | } |
| 170 | if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE) |
| 171 | && (b1->flags & VLIB_BUFFER_IS_TRACED))) |
| 172 | { |
| 173 | l2_xcrw_trace_t *t = |
| 174 | vlib_add_trace (vm, node, b1, sizeof (*t)); |
| 175 | t->next_index = next1; |
| 176 | t->tx_fib_index = adj1->rewrite_header.sw_if_index; |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | /* verify speculative enqueues, maybe switch current next frame */ |
| 181 | vlib_validate_buffer_enqueue_x2 (vm, node, next_index, |
| 182 | to_next, n_left_to_next, |
| 183 | bi0, bi1, next0, next1); |
| 184 | } |
| 185 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 186 | while (n_left_from > 0 && n_left_to_next > 0) |
| 187 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 188 | u32 bi0; |
| 189 | vlib_buffer_t *b0; |
| 190 | u32 next0; |
| 191 | u32 sw_if_index0; |
| 192 | l2_xcrw_adjacency_t *adj0; |
| 193 | |
| 194 | /* speculatively enqueue b0 to the current next frame */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 195 | bi0 = from[0]; |
| 196 | to_next[0] = bi0; |
| 197 | from += 1; |
| 198 | to_next += 1; |
| 199 | n_left_from -= 1; |
| 200 | n_left_to_next -= 1; |
| 201 | |
| 202 | b0 = vlib_get_buffer (vm, bi0); |
| 203 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 204 | sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX]; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 205 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 206 | adj0 = vec_elt_at_index (xcm->adj_by_sw_if_index, sw_if_index0); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 207 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 208 | next0 = adj0->rewrite_header.next_index; |
| 209 | vnet_buffer (b0)->sw_if_index[VLIB_TX] = |
| 210 | adj0->rewrite_header.sw_if_index; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 211 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 212 | if (PREDICT_TRUE (next0 > 0)) |
| 213 | { |
| 214 | u8 *h0 = vlib_buffer_get_current (b0); |
| 215 | vnet_rewrite_one_header (adj0[0], h0, |
| 216 | adj0->rewrite_header.data_bytes); |
| 217 | vlib_buffer_advance (b0, -adj0->rewrite_header.data_bytes); |
| 218 | em->counters[node_counter_base_index + L2_XCRW_ERROR_FWD]++; |
| 219 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 220 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 221 | if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE) |
| 222 | && (b0->flags & VLIB_BUFFER_IS_TRACED))) |
| 223 | { |
| 224 | l2_xcrw_trace_t *t = vlib_add_trace (vm, node, b0, sizeof (*t)); |
| 225 | t->next_index = next0; |
| 226 | t->tx_fib_index = adj0->rewrite_header.sw_if_index; |
| 227 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 228 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 229 | /* verify speculative enqueue, maybe switch current next frame */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 230 | vlib_validate_buffer_enqueue_x1 (vm, node, next_index, |
| 231 | to_next, n_left_to_next, |
| 232 | bi0, next0); |
| 233 | } |
| 234 | |
| 235 | vlib_put_next_frame (vm, node, next_index, n_left_to_next); |
| 236 | } |
| 237 | |
| 238 | return frame->n_vectors; |
| 239 | } |
| 240 | |
Filip Tehlar | 44f0f71 | 2019-03-11 04:26:37 -0700 | [diff] [blame] | 241 | VLIB_REGISTER_NODE (l2_xcrw_node) = { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 242 | .name = "l2-xcrw", |
| 243 | .vector_size = sizeof (u32), |
| 244 | .format_trace = format_l2_xcrw_trace, |
| 245 | .type = VLIB_NODE_TYPE_INTERNAL, |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 246 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 247 | .n_errors = ARRAY_LEN(l2_xcrw_error_strings), |
| 248 | .error_strings = l2_xcrw_error_strings, |
| 249 | |
| 250 | .n_next_nodes = L2_XCRW_N_NEXT, |
| 251 | |
| 252 | /* edit / add dispositions here */ |
| 253 | .next_nodes = { |
| 254 | [L2_XCRW_NEXT_DROP] = "error-drop", |
| 255 | }, |
| 256 | }; |
| 257 | |
Filip Tehlar | 44f0f71 | 2019-03-11 04:26:37 -0700 | [diff] [blame] | 258 | #ifndef CLIB_MARCH_VARIANT |
| 259 | clib_error_t * |
| 260 | l2_xcrw_init (vlib_main_t * vm) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 261 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 262 | l2_xcrw_main_t *mp = &l2_xcrw_main; |
| 263 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 264 | mp->vlib_main = vm; |
| 265 | mp->vnet_main = &vnet_main; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 266 | mp->tunnel_index_by_l2_sw_if_index = hash_create (0, sizeof (uword)); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 267 | |
| 268 | return 0; |
| 269 | } |
| 270 | |
| 271 | VLIB_INIT_FUNCTION (l2_xcrw_init); |
| 272 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 273 | static u8 * |
| 274 | format_xcrw_name (u8 * s, va_list * args) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 275 | { |
| 276 | u32 dev_instance = va_arg (*args, u32); |
| 277 | return format (s, "xcrw%d", dev_instance); |
| 278 | } |
| 279 | |
| 280 | VNET_DEVICE_CLASS (xcrw_device_class,static) = { |
| 281 | .name = "Xcrw", |
| 282 | .format_device_name = format_xcrw_name, |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 283 | }; |
| 284 | |
| 285 | /* Create a sham tunnel interface and return its sw_if_index */ |
| 286 | static u32 |
| 287 | create_xcrw_interface (vlib_main_t * vm) |
| 288 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 289 | vnet_main_t *vnm = vnet_get_main (); |
Damjan Marion | 5c954c4 | 2022-01-06 20:36:14 +0100 | [diff] [blame] | 290 | vnet_eth_interface_registration_t eir = {}; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 291 | static u32 instance; |
| 292 | u8 address[6]; |
| 293 | u32 hw_if_index; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 294 | vnet_hw_interface_t *hi; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 295 | u32 sw_if_index; |
| 296 | |
| 297 | /* mac address doesn't really matter */ |
Dave Barach | b7b9299 | 2018-10-17 10:38:51 -0400 | [diff] [blame] | 298 | clib_memset (address, 0, sizeof (address)); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 299 | address[2] = 0x12; |
| 300 | |
Damjan Marion | 5c954c4 | 2022-01-06 20:36:14 +0100 | [diff] [blame] | 301 | eir.dev_class_index = xcrw_device_class.index; |
| 302 | eir.dev_instance = instance++, eir.address = address; |
| 303 | hw_if_index = vnet_eth_register_interface (vnm, &eir); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 304 | |
| 305 | hi = vnet_get_hw_interface (vnm, hw_if_index); |
| 306 | sw_if_index = hi->sw_if_index; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 307 | vnet_sw_interface_set_flags (vnm, sw_if_index, |
| 308 | VNET_SW_INTERFACE_FLAG_ADMIN_UP); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 309 | |
| 310 | /* Output to the sham tunnel invokes the encap node */ |
| 311 | hi->output_node_index = l2_xcrw_node.index; |
| 312 | |
| 313 | return sw_if_index; |
| 314 | } |
| 315 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 316 | int |
| 317 | vnet_configure_l2_xcrw (vlib_main_t * vm, vnet_main_t * vnm, |
| 318 | u32 l2_sw_if_index, u32 tx_fib_index, |
| 319 | u8 * rewrite, u32 next_node_index, int is_add) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 320 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 321 | l2_xcrw_main_t *xcm = &l2_xcrw_main; |
| 322 | l2_xcrw_adjacency_t *a; |
| 323 | l2_xcrw_tunnel_t *t; |
| 324 | uword *p; |
| 325 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 326 | if (is_add) |
| 327 | { |
| 328 | |
| 329 | pool_get (xcm->tunnels, t); |
| 330 | |
| 331 | /* No interface allocated? Do it. Otherwise, set admin up */ |
| 332 | if (t->tunnel_sw_if_index == 0) |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 333 | t->tunnel_sw_if_index = create_xcrw_interface (vm); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 334 | else |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 335 | vnet_sw_interface_set_flags (vnm, t->tunnel_sw_if_index, |
| 336 | VNET_SW_INTERFACE_FLAG_ADMIN_UP); |
| 337 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 338 | t->l2_sw_if_index = l2_sw_if_index; |
| 339 | |
| 340 | vec_validate (xcm->adj_by_sw_if_index, t->l2_sw_if_index); |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 341 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 342 | a = vec_elt_at_index (xcm->adj_by_sw_if_index, t->l2_sw_if_index); |
Dave Barach | b7b9299 | 2018-10-17 10:38:51 -0400 | [diff] [blame] | 343 | clib_memset (a, 0, sizeof (*a)); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 344 | |
| 345 | a->rewrite_header.sw_if_index = tx_fib_index; |
| 346 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 347 | /* |
| 348 | * Add or find a dynamic disposition for the successor node, |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 349 | * e.g. so we can ship pkts to mpls_post_rewrite... |
| 350 | */ |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 351 | a->rewrite_header.next_index = |
| 352 | vlib_node_add_next (vm, l2_xcrw_node.index, next_node_index); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 353 | |
| 354 | if (vec_len (rewrite)) |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 355 | vnet_rewrite_set_data (a[0], rewrite, vec_len (rewrite)); |
| 356 | |
Neale Ranns | b474380 | 2018-09-05 09:13:57 -0700 | [diff] [blame] | 357 | set_int_l2_mode (vm, vnm, MODE_L2_XC, t->l2_sw_if_index, 0, |
| 358 | L2_BD_PORT_TYPE_NORMAL, 0, t->tunnel_sw_if_index); |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 359 | hash_set (xcm->tunnel_index_by_l2_sw_if_index, |
| 360 | t->l2_sw_if_index, t - xcm->tunnels); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 361 | return 0; |
| 362 | } |
| 363 | else |
| 364 | { |
| 365 | p = hash_get (xcm->tunnel_index_by_l2_sw_if_index, l2_sw_if_index); |
| 366 | if (p == 0) |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 367 | return VNET_API_ERROR_INVALID_SW_IF_INDEX; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 368 | |
| 369 | t = pool_elt_at_index (xcm->tunnels, p[0]); |
| 370 | |
| 371 | a = vec_elt_at_index (xcm->adj_by_sw_if_index, t->l2_sw_if_index); |
| 372 | /* Reset adj to drop traffic */ |
Dave Barach | b7b9299 | 2018-10-17 10:38:51 -0400 | [diff] [blame] | 373 | clib_memset (a, 0, sizeof (*a)); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 374 | |
Neale Ranns | b474380 | 2018-09-05 09:13:57 -0700 | [diff] [blame] | 375 | set_int_l2_mode (vm, vnm, MODE_L3, t->l2_sw_if_index, 0, |
| 376 | L2_BD_PORT_TYPE_NORMAL, 0, 0); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 377 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 378 | vnet_sw_interface_set_flags (vnm, t->tunnel_sw_if_index, 0 /* down */ ); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 379 | |
| 380 | hash_unset (xcm->tunnel_index_by_l2_sw_if_index, l2_sw_if_index); |
| 381 | pool_put (xcm->tunnels, t); |
| 382 | } |
| 383 | return 0; |
| 384 | } |
| 385 | |
| 386 | |
| 387 | static clib_error_t * |
| 388 | set_l2_xcrw_command_fn (vlib_main_t * vm, |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 389 | unformat_input_t * input, vlib_cli_command_t * cmd) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 390 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 391 | unformat_input_t _line_input, *line_input = &_line_input; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 392 | int is_add = 1; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 393 | int is_ipv6 = 0; /* for fib id -> fib index mapping */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 394 | u32 tx_fib_id = ~0; |
| 395 | u32 tx_fib_index = ~0; |
| 396 | u32 next_node_index = ~0; |
| 397 | u32 l2_sw_if_index; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 398 | u8 *rw = 0; |
| 399 | vnet_main_t *vnm = vnet_get_main (); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 400 | int rv; |
Billy McFall | a9a20e7 | 2017-02-15 11:39:12 -0500 | [diff] [blame] | 401 | clib_error_t *error = NULL; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 402 | |
| 403 | |
| 404 | if (!unformat_user (input, unformat_line_input, line_input)) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 405 | return 0; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 406 | |
| 407 | if (!unformat (line_input, "%U", |
| 408 | unformat_vnet_sw_interface, vnm, &l2_sw_if_index)) |
Billy McFall | a9a20e7 | 2017-02-15 11:39:12 -0500 | [diff] [blame] | 409 | { |
| 410 | error = clib_error_return (0, "unknown input '%U'", |
| 411 | format_unformat_error, line_input); |
| 412 | goto done; |
| 413 | } |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 414 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 415 | while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) |
| 416 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 417 | if (unformat (line_input, "next %U", |
| 418 | unformat_vlib_node, vm, &next_node_index)) |
| 419 | ; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 420 | else if (unformat (line_input, "tx-fib-id %d", &tx_fib_id)) |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 421 | ; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 422 | else if (unformat (line_input, "del")) |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 423 | is_add = 0; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 424 | else if (unformat (line_input, "ipv6")) |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 425 | is_ipv6 = 1; |
| 426 | else if (unformat (line_input, "rw %U", unformat_hex_string, &rw)); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 427 | else |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 428 | break; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 429 | } |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 430 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 431 | if (next_node_index == ~0) |
Billy McFall | a9a20e7 | 2017-02-15 11:39:12 -0500 | [diff] [blame] | 432 | { |
| 433 | error = clib_error_return (0, "next node not specified"); |
| 434 | goto done; |
| 435 | } |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 436 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 437 | if (tx_fib_id != ~0) |
| 438 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 439 | uword *p; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 440 | |
| 441 | if (is_ipv6) |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 442 | p = hash_get (ip6_main.fib_index_by_table_id, tx_fib_id); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 443 | else |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 444 | p = hash_get (ip4_main.fib_index_by_table_id, tx_fib_id); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 445 | |
| 446 | if (p == 0) |
Billy McFall | a9a20e7 | 2017-02-15 11:39:12 -0500 | [diff] [blame] | 447 | { |
| 448 | error = |
| 449 | clib_error_return (0, "nonexistent tx_fib_id %d", tx_fib_id); |
| 450 | goto done; |
| 451 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 452 | |
| 453 | tx_fib_index = p[0]; |
| 454 | } |
| 455 | |
| 456 | rv = vnet_configure_l2_xcrw (vm, vnm, l2_sw_if_index, tx_fib_index, |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 457 | rw, next_node_index, is_add); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 458 | |
| 459 | switch (rv) |
| 460 | { |
| 461 | |
| 462 | case 0: |
| 463 | break; |
| 464 | |
| 465 | case VNET_API_ERROR_INVALID_SW_IF_INDEX: |
Billy McFall | a9a20e7 | 2017-02-15 11:39:12 -0500 | [diff] [blame] | 466 | error = clib_error_return (0, "%U not cross-connected", |
| 467 | format_vnet_sw_if_index_name, |
| 468 | vnm, l2_sw_if_index); |
| 469 | goto done; |
| 470 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 471 | default: |
Billy McFall | a9a20e7 | 2017-02-15 11:39:12 -0500 | [diff] [blame] | 472 | error = clib_error_return (0, "vnet_configure_l2_xcrw returned %d", rv); |
| 473 | goto done; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 474 | } |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 475 | |
Billy McFall | a9a20e7 | 2017-02-15 11:39:12 -0500 | [diff] [blame] | 476 | done: |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 477 | vec_free (rw); |
Billy McFall | a9a20e7 | 2017-02-15 11:39:12 -0500 | [diff] [blame] | 478 | unformat_free (line_input); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 479 | |
Billy McFall | a9a20e7 | 2017-02-15 11:39:12 -0500 | [diff] [blame] | 480 | return error; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 481 | } |
| 482 | |
Billy McFall | 22aa3e9 | 2016-09-09 08:46:40 -0400 | [diff] [blame] | 483 | /*? |
| 484 | * Add or delete a Layer 2 to Layer 3 rewrite cross-connect. This is |
| 485 | * used to hook Layer 2 interface(s) up to the Layer 3 stack in |
| 486 | * arbitrary ways. For example, cross-connect an L2 interface or |
| 487 | * (future) bridge to an mpls-o-gre tunnel. Set up the L2 rewrite |
| 488 | * string as shown in mpls_gre_rewrite, and use \"mpls-post-rewrite\" |
| 489 | * to fix the GRE IP header checksum and length fields. |
| 490 | * |
| 491 | * @cliexpar |
| 492 | * @todo This is incomplete. This needs a detailed description and a |
| 493 | * practical example. |
| 494 | ?*/ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 495 | VLIB_CLI_COMMAND (set_l2_xcrw_command, static) = { |
| 496 | .path = "set interface l2 xcrw", |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 497 | .short_help = |
Billy McFall | 22aa3e9 | 2016-09-09 08:46:40 -0400 | [diff] [blame] | 498 | "set interface l2 xcrw <interface> next <node-name>\n" |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 499 | " [del] [tx-fib-id <id>] [ipv6] rw <hex-bytes>", |
| 500 | .function = set_l2_xcrw_command_fn, |
| 501 | }; |
| 502 | |
Filip Tehlar | 44f0f71 | 2019-03-11 04:26:37 -0700 | [diff] [blame] | 503 | #endif /* CLIB_MARCH_VARIANT */ |
| 504 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 505 | static u8 * |
| 506 | format_l2xcrw (u8 * s, va_list * args) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 507 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 508 | vnet_main_t *vnm = va_arg (*args, vnet_main_t *); |
| 509 | l2_xcrw_tunnel_t *t = va_arg (*args, l2_xcrw_tunnel_t *); |
| 510 | l2_xcrw_main_t *xcm = &l2_xcrw_main; |
| 511 | vlib_main_t *vm = vlib_get_main (); |
| 512 | l2_xcrw_adjacency_t *a; |
| 513 | u8 *rewrite_string; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 514 | |
| 515 | if (t == 0) |
| 516 | { |
| 517 | s = format (s, "%-25s%s", "L2 interface", "Tunnel Details"); |
| 518 | return s; |
| 519 | } |
| 520 | |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 521 | s = format (s, "%-25U %U ", |
| 522 | format_vnet_sw_if_index_name, vnm, t->l2_sw_if_index, |
| 523 | format_vnet_sw_if_index_name, vnm, t->tunnel_sw_if_index); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 524 | |
| 525 | a = vec_elt_at_index (xcm->adj_by_sw_if_index, t->l2_sw_if_index); |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 526 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 527 | s = format (s, "next %U ", |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 528 | format_vlib_next_node_name, vm, l2_xcrw_node.index, |
| 529 | a->rewrite_header.next_index); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 530 | |
| 531 | if (a->rewrite_header.sw_if_index != ~0) |
| 532 | s = format (s, "tx fib index %d ", a->rewrite_header.sw_if_index); |
| 533 | |
| 534 | if (a->rewrite_header.data_bytes) |
| 535 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 536 | rewrite_string = (u8 *) (a + 1); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 537 | rewrite_string -= a->rewrite_header.data_bytes; |
| 538 | s = format (s, "rewrite data: %U ", |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 539 | format_hex_bytes, rewrite_string, |
| 540 | a->rewrite_header.data_bytes); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 541 | } |
| 542 | |
| 543 | s = format (s, "\n"); |
| 544 | |
| 545 | return s; |
| 546 | } |
| 547 | |
| 548 | |
| 549 | static clib_error_t * |
| 550 | show_l2xcrw_command_fn (vlib_main_t * vm, |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 551 | unformat_input_t * input, vlib_cli_command_t * cmd) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 552 | { |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 553 | vnet_main_t *vnm = vnet_get_main (); |
| 554 | l2_xcrw_main_t *xcm = &l2_xcrw_main; |
| 555 | l2_xcrw_tunnel_t *t; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 556 | |
| 557 | if (pool_elts (xcm->tunnels) == 0) |
| 558 | { |
| 559 | vlib_cli_output (vm, "No L2 / L3 rewrite cross-connects configured"); |
| 560 | return 0; |
| 561 | } |
| 562 | |
| 563 | vlib_cli_output (vm, "%U", format_l2xcrw, 0, 0); |
| 564 | |
Damjan Marion | b2c31b6 | 2020-12-13 21:47:40 +0100 | [diff] [blame] | 565 | pool_foreach (t, xcm->tunnels) |
| 566 | { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 567 | vlib_cli_output (vm, "%U", format_l2xcrw, vnm, t); |
Damjan Marion | b2c31b6 | 2020-12-13 21:47:40 +0100 | [diff] [blame] | 568 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 569 | |
| 570 | return 0; |
| 571 | } |
| 572 | |
Billy McFall | 22aa3e9 | 2016-09-09 08:46:40 -0400 | [diff] [blame] | 573 | /*? |
| 574 | * Display a Layer 2 to Layer 3 rewrite cross-connect. This is used to |
| 575 | * hook Layer 2 interface(s) up to the Layer 3 stack in arbitrary ways. |
| 576 | * |
| 577 | * @todo This is incomplete. This needs a detailed description and a |
| 578 | * practical example. |
| 579 | ?*/ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 580 | VLIB_CLI_COMMAND (show_l2xcrw_command, static) = { |
| 581 | .path = "show l2xcrw", |
Billy McFall | 22aa3e9 | 2016-09-09 08:46:40 -0400 | [diff] [blame] | 582 | .short_help = "show l2xcrw", |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 583 | .function = show_l2xcrw_command_fn, |
| 584 | }; |
Dave Barach | 97d8dc2 | 2016-08-15 15:31:15 -0400 | [diff] [blame] | 585 | |
| 586 | /* |
| 587 | * fd.io coding-style-patch-verification: ON |
| 588 | * |
| 589 | * Local Variables: |
| 590 | * eval: (c-set-style "gnu") |
| 591 | * End: |
| 592 | */ |