dpdk/ipsec: rework plus improved cli commands
[vpp.git] / src / plugins / dpdk / ipsec / esp_decrypt.c
1 /*
2  * esp_decrypt.c : IPSec ESP Decrypt node using DPDK Cryptodev
3  *
4  * Copyright (c) 2017 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 opy 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/ipsec/esp.h>
24 #include <dpdk/ipsec/ipsec.h>
25 #include <dpdk/device/dpdk.h>
26 #include <dpdk/device/dpdk_priv.h>
27
28 #define foreach_esp_decrypt_next               \
29 _(DROP, "error-drop")                          \
30 _(IP4_INPUT, "ip4-input-no-checksum")          \
31 _(IP6_INPUT, "ip6-input")
32
33 #define _(v, s) ESP_DECRYPT_NEXT_##v,
34 typedef enum {
35   foreach_esp_decrypt_next
36 #undef _
37   ESP_DECRYPT_N_NEXT,
38 } esp_decrypt_next_t;
39
40 #define foreach_esp_decrypt_error                \
41  _(RX_PKTS, "ESP pkts received")                 \
42  _(DECRYPTION_FAILED, "ESP decryption failed")   \
43  _(REPLAY, "SA replayed packet")                 \
44  _(NOT_IP, "Not IP packet (dropped)")            \
45  _(ENQ_FAIL, "Enqueue failed (buffer full)")     \
46  _(DISCARD, "Not enough crypto operations, discarding frame")  \
47  _(BAD_LEN, "Invalid ciphertext length")         \
48  _(SESSION, "Failed to get crypto session")      \
49  _(NOSUP, "Cipher/Auth not supported")
50
51
52 typedef enum {
53 #define _(sym,str) ESP_DECRYPT_ERROR_##sym,
54   foreach_esp_decrypt_error
55 #undef _
56   ESP_DECRYPT_N_ERROR,
57 } esp_decrypt_error_t;
58
59 static char * esp_decrypt_error_strings[] = {
60 #define _(sym,string) string,
61   foreach_esp_decrypt_error
62 #undef _
63 };
64
65 vlib_node_registration_t dpdk_esp_decrypt_node;
66
67 typedef struct {
68   ipsec_crypto_alg_t crypto_alg;
69   ipsec_integ_alg_t integ_alg;
70   u8 packet_data[64];
71 } esp_decrypt_trace_t;
72
73 /* packet trace format function */
74 static u8 * format_esp_decrypt_trace (u8 * s, va_list * args)
75 {
76   CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
77   CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
78   esp_decrypt_trace_t * t = va_arg (*args, esp_decrypt_trace_t *);
79   uword indent = format_get_indent (s);
80
81   s = format (s, "cipher %U auth %U\n",
82               format_ipsec_crypto_alg, t->crypto_alg,
83               format_ipsec_integ_alg, t->integ_alg);
84   s = format (s, "%U%U",
85               format_white_space, indent,
86               format_esp_header, t->packet_data);
87   return s;
88 }
89
90 static uword
91 dpdk_esp_decrypt_node_fn (vlib_main_t * vm,
92              vlib_node_runtime_t * node,
93              vlib_frame_t * from_frame)
94 {
95   u32 n_left_from, *from, *to_next, next_index;
96   ipsec_main_t *im = &ipsec_main;
97   u32 thread_idx = vlib_get_thread_index();
98   dpdk_crypto_main_t *dcm = &dpdk_crypto_main;
99   crypto_resource_t *res = 0;
100   ipsec_sa_t *sa0 = 0;
101   crypto_alg_t *cipher_alg = 0, *auth_alg = 0;
102   struct rte_cryptodev_sym_session *session = 0;
103   u32 ret, last_sa_index = ~0;
104   u8 numa = rte_socket_id ();
105   u8 is_aead = 0;
106   crypto_worker_main_t *cwm =
107     vec_elt_at_index (dcm->workers_main, thread_idx);
108   struct rte_crypto_op **ops = cwm->ops;
109
110   from = vlib_frame_vector_args (from_frame);
111   n_left_from = from_frame->n_vectors;
112
113   ret = crypto_alloc_ops (numa, ops, n_left_from);
114   if (ret)
115     {
116       vlib_node_increment_counter (vm, dpdk_esp_decrypt_node.index,
117                                    ESP_DECRYPT_ERROR_DISCARD, 1);
118       /* Discard whole frame */
119       return n_left_from;
120     }
121
122   next_index = ESP_DECRYPT_NEXT_DROP;
123
124   while (n_left_from > 0)
125     {
126       u32 n_left_to_next;
127
128       vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
129
130       while (n_left_from > 0 && n_left_to_next > 0)
131         {
132           clib_error_t *error;
133           u32 bi0, sa_index0, seq, iv_size;
134           u8 trunc_size;
135           vlib_buffer_t *b0;
136           esp_header_t *esp0;
137           struct rte_mbuf *mb0;
138           struct rte_crypto_op *op;
139           u16 res_idx;
140
141           bi0 = from[0];
142           from += 1;
143           n_left_from -= 1;
144
145           b0 = vlib_get_buffer (vm, bi0);
146           mb0 = rte_mbuf_from_vlib_buffer(b0);
147           esp0 = vlib_buffer_get_current (b0);
148
149           /* ih0/ih6_0 */
150           CLIB_PREFETCH (esp0, sizeof (esp0[0]) + 16, LOAD);
151           /* mb0 */
152           CLIB_PREFETCH (mb0, CLIB_CACHE_LINE_BYTES, STORE);
153
154           op = ops[0];
155           ops += 1;
156           ASSERT (op->status == RTE_CRYPTO_OP_STATUS_NOT_PROCESSED);
157
158           dpdk_op_priv_t *priv = crypto_op_get_priv (op);
159
160           u16 op_len =
161             sizeof (op[0]) + sizeof (op[0].sym[0]) + sizeof (priv[0]);
162           CLIB_PREFETCH (op, op_len, STORE);
163
164           sa_index0 = vnet_buffer(b0)->ipsec.sad_index;
165
166           if (sa_index0 != last_sa_index)
167             {
168               last_sa_index = sa_index0;
169
170               sa0 = pool_elt_at_index (im->sad, sa_index0);
171
172               cipher_alg = vec_elt_at_index (dcm->cipher_algs, sa0->crypto_alg);
173               auth_alg = vec_elt_at_index (dcm->auth_algs, sa0->integ_alg);
174
175 #if DPDK_NO_AEAD
176               is_aead = (sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_128 |
177                             sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_192 |
178                             sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_256);
179 #else
180               is_aead = (cipher_alg->type == RTE_CRYPTO_SYM_XFORM_AEAD);
181 #endif
182               if (is_aead)
183                 auth_alg = cipher_alg;
184
185               res_idx = get_resource (cwm, sa0);
186
187               if (PREDICT_FALSE (res_idx == (u16) ~0))
188                 {
189                   clib_warning ("unsupported SA by thread index %u", thread_idx);
190                   vlib_node_increment_counter (vm, dpdk_esp_decrypt_node.index,
191                                                ESP_DECRYPT_ERROR_NOSUP, 1);
192                   to_next[0] = bi0;
193                   to_next += 1;
194                   n_left_to_next -= 1;
195                   goto trace;
196                 }
197               res = vec_elt_at_index (dcm->resource, res_idx);
198
199               error = crypto_get_session (&session, sa_index0, res, cwm, 0);
200               if (PREDICT_FALSE (error || !session))
201                 {
202                   clib_warning ("failed to get crypto session");
203                   vlib_node_increment_counter (vm, dpdk_esp_decrypt_node.index,
204                                                ESP_DECRYPT_ERROR_SESSION, 1);
205                   to_next[0] = bi0;
206                   to_next += 1;
207                   n_left_to_next -= 1;
208                   goto trace;
209                 }
210             }
211
212           /* anti-replay check */
213           if (sa0->use_anti_replay)
214             {
215               int rv = 0;
216
217               seq = clib_net_to_host_u32 (esp0->seq);
218
219               if (PREDICT_TRUE(sa0->use_esn))
220                 rv = esp_replay_check_esn (sa0, seq);
221               else
222                 rv = esp_replay_check (sa0, seq);
223
224               if (PREDICT_FALSE (rv))
225                 {
226                   clib_warning ("failed anti-replay check");
227                   vlib_node_increment_counter (vm, dpdk_esp_decrypt_node.index,
228                                                ESP_DECRYPT_ERROR_REPLAY, 1);
229                   to_next[0] = bi0;
230                   to_next += 1;
231                   n_left_to_next -= 1;
232                   goto trace;
233                 }
234             }
235
236           priv->next = DPDK_CRYPTO_INPUT_NEXT_DECRYPT_POST;
237
238           /* FIXME multi-seg */
239           sa0->total_data_size += b0->current_length;
240
241           res->ops[res->n_ops] = op;
242           res->bi[res->n_ops] = bi0;
243           res->n_ops += 1;
244
245           /* Convert vlib buffer to mbuf */
246           mb0->data_len = b0->current_length;
247           mb0->pkt_len = b0->current_length;
248           mb0->data_off = RTE_PKTMBUF_HEADROOM + b0->current_data;
249
250           trunc_size = auth_alg->trunc_size;
251           iv_size = cipher_alg->iv_len;
252
253           /* Outer IP header has already been stripped */
254           u16 payload_len =
255             b0->current_length - sizeof (esp_header_t) - iv_size - trunc_size;
256
257           ASSERT (payload_len >= 4);
258
259           if (payload_len & (cipher_alg->boundary - 1))
260             {
261               clib_warning ("payload %u not multiple of %d\n",
262                             payload_len, cipher_alg->boundary);
263               vlib_node_increment_counter (vm, dpdk_esp_decrypt_node.index,
264                                            ESP_DECRYPT_ERROR_BAD_LEN, 1);
265               res->n_ops -= 1;
266               to_next[0] = bi0;
267               to_next += 1;
268               n_left_to_next -= 1;
269               goto trace;
270             }
271
272           u32 cipher_off, cipher_len;
273           u32 auth_len = 0, aad_size = 0;
274           u8 *aad = NULL, *digest = NULL;
275           u64 digest_paddr = 0;
276
277           u8 *iv = (u8 *) (esp0 + 1);
278
279           dpdk_gcm_cnt_blk *icb = &priv->cb;
280
281           cipher_off = sizeof (esp_header_t) + iv_size;
282           cipher_len = payload_len;
283
284           digest = vlib_buffer_get_tail (b0) - trunc_size;
285
286           if (cipher_alg->alg == RTE_CRYPTO_CIPHER_AES_CBC)
287             clib_memcpy(icb, iv, 16);
288           else /* CTR/GCM */
289             {
290               u32 *_iv = (u32 *) iv;
291
292               crypto_set_icb (icb, sa0->salt, _iv[0], _iv[1]);
293 #if DPDK_NO_AEAD
294               iv_size = 16;
295 #else
296               iv_size = 12;
297 #endif
298             }
299
300           if (is_aead)
301             {
302               aad = priv->aad;
303               clib_memcpy(aad, esp0, 8);
304               if (PREDICT_FALSE (sa0->use_esn))
305                 {
306                   *((u32*)&aad[8]) = sa0->seq_hi;
307                   aad_size = 12;
308                 }
309               else
310                 aad_size = 8;
311             }
312           else
313             {
314               auth_len = sizeof(esp_header_t) + iv_size + payload_len;
315
316               if (sa0->use_esn)
317                 {
318                   clib_memcpy (priv->icv, digest, trunc_size);
319                   *((u32*) digest) = sa0->seq_hi;
320                   auth_len += sizeof(sa0->seq_hi);
321
322                   digest = priv->icv;
323                   digest_paddr =
324                     op->phys_addr + (uintptr_t) priv->icv - (uintptr_t) op;
325                 }
326             }
327
328           crypto_op_setup (is_aead, mb0, op, session,
329                            cipher_off, cipher_len, (u8 *) icb, iv_size,
330                            0, auth_len, aad, aad_size,
331                            digest, digest_paddr, trunc_size);
332 trace:
333           if (PREDICT_FALSE(b0->flags & VLIB_BUFFER_IS_TRACED))
334             {
335               esp_decrypt_trace_t *tr = vlib_add_trace (vm, node, b0, sizeof (*tr));
336               tr->crypto_alg = sa0->crypto_alg;
337               tr->integ_alg = sa0->integ_alg;
338               clib_memcpy (tr->packet_data, vlib_buffer_get_current (b0),
339                            sizeof (esp_header_t));
340             }
341         }
342       vlib_put_next_frame (vm, node, next_index, n_left_to_next);
343     }
344
345   vlib_node_increment_counter (vm, dpdk_esp_decrypt_node.index,
346                                ESP_DECRYPT_ERROR_RX_PKTS,
347                                from_frame->n_vectors);
348
349   crypto_enqueue_ops (vm, cwm, 0, dpdk_esp_decrypt_node.index,
350                       ESP_DECRYPT_ERROR_ENQ_FAIL, numa);
351
352   crypto_free_ops (numa, ops, cwm->ops + from_frame->n_vectors - ops);
353
354   return from_frame->n_vectors;
355 }
356
357 /* *INDENT-OFF* */
358 VLIB_REGISTER_NODE (dpdk_esp_decrypt_node) = {
359   .function = dpdk_esp_decrypt_node_fn,
360   .name = "dpdk-esp-decrypt",
361   .vector_size = sizeof (u32),
362   .format_trace = format_esp_decrypt_trace,
363   .type = VLIB_NODE_TYPE_INTERNAL,
364
365   .n_errors = ARRAY_LEN(esp_decrypt_error_strings),
366   .error_strings = esp_decrypt_error_strings,
367
368   .n_next_nodes = ESP_DECRYPT_N_NEXT,
369   .next_nodes = {
370 #define _(s,n) [ESP_DECRYPT_NEXT_##s] = n,
371     foreach_esp_decrypt_next
372 #undef _
373   },
374 };
375 /* *INDENT-ON* */
376
377 VLIB_NODE_FUNCTION_MULTIARCH (dpdk_esp_decrypt_node, dpdk_esp_decrypt_node_fn)
378
379 /*
380  * Decrypt Post Node
381  */
382
383 #define foreach_esp_decrypt_post_error        \
384  _(PKTS, "ESP post pkts")
385
386 typedef enum {
387 #define _(sym,str) ESP_DECRYPT_POST_ERROR_##sym,
388   foreach_esp_decrypt_post_error
389 #undef _
390   ESP_DECRYPT_POST_N_ERROR,
391 } esp_decrypt_post_error_t;
392
393 static char * esp_decrypt_post_error_strings[] = {
394 #define _(sym,string) string,
395   foreach_esp_decrypt_post_error
396 #undef _
397 };
398
399 vlib_node_registration_t dpdk_esp_decrypt_post_node;
400
401 static u8 * format_esp_decrypt_post_trace (u8 * s, va_list * args)
402 {
403   CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
404   CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
405   esp_decrypt_trace_t * t = va_arg (*args, esp_decrypt_trace_t *);
406   uword indent = format_get_indent (s);
407
408   s = format (s, "cipher %U auth %U\n",
409               format_ipsec_crypto_alg, t->crypto_alg,
410               format_ipsec_integ_alg, t->integ_alg);
411
412   ip4_header_t *ih4 = (ip4_header_t *) t->packet_data;
413   if ((ih4->ip_version_and_header_length & 0xF0) == 0x60)
414     s = format (s, "%U%U", format_white_space, indent, format_ip6_header, ih4);
415   else
416     s = format (s, "%U%U", format_white_space, indent, format_ip4_header, ih4);
417
418   return s;
419 }
420
421 static uword
422 dpdk_esp_decrypt_post_node_fn (vlib_main_t * vm,
423              vlib_node_runtime_t * node,
424              vlib_frame_t * from_frame)
425 {
426   u32 n_left_from, *from, *to_next = 0, next_index;
427   ipsec_sa_t * sa0;
428   u32 sa_index0 = ~0;
429   ipsec_main_t *im = &ipsec_main;
430   dpdk_crypto_main_t *dcm = &dpdk_crypto_main;
431
432   from = vlib_frame_vector_args (from_frame);
433   n_left_from = from_frame->n_vectors;
434
435   next_index = node->cached_next_index;
436
437   while (n_left_from > 0)
438     {
439       u32 n_left_to_next;
440
441       vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
442
443       while (n_left_from > 0 && n_left_to_next > 0)
444         {
445           esp_footer_t * f0;
446           u32 bi0, iv_size, next0;
447           vlib_buffer_t * b0 = 0;
448           ip4_header_t *ih4 = 0, *oh4 = 0;
449           ip6_header_t *ih6 = 0, *oh6 = 0;
450           crypto_alg_t *cipher_alg, *auth_alg;
451           esp_header_t *esp0;
452           u8 trunc_size, is_aead;
453
454           next0 = ESP_DECRYPT_NEXT_DROP;
455
456           bi0 = from[0];
457           from += 1;
458           n_left_from -= 1;
459           n_left_to_next -= 1;
460
461           b0 = vlib_get_buffer (vm, bi0);
462           esp0 = vlib_buffer_get_current (b0);
463
464           sa_index0 = vnet_buffer(b0)->ipsec.sad_index;
465           sa0 = pool_elt_at_index (im->sad, sa_index0);
466
467           to_next[0] = bi0;
468           to_next += 1;
469
470           cipher_alg = vec_elt_at_index (dcm->cipher_algs, sa0->crypto_alg);
471           auth_alg = vec_elt_at_index (dcm->auth_algs, sa0->integ_alg);
472 #if DPDK_NO_AEAD
473           is_aead = (sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_128 |
474                         sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_192 |
475                         sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_256);
476 #else
477           is_aead = cipher_alg->type == RTE_CRYPTO_SYM_XFORM_AEAD;
478 #endif
479           if (is_aead)
480             auth_alg = cipher_alg;
481
482           trunc_size = auth_alg->trunc_size;
483
484           iv_size = cipher_alg->iv_len;
485
486           if (sa0->use_anti_replay)
487             {
488               u32 seq;
489               seq = clib_host_to_net_u32(esp0->seq);
490               if (PREDICT_TRUE(sa0->use_esn))
491                 esp_replay_advance_esn(sa0, seq);
492               else
493                 esp_replay_advance(sa0, seq);
494             }
495
496           /* FIXME ip header */
497           ih4 = (ip4_header_t *) (b0->data + sizeof(ethernet_header_t));
498           vlib_buffer_advance (b0, sizeof (esp_header_t) + iv_size);
499
500           b0->flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
501           f0 = (esp_footer_t *) (vlib_buffer_get_tail (b0) - trunc_size - 2);
502           b0->current_length -= (f0->pad_length + trunc_size + 2);
503 #if 0
504           /* check padding */
505           const u8 *padding = vlib_buffer_get_tail (b0);
506           if (PREDICT_FALSE (memcmp (padding, pad_data, f0->pad_length)))
507             {
508               clib_warning("bad padding");
509               vlib_node_increment_counter (vm, dpdk_esp_decrypt_node.index,
510                                            ESP_DECRYPT_ERROR_DECRYPTION_FAILED,
511                                            1);
512               goto trace;
513             }
514 #endif
515           if (sa0->is_tunnel)
516             {
517               if (f0->next_header == IP_PROTOCOL_IP_IN_IP)
518                 next0 = ESP_DECRYPT_NEXT_IP4_INPUT;
519               else if (sa0->is_tunnel_ip6 && f0->next_header == IP_PROTOCOL_IPV6)
520                 next0 = ESP_DECRYPT_NEXT_IP6_INPUT;
521               else
522                 {
523                   clib_warning("next header: 0x%x", f0->next_header);
524                   vlib_node_increment_counter (vm, dpdk_esp_decrypt_node.index,
525                                                ESP_DECRYPT_ERROR_DECRYPTION_FAILED,
526                                                1);
527                   goto trace;
528                 }
529             }
530           else /* transport mode */
531             {
532               if ((ih4->ip_version_and_header_length & 0xF0) == 0x40)
533                 {
534                   u16 ih4_len = ip4_header_bytes (ih4);
535                   vlib_buffer_advance (b0, - ih4_len);
536                   oh4 = vlib_buffer_get_current (b0);
537                   memmove(oh4, ih4, ih4_len);
538
539                   next0 = ESP_DECRYPT_NEXT_IP4_INPUT;
540                   u16 old_ttl_prot =
541                     ((u16) oh4->ttl) << 8 | (u16) oh4->protocol;
542                   u16 new_ttl_prot =
543                     ((u16) oh4->ttl) << 8 | (u16) f0->next_header;
544                   oh4->protocol = f0->next_header;
545                   u16 new_len = clib_host_to_net_u16 (b0->current_length);
546                   oh4->length = new_len;
547                   /* rfc1264 incremental checksum update */
548                   oh4->checksum = ~(~oh4->checksum + ~oh4->length + new_len +
549                                     ~old_ttl_prot + new_ttl_prot);
550
551                 }
552               else if ((ih4->ip_version_and_header_length & 0xF0) == 0x60)
553                 {
554                   /* FIXME find ip header */
555                   ih6 = (ip6_header_t *) (b0->data + sizeof(ethernet_header_t));
556                   vlib_buffer_advance (b0, -sizeof(ip6_header_t));
557                   oh6 = vlib_buffer_get_current (b0);
558                   memmove(oh6, ih6, sizeof(ip6_header_t));
559
560                   next0 = ESP_DECRYPT_NEXT_IP6_INPUT;
561                   oh6->protocol = f0->next_header;
562                   u16 len = b0->current_length - sizeof (ip6_header_t);
563                   oh6->payload_length = clib_host_to_net_u16 (len);
564                 }
565               else
566                 {
567                   clib_warning("next header: 0x%x", f0->next_header);
568                   vlib_node_increment_counter (vm, dpdk_esp_decrypt_node.index,
569                                                ESP_DECRYPT_ERROR_DECRYPTION_FAILED,
570                                                1);
571                   goto trace;
572                 }
573             }
574
575           vnet_buffer (b0)->sw_if_index[VLIB_TX] = (u32)~0;
576
577         trace:
578           if (PREDICT_FALSE(b0->flags & VLIB_BUFFER_IS_TRACED))
579             {
580               esp_decrypt_trace_t *tr = vlib_add_trace (vm, node, b0, sizeof (*tr));
581               tr->crypto_alg = sa0->crypto_alg;
582               tr->integ_alg = sa0->integ_alg;
583               ih4 = vlib_buffer_get_current (b0);
584               clib_memcpy (tr->packet_data, ih4, sizeof (ip6_header_t));
585             }
586
587           vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
588                                            to_next, n_left_to_next, bi0, next0);
589         }
590       vlib_put_next_frame (vm, node, next_index, n_left_to_next);
591     }
592
593   vlib_node_increment_counter (vm, dpdk_esp_decrypt_post_node.index,
594                                ESP_DECRYPT_POST_ERROR_PKTS,
595                                from_frame->n_vectors);
596
597   return from_frame->n_vectors;
598 }
599
600 /* *INDENT-OFF* */
601 VLIB_REGISTER_NODE (dpdk_esp_decrypt_post_node) = {
602   .function = dpdk_esp_decrypt_post_node_fn,
603   .name = "dpdk-esp-decrypt-post",
604   .vector_size = sizeof (u32),
605   .format_trace = format_esp_decrypt_post_trace,
606   .type = VLIB_NODE_TYPE_INTERNAL,
607
608   .n_errors = ARRAY_LEN(esp_decrypt_post_error_strings),
609   .error_strings = esp_decrypt_post_error_strings,
610
611   .n_next_nodes = ESP_DECRYPT_N_NEXT,
612   .next_nodes = {
613 #define _(s,n) [ESP_DECRYPT_NEXT_##s] = n,
614     foreach_esp_decrypt_next
615 #undef _
616   },
617 };
618 /* *INDENT-ON* */
619
620 VLIB_NODE_FUNCTION_MULTIARCH (dpdk_esp_decrypt_post_node, dpdk_esp_decrypt_post_node_fn)