blob: 9006b1b943dcb5c0c37e10941e77b73422f3ba26 [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001/*
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 */
Keith Burns (alagalah)d46cca12016-08-25 11:21:39 -070015/**
16 * @file
17 * @brief Functions for encapsulating VXLAN GPE tunnels
18 *
19*/
Ed Warnickecb9cada2015-12-08 15:45:58 -070020#include <vppinfra/error.h>
21#include <vppinfra/hash.h>
22#include <vnet/vnet.h>
23#include <vnet/ip/ip.h>
24#include <vnet/ethernet/ethernet.h>
Keith Burns (alagalah)94b14422016-05-05 18:16:50 -070025#include <vnet/vxlan-gpe/vxlan_gpe.h>
Ed Warnickecb9cada2015-12-08 15:45:58 -070026
Keith Burns (alagalah)d46cca12016-08-25 11:21:39 -070027/** Statistics (not really errors) */
Keith Burns (alagalah)94b14422016-05-05 18:16:50 -070028#define foreach_vxlan_gpe_encap_error \
Ed Warnickecb9cada2015-12-08 15:45:58 -070029_(ENCAPSULATED, "good packets encapsulated")
30
Keith Burns (alagalah)d46cca12016-08-25 11:21:39 -070031/**
32 * @brief VXLAN GPE encap error strings
33 */
sharath reddy6f8273a2017-12-11 11:31:31 +053034static char *vxlan_gpe_encap_error_strings[] = {
Ed Warnickecb9cada2015-12-08 15:45:58 -070035#define _(sym,string) string,
Keith Burns (alagalah)94b14422016-05-05 18:16:50 -070036 foreach_vxlan_gpe_encap_error
Ed Warnickecb9cada2015-12-08 15:45:58 -070037#undef _
38};
39
Keith Burns (alagalah)d46cca12016-08-25 11:21:39 -070040/**
41 * @brief Struct for VXLAN GPE errors/counters
42 */
sharath reddy6f8273a2017-12-11 11:31:31 +053043typedef enum
44{
Keith Burns (alagalah)94b14422016-05-05 18:16:50 -070045#define _(sym,str) VXLAN_GPE_ENCAP_ERROR_##sym,
sharath reddy6f8273a2017-12-11 11:31:31 +053046 foreach_vxlan_gpe_encap_error
Ed Warnickecb9cada2015-12-08 15:45:58 -070047#undef _
Keith Burns (alagalah)94b14422016-05-05 18:16:50 -070048 VXLAN_GPE_ENCAP_N_ERROR,
49} vxlan_gpe_encap_error_t;
Ed Warnickecb9cada2015-12-08 15:45:58 -070050
Keith Burns (alagalah)d46cca12016-08-25 11:21:39 -070051/**
Keith Burns (alagalah)d46cca12016-08-25 11:21:39 -070052 * @brief Struct for tracing VXLAN GPE encapsulated packets
53 */
sharath reddy6f8273a2017-12-11 11:31:31 +053054typedef struct
55{
Ed Warnickecb9cada2015-12-08 15:45:58 -070056 u32 tunnel_index;
Keith Burns (alagalah)94b14422016-05-05 18:16:50 -070057} vxlan_gpe_encap_trace_t;
Ed Warnickecb9cada2015-12-08 15:45:58 -070058
Keith Burns (alagalah)d46cca12016-08-25 11:21:39 -070059/**
60 * @brief Trace of packets encapsulated in VXLAN GPE
61 *
62 * @param *s
63 * @param *args
64 *
65 * @return *s
66 *
67 */
sharath reddy6f8273a2017-12-11 11:31:31 +053068u8 *
69format_vxlan_gpe_encap_trace (u8 * s, va_list * args)
Ed Warnickecb9cada2015-12-08 15:45:58 -070070{
71 CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
72 CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
sharath reddy6f8273a2017-12-11 11:31:31 +053073 vxlan_gpe_encap_trace_t *t = va_arg (*args, vxlan_gpe_encap_trace_t *);
Ed Warnickecb9cada2015-12-08 15:45:58 -070074
Keith Burns (alagalah)94b14422016-05-05 18:16:50 -070075 s = format (s, "VXLAN-GPE-ENCAP: tunnel %d", t->tunnel_index);
Ed Warnickecb9cada2015-12-08 15:45:58 -070076 return s;
77}
78
Keith Burns (alagalah)d46cca12016-08-25 11:21:39 -070079/**
80 * @brief Instantiates UDP + VXLAN-GPE header then set next node to IP4|6 lookup
81 *
82 * @param *ngm
83 * @param *b0
84 * @param *t0 contains rewrite header
85 * @param *next0 relative index of next dispatch function (next node)
86 * @param is_v4 Is this IPv4? (or IPv6)
87 *
88 */
Hongjun Nidf921cc2016-05-25 01:16:19 +080089always_inline void
90vxlan_gpe_encap_one_inline (vxlan_gpe_main_t * ngm, vlib_buffer_t * b0,
sharath reddy6f8273a2017-12-11 11:31:31 +053091 vxlan_gpe_tunnel_t * t0, u32 * next0, u8 is_v4)
Hongjun Nidf921cc2016-05-25 01:16:19 +080092{
sharath reddy6f8273a2017-12-11 11:31:31 +053093 ASSERT (sizeof (ip4_vxlan_gpe_header_t) == 36);
94 ASSERT (sizeof (ip6_vxlan_gpe_header_t) == 56);
Hongjun Nidf921cc2016-05-25 01:16:19 +080095
Vengada Govindan6d403a02016-10-12 05:54:09 -070096 ip_udp_encap_one (ngm->vlib_main, b0, t0->rewrite, t0->rewrite_size, is_v4);
97 next0[0] = t0->encap_next_node;
Hongjun Nidf921cc2016-05-25 01:16:19 +080098}
99
Keith Burns (alagalah)d46cca12016-08-25 11:21:39 -0700100/**
101 * @brief Instantiates UDP + VXLAN-GPE header then set next node to IP4|6 lookup for two packets
102 *
103 * @param *ngm
104 * @param *b0 Packet0
105 * @param *b1 Packet1
106 * @param *t0 contains rewrite header for Packet0
107 * @param *t1 contains rewrite header for Packet1
108 * @param *next0 relative index of next dispatch function (next node) for Packet0
109 * @param *next1 relative index of next dispatch function (next node) for Packet1
110 * @param is_v4 Is this IPv4? (or IPv6)
111 *
112 */
Hongjun Nidf921cc2016-05-25 01:16:19 +0800113always_inline void
Vengada Govindan6d403a02016-10-12 05:54:09 -0700114vxlan_gpe_encap_two_inline (vxlan_gpe_main_t * ngm, vlib_buffer_t * b0,
sharath reddy6f8273a2017-12-11 11:31:31 +0530115 vlib_buffer_t * b1, vxlan_gpe_tunnel_t * t0,
116 vxlan_gpe_tunnel_t * t1, u32 * next0,
117 u32 * next1, u8 is_v4)
Hongjun Nidf921cc2016-05-25 01:16:19 +0800118{
sharath reddy6f8273a2017-12-11 11:31:31 +0530119 ASSERT (sizeof (ip4_vxlan_gpe_header_t) == 36);
120 ASSERT (sizeof (ip6_vxlan_gpe_header_t) == 56);
Hongjun Nidf921cc2016-05-25 01:16:19 +0800121
Vengada Govindan6d403a02016-10-12 05:54:09 -0700122 ip_udp_encap_one (ngm->vlib_main, b0, t0->rewrite, t0->rewrite_size, is_v4);
123 ip_udp_encap_one (ngm->vlib_main, b1, t1->rewrite, t1->rewrite_size, is_v4);
124 next0[0] = next1[0] = t0->encap_next_node;
Hongjun Nidf921cc2016-05-25 01:16:19 +0800125}
Ed Warnickecb9cada2015-12-08 15:45:58 -0700126
Keith Burns (alagalah)d46cca12016-08-25 11:21:39 -0700127/**
128 * @brief Common processing for IPv4 and IPv6 VXLAN GPE encap dispatch functions
129 *
130 * It is worth noting that other than trivial UDP forwarding (transit), VXLAN GPE
131 * tunnels are "establish local". This means that we don't have a TX interface as yet
132 * as we need to look up where the outer-header dest is. By setting the TX index in the
133 * buffer metadata to the encap FIB, we can do a lookup to get the adjacency and real TX.
134 *
135 * vnet_buffer(b0)->sw_if_index[VLIB_TX] = t0->encap_fib_index;
136 *
137 * @node vxlan-gpe-input
138 * @param *vm
139 * @param *node
140 * @param *from_frame
141 *
142 * @return from_frame->n_vectors
143 *
144 */
Ed Warnickecb9cada2015-12-08 15:45:58 -0700145static uword
Keith Burns (alagalah)94b14422016-05-05 18:16:50 -0700146vxlan_gpe_encap (vlib_main_t * vm,
sharath reddy6f8273a2017-12-11 11:31:31 +0530147 vlib_node_runtime_t * node, vlib_frame_t * from_frame)
Ed Warnickecb9cada2015-12-08 15:45:58 -0700148{
Hongjun Nidf921cc2016-05-25 01:16:19 +0800149 u32 n_left_from, next_index, *from, *to_next;
sharath reddy6f8273a2017-12-11 11:31:31 +0530150 vxlan_gpe_main_t *ngm = &vxlan_gpe_main;
151 vnet_main_t *vnm = ngm->vnet_main;
152 vnet_interface_main_t *im = &vnm->interface_main;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700153 u32 pkts_encapsulated = 0;
Damjan Marion067cd622018-07-11 12:47:43 +0200154 u32 thread_index = vm->thread_index;
Hongjun Nib2cdd2f2016-04-06 16:20:22 -0700155 u32 stats_sw_if_index, stats_n_packets, stats_n_bytes;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700156
157 from = vlib_frame_vector_args (from_frame);
158 n_left_from = from_frame->n_vectors;
159
160 next_index = node->cached_next_index;
Hongjun Nib2cdd2f2016-04-06 16:20:22 -0700161 stats_sw_if_index = node->runtime_data[0];
162 stats_n_packets = stats_n_bytes = 0;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700163
164 while (n_left_from > 0)
165 {
sharath reddy6f8273a2017-12-11 11:31:31 +0530166 u32 n_left_to_next;
Zhiyong Yang6011b5e2018-09-04 06:33:18 -0400167 u32 sw_if_index0 = ~0, sw_if_index1 = ~0, len0, len1;
168 vnet_hw_interface_t *hi0, *hi1;
169 vxlan_gpe_tunnel_t *t0 = NULL, *t1 = NULL;
170 u8 is_ip4_0 = 0, is_ip4_1 = 0;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700171
sharath reddy6f8273a2017-12-11 11:31:31 +0530172 vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700173
sharath reddy6f8273a2017-12-11 11:31:31 +0530174 while (n_left_from >= 4 && n_left_to_next >= 2)
175 {
176 u32 bi0, bi1;
177 vlib_buffer_t *b0, *b1;
178 u32 next0, next1;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700179
sharath reddy6f8273a2017-12-11 11:31:31 +0530180 next0 = next1 = VXLAN_GPE_ENCAP_NEXT_IP4_LOOKUP;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700181
sharath reddy6f8273a2017-12-11 11:31:31 +0530182 /* Prefetch next iteration. */
183 {
184 vlib_buffer_t *p2, *p3;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700185
sharath reddy6f8273a2017-12-11 11:31:31 +0530186 p2 = vlib_get_buffer (vm, from[2]);
187 p3 = vlib_get_buffer (vm, from[3]);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700188
sharath reddy6f8273a2017-12-11 11:31:31 +0530189 vlib_prefetch_buffer_header (p2, LOAD);
190 vlib_prefetch_buffer_header (p3, LOAD);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700191
sharath reddy6f8273a2017-12-11 11:31:31 +0530192 CLIB_PREFETCH (p2->data, 2 * CLIB_CACHE_LINE_BYTES, LOAD);
193 CLIB_PREFETCH (p3->data, 2 * CLIB_CACHE_LINE_BYTES, LOAD);
194 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700195
sharath reddy6f8273a2017-12-11 11:31:31 +0530196 bi0 = from[0];
197 bi1 = from[1];
198 to_next[0] = bi0;
199 to_next[1] = bi1;
200 from += 2;
201 to_next += 2;
202 n_left_to_next -= 2;
203 n_left_from -= 2;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700204
sharath reddy6f8273a2017-12-11 11:31:31 +0530205 b0 = vlib_get_buffer (vm, bi0);
206 b1 = vlib_get_buffer (vm, bi1);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700207
Zhiyong Yang6011b5e2018-09-04 06:33:18 -0400208 /* get the flag "is_ip4" */
209 if (sw_if_index0 != vnet_buffer (b0)->sw_if_index[VLIB_TX])
210 {
211 sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_TX];
212 hi0 =
213 vnet_get_sup_hw_interface (vnm,
214 vnet_buffer (b0)->sw_if_index
215 [VLIB_TX]);
216 t0 = pool_elt_at_index (ngm->tunnels, hi0->dev_instance);
217 is_ip4_0 = (t0->flags & VXLAN_GPE_TUNNEL_IS_IPV4);
218 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700219
Zhiyong Yang6011b5e2018-09-04 06:33:18 -0400220 /* get the flag "is_ip4" */
221 if (sw_if_index1 != vnet_buffer (b1)->sw_if_index[VLIB_TX])
222 {
223 if (sw_if_index0 == vnet_buffer (b1)->sw_if_index[VLIB_TX])
224 {
225 sw_if_index1 = sw_if_index0;
226 hi1 = hi0;
227 t1 = t0;
228 is_ip4_1 = is_ip4_0;
229 }
230 else
231 {
232 sw_if_index1 = vnet_buffer (b1)->sw_if_index[VLIB_TX];
233 hi1 =
234 vnet_get_sup_hw_interface (vnm,
235 vnet_buffer (b1)->sw_if_index
236 [VLIB_TX]);
237 t1 = pool_elt_at_index (ngm->tunnels, hi1->dev_instance);
238 is_ip4_1 = (t1->flags & VXLAN_GPE_TUNNEL_IS_IPV4);
239 }
240 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700241
sharath reddy6f8273a2017-12-11 11:31:31 +0530242 if (PREDICT_TRUE (is_ip4_0 == is_ip4_1))
243 {
244 vxlan_gpe_encap_two_inline (ngm, b0, b1, t0, t1, &next0, &next1,
245 is_ip4_0);
246 }
247 else
248 {
249 vxlan_gpe_encap_one_inline (ngm, b0, t0, &next0, is_ip4_0);
250 vxlan_gpe_encap_one_inline (ngm, b1, t1, &next1, is_ip4_1);
251 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700252
sharath reddy6f8273a2017-12-11 11:31:31 +0530253 /* Reset to look up tunnel partner in the configured FIB */
254 vnet_buffer (b0)->sw_if_index[VLIB_TX] = t0->encap_fib_index;
255 vnet_buffer (b1)->sw_if_index[VLIB_TX] = t1->encap_fib_index;
256 vnet_buffer (b0)->sw_if_index[VLIB_RX] = sw_if_index0;
257 vnet_buffer (b1)->sw_if_index[VLIB_RX] = sw_if_index1;
258 pkts_encapsulated += 2;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700259
sharath reddy6f8273a2017-12-11 11:31:31 +0530260 len0 = vlib_buffer_length_in_chain (vm, b0);
Zhiyong Yang3575abb2018-08-17 04:36:50 -0400261 len1 = vlib_buffer_length_in_chain (vm, b1);
sharath reddy6f8273a2017-12-11 11:31:31 +0530262 stats_n_packets += 2;
263 stats_n_bytes += len0 + len1;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700264
sharath reddy6f8273a2017-12-11 11:31:31 +0530265 /* Batch stats increment on the same vxlan tunnel so counter is not
266 incremented per packet. Note stats are still incremented for deleted
267 and admin-down tunnel where packets are dropped. It is not worthwhile
268 to check for this rare case and affect normal path performance. */
269 if (PREDICT_FALSE ((sw_if_index0 != stats_sw_if_index)
270 || (sw_if_index1 != stats_sw_if_index)))
271 {
272 stats_n_packets -= 2;
273 stats_n_bytes -= len0 + len1;
274 if (sw_if_index0 == sw_if_index1)
275 {
276 if (stats_n_packets)
277 vlib_increment_combined_counter
278 (im->combined_sw_if_counters +
279 VNET_INTERFACE_COUNTER_TX, thread_index,
280 stats_sw_if_index, stats_n_packets, stats_n_bytes);
281 stats_sw_if_index = sw_if_index0;
282 stats_n_packets = 2;
283 stats_n_bytes = len0 + len1;
284 }
285 else
286 {
287 vlib_increment_combined_counter (im->combined_sw_if_counters
288 +
289 VNET_INTERFACE_COUNTER_TX,
290 thread_index, sw_if_index0,
291 1, len0);
292 vlib_increment_combined_counter (im->combined_sw_if_counters
293 +
294 VNET_INTERFACE_COUNTER_TX,
295 thread_index, sw_if_index1,
296 1, len1);
297 }
298 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700299
sharath reddy6f8273a2017-12-11 11:31:31 +0530300 if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
301 {
302 vxlan_gpe_encap_trace_t *tr =
303 vlib_add_trace (vm, node, b0, sizeof (*tr));
304 tr->tunnel_index = t0 - ngm->tunnels;
305 }
306
307 if (PREDICT_FALSE (b1->flags & VLIB_BUFFER_IS_TRACED))
308 {
309 vxlan_gpe_encap_trace_t *tr = vlib_add_trace (vm, node, b1,
310 sizeof (*tr));
311 tr->tunnel_index = t1 - ngm->tunnels;
312 }
313
314 vlib_validate_buffer_enqueue_x2 (vm, node, next_index, to_next,
315 n_left_to_next, bi0, bi1, next0,
316 next1);
317 }
318
319 while (n_left_from > 0 && n_left_to_next > 0)
320 {
321 u32 bi0;
322 vlib_buffer_t *b0;
323 u32 next0 = VXLAN_GPE_ENCAP_NEXT_IP4_LOOKUP;
sharath reddy6f8273a2017-12-11 11:31:31 +0530324
325 bi0 = from[0];
326 to_next[0] = bi0;
327 from += 1;
328 to_next += 1;
329 n_left_from -= 1;
330 n_left_to_next -= 1;
331
332 b0 = vlib_get_buffer (vm, bi0);
333
Zhiyong Yang6011b5e2018-09-04 06:33:18 -0400334 /* get the flag "is_ip4" */
335 if (sw_if_index0 != vnet_buffer (b0)->sw_if_index[VLIB_TX])
336 {
337 sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_TX];
338 hi0 =
339 vnet_get_sup_hw_interface (vnm,
340 vnet_buffer (b0)->sw_if_index
341 [VLIB_TX]);
sharath reddy6f8273a2017-12-11 11:31:31 +0530342
Zhiyong Yang6011b5e2018-09-04 06:33:18 -0400343 t0 = pool_elt_at_index (ngm->tunnels, hi0->dev_instance);
sharath reddy6f8273a2017-12-11 11:31:31 +0530344
Zhiyong Yang6011b5e2018-09-04 06:33:18 -0400345 is_ip4_0 = (t0->flags & VXLAN_GPE_TUNNEL_IS_IPV4);
346 }
sharath reddy6f8273a2017-12-11 11:31:31 +0530347
348 vxlan_gpe_encap_one_inline (ngm, b0, t0, &next0, is_ip4_0);
349
350 /* Reset to look up tunnel partner in the configured FIB */
351 vnet_buffer (b0)->sw_if_index[VLIB_TX] = t0->encap_fib_index;
352 vnet_buffer (b0)->sw_if_index[VLIB_RX] = sw_if_index0;
353 pkts_encapsulated++;
354
355 len0 = vlib_buffer_length_in_chain (vm, b0);
356 stats_n_packets += 1;
357 stats_n_bytes += len0;
358
359 /* Batch stats increment on the same vxlan tunnel so counter is not
360 * incremented per packet. Note stats are still incremented for deleted
361 * and admin-down tunnel where packets are dropped. It is not worthwhile
362 * to check for this rare case and affect normal path performance. */
363 if (PREDICT_FALSE (sw_if_index0 != stats_sw_if_index))
364 {
365 stats_n_packets -= 1;
366 stats_n_bytes -= len0;
367 if (stats_n_packets)
368 vlib_increment_combined_counter (im->combined_sw_if_counters +
369 VNET_INTERFACE_COUNTER_TX,
370 thread_index,
371 stats_sw_if_index,
372 stats_n_packets,
373 stats_n_bytes);
374 stats_n_packets = 1;
375 stats_n_bytes = len0;
376 stats_sw_if_index = sw_if_index0;
377 }
378 if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
379 {
380 vxlan_gpe_encap_trace_t *tr = vlib_add_trace (vm, node, b0,
381 sizeof (*tr));
382 tr->tunnel_index = t0 - ngm->tunnels;
383 }
384 vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next,
385 n_left_to_next, bi0, next0);
386 }
387
388 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700389 }
Hongjun Nib2cdd2f2016-04-06 16:20:22 -0700390 vlib_node_increment_counter (vm, node->node_index,
sharath reddy6f8273a2017-12-11 11:31:31 +0530391 VXLAN_GPE_ENCAP_ERROR_ENCAPSULATED,
392 pkts_encapsulated);
Hongjun Nib2cdd2f2016-04-06 16:20:22 -0700393 /* Increment any remaining batch stats */
Hongjun Nidf921cc2016-05-25 01:16:19 +0800394 if (stats_n_packets)
sharath reddy6f8273a2017-12-11 11:31:31 +0530395 {
396 vlib_increment_combined_counter (im->combined_sw_if_counters +
397 VNET_INTERFACE_COUNTER_TX,
398 thread_index, stats_sw_if_index,
399 stats_n_packets, stats_n_bytes);
400 node->runtime_data[0] = stats_sw_if_index;
401 }
Hongjun Nib2cdd2f2016-04-06 16:20:22 -0700402
Ed Warnickecb9cada2015-12-08 15:45:58 -0700403 return from_frame->n_vectors;
404}
405
sharath reddy6f8273a2017-12-11 11:31:31 +0530406/* *INDENT-OFF* */
Keith Burns (alagalah)94b14422016-05-05 18:16:50 -0700407VLIB_REGISTER_NODE (vxlan_gpe_encap_node) = {
408 .function = vxlan_gpe_encap,
409 .name = "vxlan-gpe-encap",
Ed Warnickecb9cada2015-12-08 15:45:58 -0700410 .vector_size = sizeof (u32),
Keith Burns (alagalah)94b14422016-05-05 18:16:50 -0700411 .format_trace = format_vxlan_gpe_encap_trace,
Ed Warnickecb9cada2015-12-08 15:45:58 -0700412 .type = VLIB_NODE_TYPE_INTERNAL,
413
Keith Burns (alagalah)94b14422016-05-05 18:16:50 -0700414 .n_errors = ARRAY_LEN(vxlan_gpe_encap_error_strings),
415 .error_strings = vxlan_gpe_encap_error_strings,
Ed Warnickecb9cada2015-12-08 15:45:58 -0700416
Keith Burns (alagalah)94b14422016-05-05 18:16:50 -0700417 .n_next_nodes = VXLAN_GPE_ENCAP_N_NEXT,
Ed Warnickecb9cada2015-12-08 15:45:58 -0700418
419 .next_nodes = {
Hongjun Nidf921cc2016-05-25 01:16:19 +0800420 [VXLAN_GPE_ENCAP_NEXT_IP4_LOOKUP] = "ip4-lookup",
Hongjun Nibeb4bf72016-11-25 00:03:46 +0800421 [VXLAN_GPE_ENCAP_NEXT_IP6_LOOKUP] = "ip6-lookup",
Hongjun Nidf921cc2016-05-25 01:16:19 +0800422 [VXLAN_GPE_ENCAP_NEXT_DROP] = "error-drop",
Ed Warnickecb9cada2015-12-08 15:45:58 -0700423 },
424};
sharath reddy6f8273a2017-12-11 11:31:31 +0530425/* *INDENT-ON* */
Keith Burns (alagalah)94b14422016-05-05 18:16:50 -0700426
sharath reddy6f8273a2017-12-11 11:31:31 +0530427
428/*
429 * fd.io coding-style-patch-verification: ON
430 *
431 * Local Variables:
432 * eval: (c-set-style "gnu")
433 * End:
434 */