dpdk: rework cryptodev ipsec build and setup
[vpp.git] / src / vnet / devices / 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 <vnet/devices/dpdk/ipsec/ipsec.h>
24 #include <vnet/devices/dpdk/ipsec/esp.h>
25 #include <vnet/devices/dpdk/dpdk.h>
26 #include <vnet/devices/dpdk/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 cpu_index = os_get_cpu_number ();
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   if (PREDICT_FALSE (!dcm->workers_main))
105     {
106       /* Likely there are not enough cryptodevs, so drop frame */
107       vlib_node_increment_counter (vm, dpdk_esp_encrypt_node.index,
108                                    ESP_ENCRYPT_ERROR_NO_CRYPTODEV,
109                                    n_left_from);
110       vlib_buffer_free (vm, from, n_left_from);
111       return n_left_from;
112     }
113
114   crypto_worker_main_t *cwm = vec_elt_at_index (dcm->workers_main, cpu_index);
115   u32 n_qps = vec_len (cwm->qp_data);
116   struct rte_crypto_op **cops_to_enq[n_qps];
117   u32 n_cop_qp[n_qps], *bi_to_enq[n_qps];
118
119   for (i = 0; i < n_qps; i++)
120     {
121       bi_to_enq[i] = cwm->qp_data[i].bi;
122       cops_to_enq[i] = cwm->qp_data[i].cops;
123     }
124
125   memset (n_cop_qp, 0, n_qps * sizeof (u32));
126
127   crypto_alloc_cops ();
128
129   next_index = ESP_ENCRYPT_NEXT_DROP;
130
131   while (n_left_from > 0)
132     {
133       u32 n_left_to_next;
134
135       vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
136
137       while (n_left_from > 0 && n_left_to_next > 0)
138         {
139           u32 bi0, next0;
140           vlib_buffer_t *b0 = 0;
141           u32 sa_index0;
142           ipsec_sa_t *sa0;
143           ip4_and_esp_header_t *ih0, *oh0 = 0;
144           ip6_and_esp_header_t *ih6_0, *oh6_0 = 0;
145           struct rte_mbuf *mb0 = 0;
146           esp_footer_t *f0;
147           u8 is_ipv6;
148           u8 ip_hdr_size;
149           u8 next_hdr_type;
150           u8 transport_mode = 0;
151           const int BLOCK_SIZE = 16;
152           u32 iv_size;
153           u16 orig_sz;
154           crypto_sa_session_t *sa_sess;
155           void *sess;
156           struct rte_crypto_op *cop = 0;
157           u16 qp_index;
158
159           bi0 = from[0];
160           from += 1;
161           n_left_from -= 1;
162
163           b0 = vlib_get_buffer (vm, bi0);
164           sa_index0 = vnet_buffer (b0)->ipsec.sad_index;
165           sa0 = pool_elt_at_index (im->sad, sa_index0);
166
167           if (PREDICT_FALSE (esp_seq_advance (sa0)))
168             {
169               clib_warning ("sequence number counter has cycled SPI %u",
170                             sa0->spi);
171               vlib_node_increment_counter (vm, dpdk_esp_encrypt_node.index,
172                                            ESP_ENCRYPT_ERROR_SEQ_CYCLED, 1);
173               //TODO: rekey SA
174               to_next[0] = bi0;
175               to_next += 1;
176               n_left_to_next -= 1;
177               goto trace;
178             }
179
180           sa_sess = pool_elt_at_index (cwm->sa_sess_d[1], sa_index0);
181           if (PREDICT_FALSE (!sa_sess->sess))
182             {
183               int ret = create_sym_sess (sa0, sa_sess, 1);
184
185               if (PREDICT_FALSE (ret))
186                 {
187                   to_next[0] = bi0;
188                   to_next += 1;
189                   n_left_to_next -= 1;
190                   goto trace;
191                 }
192             }
193
194           qp_index = sa_sess->qp_index;
195           sess = sa_sess->sess;
196
197           ASSERT (vec_len (vec_elt (cwm->qp_data, qp_index).free_cops) > 0);
198           cop = vec_pop (vec_elt (cwm->qp_data, qp_index).free_cops);
199           ASSERT (cop->status == RTE_CRYPTO_OP_STATUS_NOT_PROCESSED);
200
201           cops_to_enq[qp_index][0] = cop;
202           cops_to_enq[qp_index] += 1;
203           n_cop_qp[qp_index] += 1;
204           bi_to_enq[qp_index][0] = bi0;
205           bi_to_enq[qp_index] += 1;
206
207           ssize_t adv;
208           iv_size = em->esp_crypto_algs[sa0->crypto_alg].iv_len;
209           ih0 = vlib_buffer_get_current (b0);
210           orig_sz = b0->current_length;
211           is_ipv6 = (ih0->ip4.ip_version_and_header_length & 0xF0) == 0x60;
212           /* is ipv6 */
213           if (PREDICT_TRUE (sa0->is_tunnel))
214             {
215               if (PREDICT_TRUE (!is_ipv6))
216                 adv = -sizeof (ip4_and_esp_header_t);
217               else
218                 adv = -sizeof (ip6_and_esp_header_t);
219             }
220           else
221             {
222               adv = -sizeof (esp_header_t);
223               if (PREDICT_TRUE (!is_ipv6))
224                 orig_sz -= sizeof (ip4_header_t);
225               else
226                 orig_sz -= sizeof (ip6_header_t);
227             }
228
229           /*transport mode save the eth header before it is overwritten */
230           if (PREDICT_FALSE (!sa0->is_tunnel))
231             {
232               ethernet_header_t *ieh0 = (ethernet_header_t *)
233                 ((u8 *) vlib_buffer_get_current (b0) -
234                  sizeof (ethernet_header_t));
235               ethernet_header_t *oeh0 =
236                 (ethernet_header_t *) ((u8 *) ieh0 + (adv - iv_size));
237               clib_memcpy (oeh0, ieh0, sizeof (ethernet_header_t));
238             }
239
240           vlib_buffer_advance (b0, adv - iv_size);
241
242           /* XXX IP6/ip4 and IP4/IP6 not supported, only IP4/IP4 and IP6/IP6 */
243
244           /* is ipv6 */
245           if (PREDICT_FALSE (is_ipv6))
246             {
247               ih6_0 = (ip6_and_esp_header_t *) ih0;
248               ip_hdr_size = sizeof (ip6_header_t);
249               oh6_0 = vlib_buffer_get_current (b0);
250
251               if (PREDICT_TRUE (sa0->is_tunnel))
252                 {
253                   next_hdr_type = IP_PROTOCOL_IPV6;
254                   oh6_0->ip6.ip_version_traffic_class_and_flow_label =
255                     ih6_0->ip6.ip_version_traffic_class_and_flow_label;
256                 }
257               else
258                 {
259                   next_hdr_type = ih6_0->ip6.protocol;
260                   memmove (oh6_0, ih6_0, sizeof (ip6_header_t));
261                 }
262
263               oh6_0->ip6.protocol = IP_PROTOCOL_IPSEC_ESP;
264               oh6_0->ip6.hop_limit = 254;
265               oh6_0->esp.spi = clib_net_to_host_u32 (sa0->spi);
266               oh6_0->esp.seq = clib_net_to_host_u32 (sa0->seq);
267             }
268           else
269             {
270               ip_hdr_size = sizeof (ip4_header_t);
271               oh0 = vlib_buffer_get_current (b0);
272
273               if (PREDICT_TRUE (sa0->is_tunnel))
274                 {
275                   next_hdr_type = IP_PROTOCOL_IP_IN_IP;
276                   oh0->ip4.tos = ih0->ip4.tos;
277                 }
278               else
279                 {
280                   next_hdr_type = ih0->ip4.protocol;
281                   memmove (oh0, ih0, sizeof (ip4_header_t));
282                 }
283
284               oh0->ip4.ip_version_and_header_length = 0x45;
285               oh0->ip4.fragment_id = 0;
286               oh0->ip4.flags_and_fragment_offset = 0;
287               oh0->ip4.ttl = 254;
288               oh0->ip4.protocol = IP_PROTOCOL_IPSEC_ESP;
289               oh0->esp.spi = clib_net_to_host_u32 (sa0->spi);
290               oh0->esp.seq = clib_net_to_host_u32 (sa0->seq);
291             }
292
293           if (PREDICT_TRUE (sa0->is_tunnel && !sa0->is_tunnel_ip6))
294             {
295               oh0->ip4.src_address.as_u32 = sa0->tunnel_src_addr.ip4.as_u32;
296               oh0->ip4.dst_address.as_u32 = sa0->tunnel_dst_addr.ip4.as_u32;
297
298               /* in tunnel mode send it back to FIB */
299               next0 = ESP_ENCRYPT_NEXT_IP4_LOOKUP;
300               vnet_buffer (b0)->sw_if_index[VLIB_TX] = (u32) ~ 0;
301             }
302           else if (sa0->is_tunnel && sa0->is_tunnel_ip6)
303             {
304               oh6_0->ip6.src_address.as_u64[0] =
305                 sa0->tunnel_src_addr.ip6.as_u64[0];
306               oh6_0->ip6.src_address.as_u64[1] =
307                 sa0->tunnel_src_addr.ip6.as_u64[1];
308               oh6_0->ip6.dst_address.as_u64[0] =
309                 sa0->tunnel_dst_addr.ip6.as_u64[0];
310               oh6_0->ip6.dst_address.as_u64[1] =
311                 sa0->tunnel_dst_addr.ip6.as_u64[1];
312
313               /* in tunnel mode send it back to FIB */
314               next0 = ESP_ENCRYPT_NEXT_IP6_LOOKUP;
315               vnet_buffer (b0)->sw_if_index[VLIB_TX] = (u32) ~ 0;
316             }
317           else
318             {
319               next0 = ESP_ENCRYPT_NEXT_INTERFACE_OUTPUT;
320               transport_mode = 1;
321             }
322
323           ASSERT (sa0->crypto_alg < IPSEC_CRYPTO_N_ALG);
324           ASSERT (sa0->crypto_alg != IPSEC_CRYPTO_ALG_NONE);
325
326           int blocks = 1 + (orig_sz + 1) / BLOCK_SIZE;
327
328           /* pad packet in input buffer */
329           u8 pad_bytes = BLOCK_SIZE * blocks - 2 - orig_sz;
330           u8 i;
331           u8 *padding = vlib_buffer_get_current (b0) + b0->current_length;
332
333           for (i = 0; i < pad_bytes; ++i)
334             padding[i] = i + 1;
335
336           f0 = vlib_buffer_get_current (b0) + b0->current_length + pad_bytes;
337           f0->pad_length = pad_bytes;
338           f0->next_header = next_hdr_type;
339           b0->current_length += pad_bytes + 2 +
340             em->esp_integ_algs[sa0->integ_alg].trunc_size;
341
342           vnet_buffer (b0)->sw_if_index[VLIB_RX] =
343             vnet_buffer (b0)->sw_if_index[VLIB_RX];
344           b0->flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
345
346           struct rte_crypto_sym_op *sym_cop;
347           sym_cop = (struct rte_crypto_sym_op *) (cop + 1);
348
349           dpdk_cop_priv_t *priv = (dpdk_cop_priv_t *) (sym_cop + 1);
350
351           vnet_buffer (b0)->unused[0] = next0;
352
353           mb0 = rte_mbuf_from_vlib_buffer (b0);
354           mb0->data_len = b0->current_length;
355           mb0->pkt_len = b0->current_length;
356           mb0->data_off = RTE_PKTMBUF_HEADROOM + b0->current_data;
357
358           rte_crypto_op_attach_sym_session (cop, sess);
359
360           sym_cop->m_src = mb0;
361
362           dpdk_gcm_cnt_blk *icb = &priv->cb;
363           icb->salt = sa0->salt;
364           icb->iv[0] = sa0->seq;
365           icb->iv[1] = sa0->seq_hi;
366
367           if (sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_128)
368             {
369               icb->cnt = clib_host_to_net_u32 (1);
370               clib_memcpy (vlib_buffer_get_current (b0) + ip_hdr_size +
371                            sizeof (esp_header_t), icb->iv, 8);
372               sym_cop->cipher.data.offset =
373                 ip_hdr_size + sizeof (esp_header_t) + iv_size;
374               sym_cop->cipher.data.length = BLOCK_SIZE * blocks;
375               sym_cop->cipher.iv.length = 16;
376             }
377           else
378             {
379               sym_cop->cipher.data.offset =
380                 ip_hdr_size + sizeof (esp_header_t);
381               sym_cop->cipher.data.length = BLOCK_SIZE * blocks + iv_size;
382               sym_cop->cipher.iv.length = iv_size;
383             }
384
385           sym_cop->cipher.iv.data = (u8 *) icb;
386           sym_cop->cipher.iv.phys_addr = cop->phys_addr + (uintptr_t) icb
387             - (uintptr_t) cop;
388
389
390           ASSERT (sa0->integ_alg < IPSEC_INTEG_N_ALG);
391           ASSERT (sa0->integ_alg != IPSEC_INTEG_ALG_NONE);
392
393           if (PREDICT_FALSE (sa0->integ_alg == IPSEC_INTEG_ALG_AES_GCM_128))
394             {
395               u8 *aad = priv->aad;
396               clib_memcpy (aad, vlib_buffer_get_current (b0) + ip_hdr_size,
397                            8);
398               sym_cop->auth.aad.data = aad;
399               sym_cop->auth.aad.phys_addr = cop->phys_addr +
400                 (uintptr_t) aad - (uintptr_t) cop;
401
402               if (PREDICT_FALSE (sa0->use_esn))
403                 {
404                   *((u32 *) & aad[8]) = sa0->seq_hi;
405                   sym_cop->auth.aad.length = 12;
406                 }
407               else
408                 {
409                   sym_cop->auth.aad.length = 8;
410                 }
411             }
412           else
413             {
414               sym_cop->auth.data.offset = ip_hdr_size;
415               sym_cop->auth.data.length = b0->current_length - ip_hdr_size
416                 - em->esp_integ_algs[sa0->integ_alg].trunc_size;
417
418               if (PREDICT_FALSE (sa0->use_esn))
419                 {
420                   u8 *payload_end =
421                     vlib_buffer_get_current (b0) + b0->current_length;
422                   *((u32 *) payload_end) = sa0->seq_hi;
423                   sym_cop->auth.data.length += sizeof (sa0->seq_hi);
424                 }
425             }
426           sym_cop->auth.digest.data = vlib_buffer_get_current (b0) +
427             b0->current_length -
428             em->esp_integ_algs[sa0->integ_alg].trunc_size;
429           sym_cop->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset (mb0,
430                                                                        b0->current_length
431                                                                        -
432                                                                        em->esp_integ_algs
433                                                                        [sa0->integ_alg].trunc_size);
434           sym_cop->auth.digest.length =
435             em->esp_integ_algs[sa0->integ_alg].trunc_size;
436
437
438           if (PREDICT_FALSE (is_ipv6))
439             {
440               oh6_0->ip6.payload_length =
441                 clib_host_to_net_u16 (vlib_buffer_length_in_chain (vm, b0) -
442                                       sizeof (ip6_header_t));
443             }
444           else
445             {
446               oh0->ip4.length =
447                 clib_host_to_net_u16 (vlib_buffer_length_in_chain (vm, b0));
448               oh0->ip4.checksum = ip4_header_checksum (&oh0->ip4);
449             }
450
451           if (transport_mode)
452             vlib_buffer_advance (b0, -sizeof (ethernet_header_t));
453
454         trace:
455           if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
456             {
457               esp_encrypt_trace_t *tr =
458                 vlib_add_trace (vm, node, b0, sizeof (*tr));
459               tr->spi = sa0->spi;
460               tr->seq = sa0->seq - 1;
461               tr->crypto_alg = sa0->crypto_alg;
462               tr->integ_alg = sa0->integ_alg;
463             }
464         }
465       vlib_put_next_frame (vm, node, next_index, n_left_to_next);
466     }
467   vlib_node_increment_counter (vm, dpdk_esp_encrypt_node.index,
468                                ESP_ENCRYPT_ERROR_RX_PKTS,
469                                from_frame->n_vectors);
470   crypto_qp_data_t *qpd;
471   /* *INDENT-OFF* */
472   vec_foreach_index (i, cwm->qp_data)
473     {
474       u32 enq;
475
476       qpd = vec_elt_at_index(cwm->qp_data, i);
477       enq = rte_cryptodev_enqueue_burst(qpd->dev_id, qpd->qp_id,
478                                         qpd->cops, n_cop_qp[i]);
479       qpd->inflights += enq;
480
481       if (PREDICT_FALSE(enq < n_cop_qp[i]))
482         {
483           crypto_free_cop (qpd, &qpd->cops[enq], n_cop_qp[i] - enq);
484           vlib_buffer_free (vm, &qpd->bi[enq], n_cop_qp[i] - enq);
485
486           vlib_node_increment_counter (vm, dpdk_esp_encrypt_node.index,
487                                        ESP_ENCRYPT_ERROR_ENQ_FAIL,
488                                        n_cop_qp[i] - enq);
489         }
490     }
491   /* *INDENT-ON* */
492
493   return from_frame->n_vectors;
494 }
495
496 VLIB_REGISTER_NODE (dpdk_esp_encrypt_node) =
497 {
498   .function = dpdk_esp_encrypt_node_fn,.name = "dpdk-esp-encrypt",.flags =
499     VLIB_NODE_FLAG_IS_OUTPUT,.vector_size = sizeof (u32),.format_trace =
500     format_esp_encrypt_trace,.n_errors =
501     ARRAY_LEN (esp_encrypt_error_strings),.error_strings =
502     esp_encrypt_error_strings,.n_next_nodes = 1,.next_nodes =
503   {
504   [ESP_ENCRYPT_NEXT_DROP] = "error-drop",}
505 };
506
507 VLIB_NODE_FUNCTION_MULTIARCH (dpdk_esp_encrypt_node, dpdk_esp_encrypt_node_fn)
508 /*
509  * ESP Encrypt Post Node
510  */
511 #define foreach_esp_encrypt_post_error              \
512  _(PKTS, "ESP post pkts")
513      typedef enum
514      {
515 #define _(sym,str) ESP_ENCRYPT_POST_ERROR_##sym,
516        foreach_esp_encrypt_post_error
517 #undef _
518          ESP_ENCRYPT_POST_N_ERROR,
519      } esp_encrypt_post_error_t;
520
521      static char *esp_encrypt_post_error_strings[] = {
522 #define _(sym,string) string,
523        foreach_esp_encrypt_post_error
524 #undef _
525      };
526
527 vlib_node_registration_t dpdk_esp_encrypt_post_node;
528
529 static u8 *
530 format_esp_encrypt_post_trace (u8 * s, va_list * args)
531 {
532   return s;
533 }
534
535 static uword
536 dpdk_esp_encrypt_post_node_fn (vlib_main_t * vm,
537                                vlib_node_runtime_t * node,
538                                vlib_frame_t * from_frame)
539 {
540   u32 n_left_from, *from, *to_next = 0, next_index;
541
542   from = vlib_frame_vector_args (from_frame);
543   n_left_from = from_frame->n_vectors;
544
545   next_index = node->cached_next_index;
546
547   while (n_left_from > 0)
548     {
549       u32 n_left_to_next;
550
551       vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
552
553       while (n_left_from > 0 && n_left_to_next > 0)
554         {
555           u32 bi0, next0;
556           vlib_buffer_t *b0 = 0;
557
558           bi0 = from[0];
559           from += 1;
560           n_left_from -= 1;
561           n_left_to_next -= 1;
562
563           b0 = vlib_get_buffer (vm, bi0);
564
565           to_next[0] = bi0;
566           to_next += 1;
567
568           next0 = vnet_buffer (b0)->unused[0];
569
570           vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
571                                            to_next, n_left_to_next, bi0,
572                                            next0);
573         }
574       vlib_put_next_frame (vm, node, next_index, n_left_to_next);
575     }
576
577   vlib_node_increment_counter (vm, dpdk_esp_encrypt_post_node.index,
578                                ESP_ENCRYPT_POST_ERROR_PKTS,
579                                from_frame->n_vectors);
580
581   return from_frame->n_vectors;
582 }
583
584 VLIB_REGISTER_NODE (dpdk_esp_encrypt_post_node) =
585 {
586   .function = dpdk_esp_encrypt_post_node_fn,.name =
587     "dpdk-esp-encrypt-post",.vector_size = sizeof (u32),.format_trace =
588     format_esp_encrypt_post_trace,.type = VLIB_NODE_TYPE_INTERNAL,.n_errors =
589     ARRAY_LEN (esp_encrypt_post_error_strings),.error_strings =
590     esp_encrypt_post_error_strings,.n_next_nodes =
591     ESP_ENCRYPT_N_NEXT,.next_nodes =
592   {
593 #define _(s,n) [ESP_ENCRYPT_NEXT_##s] = n,
594     foreach_esp_encrypt_next
595 #undef _
596   }
597 };
598
599 VLIB_NODE_FUNCTION_MULTIARCH (dpdk_esp_encrypt_post_node,
600                               dpdk_esp_encrypt_post_node_fn)
601 /*
602  * fd.io coding-style-patch-verification: ON
603  *
604  * Local Variables:
605  * eval: (c-set-style "gnu")
606  * End:
607  */