dpdk: ipsec fixes
[vpp.git] / src / plugins / dpdk / ipsec / esp_encrypt.c
1 /*
2  * esp_encrypt.c : IPSec ESP encrypt node using DPDK Cryptodev
3  *
4  * Copyright (c) 2016 Intel and/or its affiliates.
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 #include <vnet/vnet.h>
19 #include <vnet/api_errno.h>
20 #include <vnet/ip/ip.h>
21
22 #include <vnet/ipsec/ipsec.h>
23 #include <dpdk/ipsec/ipsec.h>
24 #include <dpdk/ipsec/esp.h>
25 #include <dpdk/device/dpdk.h>
26 #include <dpdk/device/dpdk_priv.h>
27
28 #define foreach_esp_encrypt_next                   \
29 _(DROP, "error-drop")                              \
30 _(IP4_LOOKUP, "ip4-lookup")                        \
31 _(IP6_LOOKUP, "ip6-lookup")                        \
32 _(INTERFACE_OUTPUT, "interface-output")
33
34 #define _(v, s) ESP_ENCRYPT_NEXT_##v,
35 typedef enum
36 {
37   foreach_esp_encrypt_next
38 #undef _
39     ESP_ENCRYPT_N_NEXT,
40 } esp_encrypt_next_t;
41
42 #define foreach_esp_encrypt_error                   \
43  _(RX_PKTS, "ESP pkts received")                    \
44  _(SEQ_CYCLED, "sequence number cycled")            \
45  _(ENQ_FAIL, "Enqueue failed (buffer full)")        \
46  _(NO_CRYPTODEV, "Cryptodev not configured")        \
47  _(UNSUPPORTED, "Cipher/Auth not supported")
48
49
50 typedef enum
51 {
52 #define _(sym,str) ESP_ENCRYPT_ERROR_##sym,
53   foreach_esp_encrypt_error
54 #undef _
55     ESP_ENCRYPT_N_ERROR,
56 } esp_encrypt_error_t;
57
58 static char *esp_encrypt_error_strings[] = {
59 #define _(sym,string) string,
60   foreach_esp_encrypt_error
61 #undef _
62 };
63
64 vlib_node_registration_t dpdk_esp_encrypt_node;
65
66 typedef struct
67 {
68   u32 spi;
69   u32 seq;
70   ipsec_crypto_alg_t crypto_alg;
71   ipsec_integ_alg_t integ_alg;
72 } esp_encrypt_trace_t;
73
74 /* packet trace format function */
75 static u8 *
76 format_esp_encrypt_trace (u8 * s, va_list * args)
77 {
78   CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
79   CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
80   esp_encrypt_trace_t *t = va_arg (*args, esp_encrypt_trace_t *);
81
82   s = format (s, "esp: spi %u seq %u crypto %U integrity %U",
83               t->spi, t->seq,
84               format_ipsec_crypto_alg, t->crypto_alg,
85               format_ipsec_integ_alg, t->integ_alg);
86   return s;
87 }
88
89 static uword
90 dpdk_esp_encrypt_node_fn (vlib_main_t * vm,
91                           vlib_node_runtime_t * node,
92                           vlib_frame_t * from_frame)
93 {
94   u32 n_left_from, *from, *to_next, next_index;
95   ipsec_main_t *im = &ipsec_main;
96   u32 thread_index = vlib_get_thread_index ();
97   dpdk_crypto_main_t *dcm = &dpdk_crypto_main;
98   dpdk_esp_main_t *em = &dpdk_esp_main;
99   u32 i;
100
101   from = vlib_frame_vector_args (from_frame);
102   n_left_from = from_frame->n_vectors;
103
104   crypto_worker_main_t *cwm =
105     vec_elt_at_index (dcm->workers_main, thread_index);
106   u32 n_qps = vec_len (cwm->qp_data);
107   struct rte_crypto_op **cops_to_enq[n_qps];
108   u32 n_cop_qp[n_qps], *bi_to_enq[n_qps];
109
110   for (i = 0; i < n_qps; i++)
111     {
112       bi_to_enq[i] = cwm->qp_data[i].bi;
113       cops_to_enq[i] = cwm->qp_data[i].cops;
114     }
115
116   memset (n_cop_qp, 0, n_qps * sizeof (u32));
117
118   crypto_alloc_cops ();
119
120   next_index = ESP_ENCRYPT_NEXT_DROP;
121
122   while (n_left_from > 0)
123     {
124       u32 n_left_to_next;
125
126       vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
127
128       while (n_left_from > 0 && n_left_to_next > 0)
129         {
130           u32 bi0, next0;
131           vlib_buffer_t *b0 = 0;
132           u32 sa_index0;
133           ipsec_sa_t *sa0;
134           ip4_and_esp_header_t *ih0, *oh0 = 0;
135           ip6_and_esp_header_t *ih6_0, *oh6_0 = 0;
136           struct rte_mbuf *mb0 = 0;
137           esp_footer_t *f0;
138           u8 is_ipv6;
139           u8 ip_hdr_size;
140           u8 next_hdr_type;
141           u8 transport_mode = 0;
142           const int BLOCK_SIZE = 16;
143           u32 iv_size;
144           u16 orig_sz;
145           crypto_sa_session_t *sa_sess;
146           void *sess;
147           struct rte_crypto_op *cop = 0;
148           u16 qp_index;
149
150           bi0 = from[0];
151           from += 1;
152           n_left_from -= 1;
153
154           b0 = vlib_get_buffer (vm, bi0);
155           sa_index0 = vnet_buffer (b0)->ipsec.sad_index;
156           sa0 = pool_elt_at_index (im->sad, sa_index0);
157
158           if (PREDICT_FALSE (esp_seq_advance (sa0)))
159             {
160               clib_warning ("sequence number counter has cycled SPI %u",
161                             sa0->spi);
162               vlib_node_increment_counter (vm, dpdk_esp_encrypt_node.index,
163                                            ESP_ENCRYPT_ERROR_SEQ_CYCLED, 1);
164               //TODO: rekey SA
165               to_next[0] = bi0;
166               to_next += 1;
167               n_left_to_next -= 1;
168               goto trace;
169             }
170
171           sa0->total_data_size += b0->current_length;
172
173           sa_sess = pool_elt_at_index (cwm->sa_sess_d[1], sa_index0);
174           if (PREDICT_FALSE (!sa_sess->sess))
175             {
176               int ret = create_sym_sess (sa0, sa_sess, 1);
177
178               if (PREDICT_FALSE (ret))
179                 {
180                   to_next[0] = bi0;
181                   to_next += 1;
182                   n_left_to_next -= 1;
183                   goto trace;
184                 }
185             }
186
187           qp_index = sa_sess->qp_index;
188           sess = sa_sess->sess;
189
190           ASSERT (vec_len (vec_elt (cwm->qp_data, qp_index).free_cops) > 0);
191           cop = vec_pop (vec_elt (cwm->qp_data, qp_index).free_cops);
192           ASSERT (cop->status == RTE_CRYPTO_OP_STATUS_NOT_PROCESSED);
193
194           cops_to_enq[qp_index][0] = cop;
195           cops_to_enq[qp_index] += 1;
196           n_cop_qp[qp_index] += 1;
197           bi_to_enq[qp_index][0] = bi0;
198           bi_to_enq[qp_index] += 1;
199
200           ssize_t adv;
201           iv_size = em->esp_crypto_algs[sa0->crypto_alg].iv_len;
202           ih0 = vlib_buffer_get_current (b0);
203           orig_sz = b0->current_length;
204           is_ipv6 = (ih0->ip4.ip_version_and_header_length & 0xF0) == 0x60;
205           /* is ipv6 */
206           if (PREDICT_TRUE (sa0->is_tunnel))
207             {
208               if (PREDICT_TRUE (!is_ipv6))
209                 adv = -sizeof (ip4_and_esp_header_t);
210               else
211                 adv = -sizeof (ip6_and_esp_header_t);
212             }
213           else
214             {
215               adv = -sizeof (esp_header_t);
216               if (PREDICT_TRUE (!is_ipv6))
217                 orig_sz -= sizeof (ip4_header_t);
218               else
219                 orig_sz -= sizeof (ip6_header_t);
220             }
221
222           /*transport mode save the eth header before it is overwritten */
223           if (PREDICT_FALSE (!sa0->is_tunnel))
224             {
225               ethernet_header_t *ieh0 = (ethernet_header_t *)
226                 ((u8 *) vlib_buffer_get_current (b0) -
227                  sizeof (ethernet_header_t));
228               ethernet_header_t *oeh0 =
229                 (ethernet_header_t *) ((u8 *) ieh0 + (adv - iv_size));
230               clib_memcpy (oeh0, ieh0, sizeof (ethernet_header_t));
231             }
232
233           vlib_buffer_advance (b0, adv - iv_size);
234
235           /* XXX IP6/ip4 and IP4/IP6 not supported, only IP4/IP4 and IP6/IP6 */
236
237           /* is ipv6 */
238           if (PREDICT_FALSE (is_ipv6))
239             {
240               ih6_0 = (ip6_and_esp_header_t *) ih0;
241               ip_hdr_size = sizeof (ip6_header_t);
242               oh6_0 = vlib_buffer_get_current (b0);
243
244               if (PREDICT_TRUE (sa0->is_tunnel))
245                 {
246                   next_hdr_type = IP_PROTOCOL_IPV6;
247                   oh6_0->ip6.ip_version_traffic_class_and_flow_label =
248                     ih6_0->ip6.ip_version_traffic_class_and_flow_label;
249                 }
250               else
251                 {
252                   next_hdr_type = ih6_0->ip6.protocol;
253                   memmove (oh6_0, ih6_0, sizeof (ip6_header_t));
254                 }
255
256               oh6_0->ip6.protocol = IP_PROTOCOL_IPSEC_ESP;
257               oh6_0->ip6.hop_limit = 254;
258               oh6_0->esp.spi = clib_net_to_host_u32 (sa0->spi);
259               oh6_0->esp.seq = clib_net_to_host_u32 (sa0->seq);
260             }
261           else
262             {
263               ip_hdr_size = sizeof (ip4_header_t);
264               oh0 = vlib_buffer_get_current (b0);
265
266               if (PREDICT_TRUE (sa0->is_tunnel))
267                 {
268                   next_hdr_type = IP_PROTOCOL_IP_IN_IP;
269                   oh0->ip4.tos = ih0->ip4.tos;
270                 }
271               else
272                 {
273                   next_hdr_type = ih0->ip4.protocol;
274                   memmove (oh0, ih0, sizeof (ip4_header_t));
275                 }
276
277               oh0->ip4.ip_version_and_header_length = 0x45;
278               oh0->ip4.fragment_id = 0;
279               oh0->ip4.flags_and_fragment_offset = 0;
280               oh0->ip4.ttl = 254;
281               oh0->ip4.protocol = IP_PROTOCOL_IPSEC_ESP;
282               oh0->esp.spi = clib_net_to_host_u32 (sa0->spi);
283               oh0->esp.seq = clib_net_to_host_u32 (sa0->seq);
284             }
285
286           if (PREDICT_TRUE
287               (!is_ipv6 && sa0->is_tunnel && !sa0->is_tunnel_ip6))
288             {
289               oh0->ip4.src_address.as_u32 = sa0->tunnel_src_addr.ip4.as_u32;
290               oh0->ip4.dst_address.as_u32 = sa0->tunnel_dst_addr.ip4.as_u32;
291
292               /* in tunnel mode send it back to FIB */
293               next0 = ESP_ENCRYPT_NEXT_IP4_LOOKUP;
294               vnet_buffer (b0)->sw_if_index[VLIB_TX] = (u32) ~ 0;
295             }
296           else if (is_ipv6 && sa0->is_tunnel && sa0->is_tunnel_ip6)
297             {
298               oh6_0->ip6.src_address.as_u64[0] =
299                 sa0->tunnel_src_addr.ip6.as_u64[0];
300               oh6_0->ip6.src_address.as_u64[1] =
301                 sa0->tunnel_src_addr.ip6.as_u64[1];
302               oh6_0->ip6.dst_address.as_u64[0] =
303                 sa0->tunnel_dst_addr.ip6.as_u64[0];
304               oh6_0->ip6.dst_address.as_u64[1] =
305                 sa0->tunnel_dst_addr.ip6.as_u64[1];
306
307               /* in tunnel mode send it back to FIB */
308               next0 = ESP_ENCRYPT_NEXT_IP6_LOOKUP;
309               vnet_buffer (b0)->sw_if_index[VLIB_TX] = (u32) ~ 0;
310             }
311           else
312             {
313               next0 = ESP_ENCRYPT_NEXT_INTERFACE_OUTPUT;
314               transport_mode = 1;
315             }
316
317           ASSERT (sa0->crypto_alg < IPSEC_CRYPTO_N_ALG);
318           ASSERT (sa0->crypto_alg != IPSEC_CRYPTO_ALG_NONE);
319
320           int blocks = 1 + (orig_sz + 1) / BLOCK_SIZE;
321
322           /* pad packet in input buffer */
323           u8 pad_bytes = BLOCK_SIZE * blocks - 2 - orig_sz;
324           u8 i;
325           u8 *padding = vlib_buffer_get_current (b0) + b0->current_length;
326
327           for (i = 0; i < pad_bytes; ++i)
328             padding[i] = i + 1;
329
330           f0 = vlib_buffer_get_current (b0) + b0->current_length + pad_bytes;
331           f0->pad_length = pad_bytes;
332           f0->next_header = next_hdr_type;
333           b0->current_length += pad_bytes + 2 +
334             em->esp_integ_algs[sa0->integ_alg].trunc_size;
335
336           vnet_buffer (b0)->sw_if_index[VLIB_RX] =
337             vnet_buffer (b0)->sw_if_index[VLIB_RX];
338           b0->flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
339
340           struct rte_crypto_sym_op *sym_cop;
341           sym_cop = (struct rte_crypto_sym_op *) (cop + 1);
342
343           dpdk_cop_priv_t *priv = (dpdk_cop_priv_t *) (sym_cop + 1);
344
345           vnet_buffer (b0)->unused[0] = next0;
346
347           mb0 = rte_mbuf_from_vlib_buffer (b0);
348           mb0->data_len = b0->current_length;
349           mb0->pkt_len = b0->current_length;
350           mb0->data_off = RTE_PKTMBUF_HEADROOM + b0->current_data;
351
352           rte_crypto_op_attach_sym_session (cop, sess);
353
354           sym_cop->m_src = mb0;
355
356           dpdk_gcm_cnt_blk *icb = &priv->cb;
357           icb->salt = sa0->salt;
358           icb->iv[0] = sa0->seq;
359           icb->iv[1] = sa0->seq_hi;
360           icb->cnt = clib_host_to_net_u32 (1);
361
362           if (sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_128)
363             {
364               u32 *esp_iv =
365                 (u32 *) vlib_buffer_get_current (b0) + ip_hdr_size +
366                 sizeof (esp_header_t);
367               esp_iv[0] = sa0->seq;
368               esp_iv[1] = sa0->seq_hi;
369               sym_cop->cipher.data.offset =
370                 ip_hdr_size + sizeof (esp_header_t) + iv_size;
371               sym_cop->cipher.data.length = BLOCK_SIZE * blocks;
372               sym_cop->cipher.iv.length = 16;
373             }
374           else
375             {
376               sym_cop->cipher.data.offset =
377                 ip_hdr_size + sizeof (esp_header_t);
378               sym_cop->cipher.data.length = BLOCK_SIZE * blocks + iv_size;
379               sym_cop->cipher.iv.length = iv_size;
380             }
381
382           sym_cop->cipher.iv.data = (u8 *) icb;
383           sym_cop->cipher.iv.phys_addr = cop->phys_addr + (uintptr_t) icb
384             - (uintptr_t) cop;
385
386
387           ASSERT (sa0->integ_alg < IPSEC_INTEG_N_ALG);
388           ASSERT (sa0->integ_alg != IPSEC_INTEG_ALG_NONE);
389
390           if (PREDICT_FALSE (sa0->integ_alg == IPSEC_INTEG_ALG_AES_GCM_128))
391             {
392               u8 *aad = priv->aad;
393               clib_memcpy (aad, vlib_buffer_get_current (b0) + ip_hdr_size,
394                            8);
395               sym_cop->auth.aad.data = aad;
396               sym_cop->auth.aad.phys_addr = cop->phys_addr +
397                 (uintptr_t) aad - (uintptr_t) cop;
398
399               if (PREDICT_FALSE (sa0->use_esn))
400                 {
401                   *((u32 *) & aad[8]) = sa0->seq_hi;
402                   sym_cop->auth.aad.length = 12;
403                 }
404               else
405                 {
406                   sym_cop->auth.aad.length = 8;
407                 }
408             }
409           else
410             {
411               sym_cop->auth.data.offset = ip_hdr_size;
412               sym_cop->auth.data.length = b0->current_length - ip_hdr_size
413                 - em->esp_integ_algs[sa0->integ_alg].trunc_size;
414
415               if (PREDICT_FALSE (sa0->use_esn))
416                 {
417                   u8 *payload_end =
418                     vlib_buffer_get_current (b0) + b0->current_length;
419                   *((u32 *) payload_end) = sa0->seq_hi;
420                   sym_cop->auth.data.length += sizeof (sa0->seq_hi);
421                 }
422             }
423           sym_cop->auth.digest.data = vlib_buffer_get_current (b0) +
424             b0->current_length -
425             em->esp_integ_algs[sa0->integ_alg].trunc_size;
426           sym_cop->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset (mb0,
427                                                                        b0->current_length
428                                                                        -
429                                                                        em->esp_integ_algs
430                                                                        [sa0->integ_alg].trunc_size);
431           sym_cop->auth.digest.length =
432             em->esp_integ_algs[sa0->integ_alg].trunc_size;
433
434
435           if (PREDICT_FALSE (is_ipv6))
436             {
437               oh6_0->ip6.payload_length =
438                 clib_host_to_net_u16 (vlib_buffer_length_in_chain (vm, b0) -
439                                       sizeof (ip6_header_t));
440             }
441           else
442             {
443               oh0->ip4.length =
444                 clib_host_to_net_u16 (vlib_buffer_length_in_chain (vm, b0));
445               oh0->ip4.checksum = ip4_header_checksum (&oh0->ip4);
446             }
447
448           if (transport_mode)
449             vlib_buffer_advance (b0, -sizeof (ethernet_header_t));
450
451         trace:
452           if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
453             {
454               esp_encrypt_trace_t *tr =
455                 vlib_add_trace (vm, node, b0, sizeof (*tr));
456               tr->spi = sa0->spi;
457               tr->seq = sa0->seq - 1;
458               tr->crypto_alg = sa0->crypto_alg;
459               tr->integ_alg = sa0->integ_alg;
460             }
461         }
462       vlib_put_next_frame (vm, node, next_index, n_left_to_next);
463     }
464   vlib_node_increment_counter (vm, dpdk_esp_encrypt_node.index,
465                                ESP_ENCRYPT_ERROR_RX_PKTS,
466                                from_frame->n_vectors);
467   crypto_qp_data_t *qpd;
468   /* *INDENT-OFF* */
469   vec_foreach_index (i, cwm->qp_data)
470     {
471       u32 enq;
472
473       qpd = vec_elt_at_index(cwm->qp_data, i);
474       enq = rte_cryptodev_enqueue_burst(qpd->dev_id, qpd->qp_id,
475                                         qpd->cops, n_cop_qp[i]);
476       qpd->inflights += enq;
477
478       if (PREDICT_FALSE(enq < n_cop_qp[i]))
479         {
480           crypto_free_cop (qpd, &qpd->cops[enq], n_cop_qp[i] - enq);
481           vlib_buffer_free (vm, &qpd->bi[enq], n_cop_qp[i] - enq);
482
483           vlib_node_increment_counter (vm, dpdk_esp_encrypt_node.index,
484                                        ESP_ENCRYPT_ERROR_ENQ_FAIL,
485                                        n_cop_qp[i] - enq);
486         }
487     }
488   /* *INDENT-ON* */
489
490   return from_frame->n_vectors;
491 }
492
493 /* *INDENT-OFF* */
494 VLIB_REGISTER_NODE (dpdk_esp_encrypt_node) = {
495   .function = dpdk_esp_encrypt_node_fn,
496   .name = "dpdk-esp-encrypt",
497   .flags = VLIB_NODE_FLAG_IS_OUTPUT,
498   .vector_size = sizeof (u32),
499   .format_trace = format_esp_encrypt_trace,
500   .n_errors = ARRAY_LEN (esp_encrypt_error_strings),
501   .error_strings = esp_encrypt_error_strings,
502   .n_next_nodes = 1,
503   .next_nodes =
504     {
505       [ESP_ENCRYPT_NEXT_DROP] = "error-drop",
506     }
507 };
508 /* *INDENT-ON* */
509
510 VLIB_NODE_FUNCTION_MULTIARCH (dpdk_esp_encrypt_node, dpdk_esp_encrypt_node_fn)
511 /*
512  * ESP Encrypt Post Node
513  */
514 #define foreach_esp_encrypt_post_error              \
515  _(PKTS, "ESP post pkts")
516      typedef enum
517      {
518 #define _(sym,str) ESP_ENCRYPT_POST_ERROR_##sym,
519        foreach_esp_encrypt_post_error
520 #undef _
521          ESP_ENCRYPT_POST_N_ERROR,
522      } esp_encrypt_post_error_t;
523
524      static char *esp_encrypt_post_error_strings[] = {
525 #define _(sym,string) string,
526        foreach_esp_encrypt_post_error
527 #undef _
528      };
529
530 vlib_node_registration_t dpdk_esp_encrypt_post_node;
531
532 static u8 *
533 format_esp_encrypt_post_trace (u8 * s, va_list * args)
534 {
535   return s;
536 }
537
538 static uword
539 dpdk_esp_encrypt_post_node_fn (vlib_main_t * vm,
540                                vlib_node_runtime_t * node,
541                                vlib_frame_t * from_frame)
542 {
543   u32 n_left_from, *from, *to_next = 0, next_index;
544
545   from = vlib_frame_vector_args (from_frame);
546   n_left_from = from_frame->n_vectors;
547
548   next_index = node->cached_next_index;
549
550   while (n_left_from > 0)
551     {
552       u32 n_left_to_next;
553
554       vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
555
556       while (n_left_from > 0 && n_left_to_next > 0)
557         {
558           u32 bi0, next0;
559           vlib_buffer_t *b0 = 0;
560
561           bi0 = from[0];
562           from += 1;
563           n_left_from -= 1;
564           n_left_to_next -= 1;
565
566           b0 = vlib_get_buffer (vm, bi0);
567
568           to_next[0] = bi0;
569           to_next += 1;
570
571           next0 = vnet_buffer (b0)->unused[0];
572
573           vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
574                                            to_next, n_left_to_next, bi0,
575                                            next0);
576         }
577       vlib_put_next_frame (vm, node, next_index, n_left_to_next);
578     }
579
580   vlib_node_increment_counter (vm, dpdk_esp_encrypt_post_node.index,
581                                ESP_ENCRYPT_POST_ERROR_PKTS,
582                                from_frame->n_vectors);
583
584   return from_frame->n_vectors;
585 }
586
587 /* *INDENT-OFF* */
588 VLIB_REGISTER_NODE (dpdk_esp_encrypt_post_node) = {
589   .function = dpdk_esp_encrypt_post_node_fn,
590   .name = "dpdk-esp-encrypt-post",
591   .vector_size = sizeof (u32),
592   .format_trace = format_esp_encrypt_post_trace,
593   .type = VLIB_NODE_TYPE_INTERNAL,
594   .n_errors = ARRAY_LEN (esp_encrypt_post_error_strings),
595   .error_strings = esp_encrypt_post_error_strings,
596   .n_next_nodes = ESP_ENCRYPT_N_NEXT,
597   .next_nodes =
598     {
599 #define _(s,n) [ESP_ENCRYPT_NEXT_##s] = n,
600       foreach_esp_encrypt_next
601 #undef _
602     }
603 };
604 /* *INDENT-ON* */
605
606 VLIB_NODE_FUNCTION_MULTIARCH (dpdk_esp_encrypt_post_node,
607                               dpdk_esp_encrypt_post_node_fn)
608 /*
609  * fd.io coding-style-patch-verification: ON
610  *
611  * Local Variables:
612  * eval: (c-set-style "gnu")
613  * End:
614  */