FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
ip6_sv_reass.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 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 
16 /**
17  * @file
18  * @brief IPv6 Shallow Virtual Reassembly.
19  *
20  * This file contains the source code for IPv6 Shallow Virtual reassembly.
21  */
22 
23 #include <vppinfra/vec.h>
24 #include <vnet/vnet.h>
25 #include <vnet/ip/ip.h>
26 #include <vnet/ip/ip6_to_ip4.h>
27 #include <vppinfra/bihash_48_8.h>
29 
30 #define MSEC_PER_SEC 1000
31 #define IP6_SV_REASS_TIMEOUT_DEFAULT_MS 100
32 #define IP6_SV_REASS_EXPIRE_WALK_INTERVAL_DEFAULT_MS 10000 // 10 seconds default
33 #define IP6_SV_REASS_MAX_REASSEMBLIES_DEFAULT 1024
34 #define IP6_SV_REASS_MAX_REASSEMBLY_LENGTH_DEFAULT 3
35 #define IP6_SV_REASS_HT_LOAD_FACTOR (0.75)
36 
37 typedef enum
38 {
44 
45 typedef struct
46 {
47  union
48  {
49  struct
50  {
51  ip6_address_t src;
52  ip6_address_t dst;
55  u8 unused[7];
57  };
58  u64 as_u64[6];
59  };
61 
62 typedef union
63 {
64  struct
65  {
68  };
71 
72 typedef union
73 {
74  struct
75  {
78  };
81 
82 typedef struct
83 {
84  // hash table key
86  // time when last packet was received
88  // internal id of this reassembly
90  // trace operation counter
92  // buffer indexes of buffers in this reassembly in chronological order -
93  // including overlaps and duplicate fragments
95  // set to true when this reassembly is completed
97  // ip protocol
102  // l4 src port
104  // l4 dst port
106  // lru indexes
110 
111 typedef struct
112 {
117  // lru indexes
121 
122 typedef struct
123 {
124  // IPv6 config
128  // maximum number of fragments in one reassembly
130  // maximum number of reassemblies
132 
133  // IPv6 runtime
134  clib_bihash_48_8_t hash;
135 
136  // per-thread data
138 
139  // convenience
142 
143  // node index of ip6-drop node
147 
148  /** Worker handoff */
151 
152  // reference count for enabling/disabling feature - per interface
155 
157 
158 #ifndef CLIB_MARCH_VARIANT
160 #endif /* CLIB_MARCH_VARIANT */
161 
162 typedef enum
163 {
170 
171 typedef enum
172 {
178 
179 typedef struct
180 {
188 
189 static u8 *
190 format_ip6_sv_reass_trace (u8 * s, va_list * args)
191 {
192  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
193  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
194  ip6_sv_reass_trace_t *t = va_arg (*args, ip6_sv_reass_trace_t *);
195  if (REASS_PASSTHROUGH != t->action)
196  {
197  s = format (s, "reass id: %u, op id: %u ", t->reass_id, t->op_id);
198  }
199  switch (t->action)
200  {
202  s = format (s, "[cached]");
203  break;
204  case REASS_FINISH:
205  s =
206  format (s, "[finish, ip proto=%u, src_port=%u, dst_port=%u]",
207  t->ip_proto, clib_net_to_host_u16 (t->l4_src_port),
208  clib_net_to_host_u16 (t->l4_dst_port));
209  break;
211  s =
212  format (s, "[forward, ip proto=%u, src_port=%u, dst_port=%u]",
213  t->ip_proto, clib_net_to_host_u16 (t->l4_src_port),
214  clib_net_to_host_u16 (t->l4_dst_port));
215  break;
216  case REASS_PASSTHROUGH:
217  s = format (s, "[not-fragmented]");
218  break;
219  }
220  return s;
221 }
222 
223 static void
225  ip6_sv_reass_main_t * rm,
226  ip6_sv_reass_t * reass, u32 bi,
228  u32 ip_proto, u16 l4_src_port, u16 l4_dst_port)
229 {
233  {
234  // this buffer's trace is gone
235  b->flags &= ~VLIB_BUFFER_IS_TRACED;
236  return;
237  }
238  ip6_sv_reass_trace_t *t = vlib_add_trace (vm, node, b, sizeof (t[0]));
239  if (reass)
240  {
241  t->reass_id = reass->id;
242  t->op_id = reass->trace_op_counter;
243  ++reass->trace_op_counter;
244  }
245  t->action = action;
246  t->ip_proto = ip_proto;
247  t->l4_src_port = l4_src_port;
248  t->l4_dst_port = l4_dst_port;
249 #if 0
250  static u8 *s = NULL;
251  s = format (s, "%U", format_ip6_sv_reass_trace, NULL, NULL, t);
252  printf ("%.*s\n", vec_len (s), s);
253  fflush (stdout);
254  vec_reset_length (s);
255 #endif
256 }
257 
258 always_inline void
261 {
263  kv.key[0] = reass->key.as_u64[0];
264  kv.key[1] = reass->key.as_u64[1];
265  kv.key[2] = reass->key.as_u64[2];
266  kv.key[3] = reass->key.as_u64[3];
267  kv.key[4] = reass->key.as_u64[4];
268  kv.key[5] = reass->key.as_u64[5];
269  clib_bihash_add_del_48_8 (&rm->hash, &kv, 0);
271  vec_len (reass->cached_buffers));
272  vec_free (reass->cached_buffers);
273  reass->cached_buffers = NULL;
274  if (~0 != reass->lru_prev)
275  {
276  ip6_sv_reass_t *lru_prev =
277  pool_elt_at_index (rt->pool, reass->lru_prev);
278  lru_prev->lru_next = reass->lru_next;
279  }
280  if (~0 != reass->lru_next)
281  {
282  ip6_sv_reass_t *lru_next =
283  pool_elt_at_index (rt->pool, reass->lru_next);
284  lru_next->lru_prev = reass->lru_prev;
285  }
286  if (rt->lru_first == reass - rt->pool)
287  {
288  rt->lru_first = reass->lru_next;
289  }
290  if (rt->lru_last == reass - rt->pool)
291  {
292  rt->lru_last = reass->lru_prev;
293  }
294  pool_put (rt->pool, reass);
295  --rt->reass_n;
296 }
297 
298 always_inline void
300 {
301  reass->cached_buffers = NULL;
302  reass->is_complete = false;
303 }
304 
307  ip6_sv_reass_main_t * rm,
309  ip6_sv_reass_kv_t * kv, u32 * icmp_bi,
310  u8 * do_handoff)
311 {
312  ip6_sv_reass_t *reass = NULL;
313  f64 now = vlib_time_now (vm);
314 
315  if (!clib_bihash_search_48_8 (&rm->hash, &kv->kv, &kv->kv))
316  {
317  if (vm->thread_index != kv->v.thread_index)
318  {
319  *do_handoff = 1;
320  return NULL;
321  }
322  reass = pool_elt_at_index (rt->pool, kv->v.reass_index);
323 
324  if (now > reass->last_heard + rm->timeout)
325  {
326  ip6_sv_reass_free (vm, rm, rt, reass);
327  reass = NULL;
328  }
329  }
330 
331  if (reass)
332  {
333  reass->last_heard = now;
334  return reass;
335  }
336 
337  if (rt->reass_n >= rm->max_reass_n)
338  {
339  reass = pool_elt_at_index (rt->pool, rt->lru_first);
340  ip6_sv_reass_free (vm, rm, rt, reass);
341  }
342 
343  pool_get (rt->pool, reass);
344  clib_memset (reass, 0, sizeof (*reass));
345  reass->id = ((u64) vm->thread_index * 1000000000) + rt->id_counter;
346  ++rt->id_counter;
347  ip6_sv_reass_init (reass);
348  ++rt->reass_n;
349 
350  reass->lru_prev = reass->lru_next = ~0;
351 
352  if (~0 != rt->lru_last)
353  {
354  ip6_sv_reass_t *lru_last = pool_elt_at_index (rt->pool, rt->lru_last);
355  reass->lru_prev = rt->lru_last;
356  lru_last->lru_next = rt->lru_last = reass - rt->pool;
357  }
358 
359  if (~0 == rt->lru_first)
360  {
361  rt->lru_first = rt->lru_last = reass - rt->pool;
362  }
363 
364  reass->key.as_u64[0] = kv->kv.key[0];
365  reass->key.as_u64[1] = kv->kv.key[1];
366  reass->key.as_u64[2] = kv->kv.key[2];
367  reass->key.as_u64[3] = kv->kv.key[3];
368  reass->key.as_u64[4] = kv->kv.key[4];
369  reass->key.as_u64[5] = kv->kv.key[5];
370  kv->v.reass_index = (reass - rt->pool);
371  kv->v.thread_index = vm->thread_index;
372  reass->last_heard = now;
373 
374  if (clib_bihash_add_del_48_8 (&rm->hash, &kv->kv, 1))
375  {
376  ip6_sv_reass_free (vm, rm, rt, reass);
377  reass = NULL;
378  }
379 
380  return reass;
381 }
382 
386  ip6_sv_reass_t * reass, u32 bi0,
387  ip6_frag_hdr_t * frag_hdr)
388 {
389  vlib_buffer_t *fb = vlib_get_buffer (vm, bi0);
390  vnet_buffer_opaque_t *fvnb = vnet_buffer (fb);
391  fvnb->ip.reass.ip6_frag_hdr_offset =
392  (u8 *) frag_hdr - (u8 *) vlib_buffer_get_current (fb);
394  if (fb->current_length < sizeof (*fip) ||
395  fvnb->ip.reass.ip6_frag_hdr_offset == 0 ||
396  fvnb->ip.reass.ip6_frag_hdr_offset >= fb->current_length)
397  {
399  }
400 
401  u32 fragment_first = fvnb->ip.reass.fragment_first =
402  ip6_frag_hdr_offset_bytes (frag_hdr);
403  u32 fragment_length =
405  (fvnb->ip.reass.ip6_frag_hdr_offset + sizeof (*frag_hdr));
406  u32 fragment_last = fvnb->ip.reass.fragment_last =
407  fragment_first + fragment_length - 1;
408  fvnb->ip.reass.range_first = fragment_first;
409  fvnb->ip.reass.range_last = fragment_last;
410  fvnb->ip.reass.next_range_bi = ~0;
411  if (0 == fragment_first)
412  {
413  if (!ip6_get_port
414  (vm, fb, fip, fb->current_length, &reass->ip_proto,
415  &reass->l4_src_port, &reass->l4_dst_port,
416  &reass->icmp_type_or_tcp_flags, &reass->tcp_ack_number,
417  &reass->tcp_seq_number))
419 
420  reass->is_complete = true;
421  vlib_buffer_t *b0 = vlib_get_buffer (vm, bi0);
422  if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
423  {
424  ip6_sv_reass_add_trace (vm, node, rm, reass, bi0, REASS_FINISH,
425  reass->ip_proto, reass->l4_src_port,
426  reass->l4_dst_port);
427  }
428  }
429  vec_add1 (reass->cached_buffers, bi0);
430  if (!reass->is_complete)
431  {
432  if (PREDICT_FALSE (fb->flags & VLIB_BUFFER_IS_TRACED))
433  {
434  ip6_sv_reass_add_trace (vm, node, rm, reass, bi0,
436  reass->l4_src_port, reass->l4_dst_port);
437  }
438  if (vec_len (reass->cached_buffers) > rm->max_reass_len)
439  {
441  }
442  }
443  return IP6_SV_REASS_RC_OK;
444 }
445 
446 always_inline bool
448  vlib_buffer_t * b,
449  ip6_frag_hdr_t * frag_hdr)
450 {
451  ip6_ext_header_t *tmp = (ip6_ext_header_t *) frag_hdr;
452  while (ip6_ext_hdr (tmp->next_hdr))
453  {
455  }
456  if (IP_PROTOCOL_IP6_NONXT == tmp->next_hdr)
457  {
458  icmp6_error_set_vnet_buffer (b, ICMP6_parameter_problem,
459  ICMP6_parameter_problem_first_fragment_has_incomplete_header_chain,
460  0);
461  b->error = node->errors[IP6_ERROR_REASS_MISSING_UPPER];
462 
463  return false;
464  }
465  return true;
466 }
467 
468 always_inline bool
471  vlib_buffer_t * b,
472  ip6_frag_hdr_t * frag_hdr)
473 {
476  int more_fragments = ip6_frag_hdr_more (frag_hdr);
477  u32 fragment_length =
479  (vnb->ip.reass.ip6_frag_hdr_offset + sizeof (*frag_hdr));
480  if (more_fragments && 0 != fragment_length % 8)
481  {
482  icmp6_error_set_vnet_buffer (b, ICMP6_parameter_problem,
483  ICMP6_parameter_problem_erroneous_header_field,
484  (u8 *) & ip->payload_length - (u8 *) ip);
485  return false;
486  }
487  return true;
488 }
489 
490 always_inline bool
493  vlib_buffer_t * b,
494  ip6_frag_hdr_t * frag_hdr)
495 {
497  u32 fragment_first = ip6_frag_hdr_offset_bytes (frag_hdr);
498  u32 fragment_length =
500  (vnb->ip.reass.ip6_frag_hdr_offset + sizeof (*frag_hdr));
501  if (fragment_first + fragment_length > 65535)
502  {
504  icmp6_error_set_vnet_buffer (b, ICMP6_parameter_problem,
505  ICMP6_parameter_problem_erroneous_header_field,
506  (u8 *) & frag_hdr->fragment_offset_and_more
507  - (u8 *) ip0);
508  return false;
509  }
510  return true;
511 }
512 
516  vlib_frame_t * frame, bool is_feature)
517 {
519  u32 n_left_from, n_left_to_next, *to_next, next_index;
522  clib_spinlock_lock (&rt->lock);
523 
524  n_left_from = frame->n_vectors;
525  next_index = node->cached_next_index;
526 
527  while (n_left_from > 0)
528  {
529  vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
530 
531  while (n_left_from > 0 && n_left_to_next > 0)
532  {
533  u32 bi0;
534  vlib_buffer_t *b0;
536  u32 error0 = IP6_ERROR_NONE;
537  u32 icmp_bi = ~0;
538 
539  bi0 = from[0];
540  b0 = vlib_get_buffer (vm, bi0);
541 
543  ip6_frag_hdr_t *frag_hdr = NULL;
544  ip6_ext_header_t *prev_hdr;
545  if (ip6_ext_hdr (ip0->protocol))
546  {
547  frag_hdr =
548  ip6_ext_header_find (vm, b0, ip0,
549  IP_PROTOCOL_IPV6_FRAGMENTATION,
550  &prev_hdr);
551  }
552  if (!frag_hdr)
553  {
554  // this is a regular packet - no fragmentation
555  if (!ip6_get_port
556  (vm, b0, ip0, b0->current_length,
557  &(vnet_buffer (b0)->ip.reass.ip_proto),
558  &(vnet_buffer (b0)->ip.reass.l4_src_port),
559  &(vnet_buffer (b0)->ip.reass.l4_dst_port),
560  &(vnet_buffer (b0)->ip.reass.icmp_type_or_tcp_flags),
561  &(vnet_buffer (b0)->ip.reass.tcp_ack_number),
562  &(vnet_buffer (b0)->ip.reass.tcp_seq_number)))
563  {
564  error0 = IP6_ERROR_REASS_UNSUPP_IP_PROTO;
565  b0->error = node->errors[error0];
567  goto packet_enqueue;
568  }
569  vnet_buffer (b0)->ip.reass.is_non_first_fragment = 0;
571  if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
572  {
573  ip6_sv_reass_add_trace (vm, node, rm, NULL, bi0,
575  vnet_buffer (b0)->ip.reass.ip_proto,
576  vnet_buffer (b0)->ip.
577  reass.l4_src_port,
578  vnet_buffer (b0)->ip.
579  reass.l4_dst_port);
580  }
581  goto packet_enqueue;
582  }
583  vnet_buffer (b0)->ip.reass.ip6_frag_hdr_offset =
584  (u8 *) frag_hdr - (u8 *) ip0;
585  if (0 == ip6_frag_hdr_offset (frag_hdr))
586  {
587  // first fragment - verify upper-layer is present
589  (node, b0, frag_hdr))
590  {
592  goto packet_enqueue;
593  }
594  }
596  (vm, node, b0, frag_hdr)
598  frag_hdr))
599  {
601  goto packet_enqueue;
602  }
603 
605  u8 do_handoff = 0;
606 
607  kv.k.as_u64[0] = ip0->src_address.as_u64[0];
608  kv.k.as_u64[1] = ip0->src_address.as_u64[1];
609  kv.k.as_u64[2] = ip0->dst_address.as_u64[0];
610  kv.k.as_u64[3] = ip0->dst_address.as_u64[1];
611  kv.k.as_u64[4] =
613  vnet_buffer (b0)->sw_if_index[VLIB_RX])) << 32 |
614  (u64) frag_hdr->identification;
615  kv.k.as_u64[5] = ip0->protocol;
616 
617  ip6_sv_reass_t *reass =
618  ip6_sv_reass_find_or_create (vm, node, rm, rt, &kv, &icmp_bi,
619  &do_handoff);
620 
621  if (PREDICT_FALSE (do_handoff))
622  {
624  vnet_buffer (b0)->ip.reass.owner_thread_index =
625  kv.v.thread_index;
626  goto packet_enqueue;
627  }
628 
629  if (!reass)
630  {
632  error0 = IP6_ERROR_REASS_LIMIT_REACHED;
633  b0->error = node->errors[error0];
634  goto packet_enqueue;
635  }
636 
637  if (reass->is_complete)
638  {
639  vnet_buffer (b0)->ip.reass.is_non_first_fragment =
640  ! !ip6_frag_hdr_offset (frag_hdr);
641  vnet_buffer (b0)->ip.reass.ip_proto = reass->ip_proto;
642  vnet_buffer (b0)->ip.reass.icmp_type_or_tcp_flags =
643  reass->icmp_type_or_tcp_flags;
644  vnet_buffer (b0)->ip.reass.tcp_ack_number =
645  reass->tcp_ack_number;
646  vnet_buffer (b0)->ip.reass.tcp_seq_number =
647  reass->tcp_seq_number;
648  vnet_buffer (b0)->ip.reass.l4_src_port = reass->l4_src_port;
649  vnet_buffer (b0)->ip.reass.l4_dst_port = reass->l4_dst_port;
651  if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
652  {
653  ip6_sv_reass_add_trace (vm, node, rm, reass, bi0,
655  reass->ip_proto,
656  reass->l4_src_port,
657  reass->l4_dst_port);
658  }
659  goto packet_enqueue;
660  }
661 
662  switch (ip6_sv_reass_update
663  (vm, node, rm, rt, reass, bi0, frag_hdr))
664  {
665  case IP6_SV_REASS_RC_OK:
666  /* nothing to do here */
667  break;
669  vlib_node_increment_counter (vm, node->node_index,
670  IP6_ERROR_REASS_FRAGMENT_CHAIN_TOO_LONG,
671  1);
672  ip6_sv_reass_free (vm, rm, rt, reass);
673  goto next_packet;
674  break;
676  vlib_node_increment_counter (vm, node->node_index,
677  IP6_ERROR_REASS_UNSUPP_IP_PROTO,
678  1);
679  ip6_sv_reass_free (vm, rm, rt, reass);
680  goto next_packet;
681  break;
683  vlib_node_increment_counter (vm, node->node_index,
684  IP6_ERROR_REASS_INTERNAL_ERROR, 1);
685  ip6_sv_reass_free (vm, rm, rt, reass);
686  goto next_packet;
687  break;
688  }
689 
690  if (reass->is_complete)
691  {
692  u32 idx;
693  vec_foreach_index (idx, reass->cached_buffers)
694  {
695  u32 bi0 = vec_elt (reass->cached_buffers, idx);
696  if (0 == n_left_to_next)
697  {
699  n_left_to_next);
701  n_left_to_next);
702  }
703  to_next[0] = bi0;
704  to_next += 1;
705  n_left_to_next -= 1;
706  b0 = vlib_get_buffer (vm, bi0);
707  if (is_feature)
708  {
709  vnet_feature_next (&next0, b0);
710  }
711  frag_hdr =
713  vnet_buffer (b0)->ip.reass.ip6_frag_hdr_offset;
714  vnet_buffer (b0)->ip.reass.is_non_first_fragment =
715  ! !ip6_frag_hdr_offset (frag_hdr);
716  vnet_buffer (b0)->ip.reass.ip_proto = reass->ip_proto;
717  vnet_buffer (b0)->ip.reass.icmp_type_or_tcp_flags =
718  reass->icmp_type_or_tcp_flags;
719  vnet_buffer (b0)->ip.reass.tcp_ack_number =
720  reass->tcp_ack_number;
721  vnet_buffer (b0)->ip.reass.tcp_seq_number =
722  reass->tcp_seq_number;
723  vnet_buffer (b0)->ip.reass.l4_src_port = reass->l4_src_port;
724  vnet_buffer (b0)->ip.reass.l4_dst_port = reass->l4_dst_port;
725  if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
726  {
727  ip6_sv_reass_add_trace (vm, node, rm, reass, bi0,
729  reass->ip_proto,
730  reass->l4_src_port,
731  reass->l4_dst_port);
732  }
734  to_next, n_left_to_next, bi0,
735  next0);
736  }
737  _vec_len (reass->cached_buffers) = 0; // buffers are owned by frame now
738  }
739  goto next_packet;
740 
741  packet_enqueue:
742  to_next[0] = bi0;
743  to_next += 1;
744  n_left_to_next -= 1;
745  if (is_feature && IP6_ERROR_NONE == error0)
746  {
747  b0 = vlib_get_buffer (vm, bi0);
748  vnet_feature_next (&next0, b0);
749  }
751  n_left_to_next, bi0, next0);
752 
753  if (~0 != icmp_bi)
754  {
756  to_next[0] = icmp_bi;
757  to_next += 1;
758  n_left_to_next -= 1;
760  n_left_to_next, icmp_bi,
761  next0);
762  }
763 
764  next_packet:
765  from += 1;
766  n_left_from -= 1;
767  }
768 
769  vlib_put_next_frame (vm, node, next_index, n_left_to_next);
770  }
771 
772  clib_spinlock_unlock (&rt->lock);
773  return frame->n_vectors;
774 }
775 
777 #define _(sym, string) string,
779 #undef _
780 };
781 
785 {
786  return ip6_sv_reassembly_inline (vm, node, frame, false /* is_feature */ );
787 }
788 
789 /* *INDENT-OFF* */
791  .name = "ip6-sv-reassembly",
792  .vector_size = sizeof (u32),
793  .format_trace = format_ip6_sv_reass_trace,
795  .error_strings = ip6_sv_reassembly_error_strings,
796  .n_next_nodes = IP6_SV_REASSEMBLY_N_NEXT,
797  .next_nodes =
798  {
799  [IP6_SV_REASSEMBLY_NEXT_INPUT] = "ip6-input",
800  [IP6_SV_REASSEMBLY_NEXT_DROP] = "ip6-drop",
801  [IP6_SV_REASSEMBLY_NEXT_ICMP_ERROR] = "ip6-icmp-error",
802  [IP6_SV_REASSEMBLY_NEXT_HANDOFF] = "ip6-sv-reassembly-handoff",
803  },
804 };
805 /* *INDENT-ON* */
806 
810 {
811  return ip6_sv_reassembly_inline (vm, node, frame, true /* is_feature */ );
812 }
813 
814 /* *INDENT-OFF* */
816  .name = "ip6-sv-reassembly-feature",
817  .vector_size = sizeof (u32),
818  .format_trace = format_ip6_sv_reass_trace,
820  .error_strings = ip6_sv_reassembly_error_strings,
821  .n_next_nodes = IP6_SV_REASSEMBLY_N_NEXT,
822  .next_nodes =
823  {
824  [IP6_SV_REASSEMBLY_NEXT_INPUT] = "ip6-input",
825  [IP6_SV_REASSEMBLY_NEXT_DROP] = "ip6-drop",
826  [IP6_SV_REASSEMBLY_NEXT_ICMP_ERROR] = "ip6-icmp-error",
827  [IP6_SV_REASSEMBLY_NEXT_HANDOFF] = "ip6-sv-reass-feature-hoff",
828  },
829 };
830 /* *INDENT-ON* */
831 
832 /* *INDENT-OFF* */
833 VNET_FEATURE_INIT (ip6_sv_reassembly_feature) = {
834  .arc_name = "ip6-unicast",
835  .node_name = "ip6-sv-reassembly-feature",
836  .runs_before = VNET_FEATURES ("ip6-lookup"),
837  .runs_after = 0,
838 };
839 /* *INDENT-ON* */
840 
841 #ifndef CLIB_MARCH_VARIANT
842 static u32
844 {
846  u32 nbuckets;
847  u8 i;
848 
849  nbuckets = (u32) (rm->max_reass_n / IP6_SV_REASS_HT_LOAD_FACTOR);
850 
851  for (i = 0; i < 31; i++)
852  if ((1 << i) >= nbuckets)
853  break;
854  nbuckets = 1 << i;
855 
856  return nbuckets;
857 }
858 #endif /* CLIB_MARCH_VARIANT */
859 
860 typedef enum
861 {
864 
865 #ifndef CLIB_MARCH_VARIANT
866 typedef struct
867 {
868  int failure;
869  clib_bihash_48_8_t *new_hash;
871 
872 static int
874 {
875  ip6_rehash_cb_ctx *ctx = _ctx;
876  if (clib_bihash_add_del_48_8 (ctx->new_hash, kv, 1))
877  {
878  ctx->failure = 1;
879  }
880  return (BIHASH_WALK_CONTINUE);
881 }
882 
883 static void
884 ip6_sv_reass_set_params (u32 timeout_ms, u32 max_reassemblies,
885  u32 max_reassembly_length,
886  u32 expire_walk_interval_ms)
887 {
888  ip6_sv_reass_main.timeout_ms = timeout_ms;
889  ip6_sv_reass_main.timeout = (f64) timeout_ms / (f64) MSEC_PER_SEC;
890  ip6_sv_reass_main.max_reass_n = max_reassemblies;
891  ip6_sv_reass_main.max_reass_len = max_reassembly_length;
892  ip6_sv_reass_main.expire_walk_interval_ms = expire_walk_interval_ms;
893 }
894 
896 ip6_sv_reass_set (u32 timeout_ms, u32 max_reassemblies,
897  u32 max_reassembly_length, u32 expire_walk_interval_ms)
898 {
899  u32 old_nbuckets = ip6_sv_reass_get_nbuckets ();
900  ip6_sv_reass_set_params (timeout_ms, max_reassemblies,
901  max_reassembly_length, expire_walk_interval_ms);
905  u32 new_nbuckets = ip6_sv_reass_get_nbuckets ();
906  if (ip6_sv_reass_main.max_reass_n > 0 && new_nbuckets > old_nbuckets)
907  {
908  clib_bihash_48_8_t new_hash;
909  clib_memset (&new_hash, 0, sizeof (new_hash));
911  ctx.failure = 0;
912  ctx.new_hash = &new_hash;
913  clib_bihash_init_48_8 (&new_hash, "ip6-sv-reass", new_nbuckets,
914  new_nbuckets * 1024);
915  clib_bihash_foreach_key_value_pair_48_8 (&ip6_sv_reass_main.hash,
916  ip6_rehash_cb, &ctx);
917  if (ctx.failure)
918  {
919  clib_bihash_free_48_8 (&new_hash);
920  return -1;
921  }
922  else
923  {
924  clib_bihash_free_48_8 (&ip6_sv_reass_main.hash);
926  sizeof (ip6_sv_reass_main.hash));
928  }
929  }
930  return 0;
931 }
932 
934 ip6_sv_reass_get (u32 * timeout_ms, u32 * max_reassemblies,
935  u32 * max_reassembly_length, u32 * expire_walk_interval_ms)
936 {
937  *timeout_ms = ip6_sv_reass_main.timeout_ms;
938  *max_reassemblies = ip6_sv_reass_main.max_reass_n;
939  *max_reassembly_length = ip6_sv_reass_main.max_reass_len;
940  *expire_walk_interval_ms = ip6_sv_reass_main.expire_walk_interval_ms;
941  return 0;
942 }
943 
944 static clib_error_t *
946 {
948  clib_error_t *error = 0;
949  u32 nbuckets;
950  vlib_node_t *node;
951 
952  rm->vlib_main = vm;
953  rm->vnet_main = vnet_get_main ();
954 
958  {
959  clib_spinlock_init (&rt->lock);
960  pool_alloc (rt->pool, rm->max_reass_n);
961  rt->lru_first = rt->lru_last = ~0;
962  }
963 
964  node = vlib_get_node_by_name (vm, (u8 *) "ip6-sv-reassembly-expire-walk");
965  ASSERT (node);
966  rm->ip6_sv_reass_expire_node_idx = node->index;
967 
972 
973  nbuckets = ip6_sv_reass_get_nbuckets ();
974  clib_bihash_init_48_8 (&rm->hash, "ip6-sv-reass", nbuckets,
975  nbuckets * 1024);
976 
977  node = vlib_get_node_by_name (vm, (u8 *) "ip6-drop");
978  ASSERT (node);
979  rm->ip6_drop_idx = node->index;
980  node = vlib_get_node_by_name (vm, (u8 *) "ip6-icmp-error");
981  ASSERT (node);
982  rm->ip6_icmp_error_idx = node->index;
983 
985  return error;
986 
988  rm->fq_feature_index =
990 
992 
993  return error;
994 }
995 
997 #endif /* CLIB_MARCH_VARIANT */
998 
999 static uword
1002 {
1004  uword event_type, *event_data = 0;
1005 
1006  while (true)
1007  {
1010  / (f64) MSEC_PER_SEC);
1011  event_type = vlib_process_get_events (vm, &event_data);
1012 
1013  switch (event_type)
1014  {
1015  case ~0: /* no events => timeout */
1016  /* nothing to do here */
1017  break;
1019  break;
1020  default:
1021  clib_warning ("BUG: event type 0x%wx", event_type);
1022  break;
1023  }
1024  f64 now = vlib_time_now (vm);
1025 
1026  ip6_sv_reass_t *reass;
1027  int *pool_indexes_to_free = NULL;
1028 
1029  uword thread_index = 0;
1030  int index;
1031  const uword nthreads = vlib_num_workers () + 1;
1032  for (thread_index = 0; thread_index < nthreads; ++thread_index)
1033  {
1035  clib_spinlock_lock (&rt->lock);
1036 
1037  vec_reset_length (pool_indexes_to_free);
1038  /* *INDENT-OFF* */
1039  pool_foreach_index (index, rt->pool) {
1040  reass = pool_elt_at_index (rt->pool, index);
1041  if (now > reass->last_heard + rm->timeout)
1042  {
1043  vec_add1 (pool_indexes_to_free, index);
1044  }
1045  }
1046  /* *INDENT-ON* */
1047  int *i;
1048  /* *INDENT-OFF* */
1049  vec_foreach (i, pool_indexes_to_free)
1050  {
1051  ip6_sv_reass_t *reass = pool_elt_at_index (rt->pool, i[0]);
1052  ip6_sv_reass_free (vm, rm, rt, reass);
1053  }
1054  /* *INDENT-ON* */
1055 
1056  clib_spinlock_unlock (&rt->lock);
1057  }
1058 
1059  vec_free (pool_indexes_to_free);
1060  if (event_data)
1061  {
1062  _vec_len (event_data) = 0;
1063  }
1064  }
1065 
1066  return 0;
1067 }
1068 
1069 /* *INDENT-OFF* */
1071  .function = ip6_sv_reass_walk_expired,
1072  .format_trace = format_ip6_sv_reass_trace,
1073  .type = VLIB_NODE_TYPE_PROCESS,
1074  .name = "ip6-sv-reassembly-expire-walk",
1075 
1077  .error_strings = ip6_sv_reassembly_error_strings,
1078 
1079 };
1080 /* *INDENT-ON* */
1081 
1082 static u8 *
1083 format_ip6_sv_reass_key (u8 * s, va_list * args)
1084 {
1085  ip6_sv_reass_key_t *key = va_arg (*args, ip6_sv_reass_key_t *);
1086  s = format (s, "xx_id: %u, src: %U, dst: %U, frag_id: %u, proto: %u",
1087  key->xx_id, format_ip6_address, &key->src, format_ip6_address,
1088  &key->dst, clib_net_to_host_u16 (key->frag_id), key->proto);
1089  return s;
1090 }
1091 
1092 static u8 *
1093 format_ip6_sv_reass (u8 * s, va_list * args)
1094 {
1095  vlib_main_t *vm = va_arg (*args, vlib_main_t *);
1096  ip6_sv_reass_t *reass = va_arg (*args, ip6_sv_reass_t *);
1097 
1098  s = format (s, "ID: %lu, key: %U, trace_op_counter: %u\n",
1099  reass->id, format_ip6_sv_reass_key, &reass->key,
1100  reass->trace_op_counter);
1101  vlib_buffer_t *b;
1102  u32 *bip;
1103  u32 counter = 0;
1104  vec_foreach (bip, reass->cached_buffers)
1105  {
1106  u32 bi = *bip;
1107  do
1108  {
1109  b = vlib_get_buffer (vm, bi);
1110  s = format (s, " #%03u: bi: %u\n", counter, bi);
1111  ++counter;
1112  bi = b->next_buffer;
1113  }
1114  while (b->flags & VLIB_BUFFER_NEXT_PRESENT);
1115  }
1116  return s;
1117 }
1118 
1119 static clib_error_t *
1122 {
1124 
1125  vlib_cli_output (vm, "---------------------");
1126  vlib_cli_output (vm, "IP6 reassembly status");
1127  vlib_cli_output (vm, "---------------------");
1128  bool details = false;
1129  if (unformat (input, "details"))
1130  {
1131  details = true;
1132  }
1133 
1134  u32 sum_reass_n = 0;
1135  u64 sum_buffers_n = 0;
1136  ip6_sv_reass_t *reass;
1138  const uword nthreads = vlib_num_workers () + 1;
1139  for (thread_index = 0; thread_index < nthreads; ++thread_index)
1140  {
1142  clib_spinlock_lock (&rt->lock);
1143  if (details)
1144  {
1145  /* *INDENT-OFF* */
1146  pool_foreach (reass, rt->pool) {
1147  vlib_cli_output (vm, "%U", format_ip6_sv_reass, vm, reass);
1148  }
1149  /* *INDENT-ON* */
1150  }
1151  sum_reass_n += rt->reass_n;
1152  clib_spinlock_unlock (&rt->lock);
1153  }
1154  vlib_cli_output (vm, "---------------------");
1155  vlib_cli_output (vm, "Current IP6 reassemblies count: %lu\n",
1156  (long unsigned) sum_reass_n);
1158  "Maximum configured concurrent shallow virtual IP6 reassemblies per worker-thread: %lu\n",
1159  (long unsigned) rm->max_reass_n);
1161  "Maximum configured amount of fragments per shallow "
1162  "virtual IP6 reassembly: %lu\n",
1163  (long unsigned) rm->max_reass_len);
1165  "Maximum configured shallow virtual IP6 reassembly timeout: %lums\n",
1166  (long unsigned) rm->timeout_ms);
1168  "Maximum configured shallow virtual IP6 reassembly expire walk interval: %lums\n",
1169  (long unsigned) rm->expire_walk_interval_ms);
1170  vlib_cli_output (vm, "Buffers in use: %lu\n",
1171  (long unsigned) sum_buffers_n);
1172  return 0;
1173 }
1174 
1175 /* *INDENT-OFF* */
1177  .path = "show ip6-sv-reassembly",
1178  .short_help = "show ip6-sv-reassembly [details]",
1179  .function = show_ip6_sv_reass,
1180 };
1181 /* *INDENT-ON* */
1182 
1183 #ifndef CLIB_MARCH_VARIANT
1186 {
1188  enable_disable);
1189 }
1190 #endif /* CLIB_MARCH_VARIANT */
1191 
1192 #define foreach_ip6_sv_reassembly_handoff_error \
1193 _(CONGESTION_DROP, "congestion drop")
1194 
1195 
1196 typedef enum
1197 {
1198 #define _(sym,str) IP6_SV_REASSEMBLY_HANDOFF_ERROR_##sym,
1200 #undef _
1203 
1205 #define _(sym,string) string,
1207 #undef _
1208 };
1209 
1210 typedef struct
1211 {
1214 
1215 static u8 *
1217 {
1218  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
1219  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
1221  va_arg (*args, ip6_sv_reassembly_handoff_trace_t *);
1222 
1223  s =
1224  format (s, "ip6-sv-reassembly-handoff: next-worker %d",
1225  t->next_worker_index);
1226 
1227  return s;
1228 }
1229 
1233  vlib_frame_t * frame, bool is_feature)
1234 {
1236 
1238  u32 n_enq, n_left_from, *from;
1239  u16 thread_indices[VLIB_FRAME_SIZE], *ti;
1240  u32 fq_index;
1241 
1243  n_left_from = frame->n_vectors;
1245 
1246  b = bufs;
1247  ti = thread_indices;
1248 
1249  fq_index = (is_feature) ? rm->fq_feature_index : rm->fq_index;
1250 
1251  while (n_left_from > 0)
1252  {
1253  ti[0] = vnet_buffer (b[0])->ip.reass.owner_thread_index;
1254 
1255  if (PREDICT_FALSE
1256  ((node->flags & VLIB_NODE_FLAG_TRACE)
1257  && (b[0]->flags & VLIB_BUFFER_IS_TRACED)))
1258  {
1260  vlib_add_trace (vm, node, b[0], sizeof (*t));
1261  t->next_worker_index = ti[0];
1262  }
1263 
1264  n_left_from -= 1;
1265  ti += 1;
1266  b += 1;
1267  }
1268  n_enq = vlib_buffer_enqueue_to_thread (vm, node, fq_index, from,
1269  thread_indices, frame->n_vectors, 1);
1270 
1271  if (n_enq < frame->n_vectors)
1272  vlib_node_increment_counter (vm, node->node_index,
1273  IP6_SV_REASSEMBLY_HANDOFF_ERROR_CONGESTION_DROP,
1274  frame->n_vectors - n_enq);
1275  return frame->n_vectors;
1276 }
1277 
1280  vlib_frame_t * frame)
1281 {
1283  false /* is_feature */ );
1284 }
1285 
1286 /* *INDENT-OFF* */
1288  .name = "ip6-sv-reassembly-handoff",
1289  .vector_size = sizeof (u32),
1291  .error_strings = ip6_sv_reassembly_handoff_error_strings,
1293 
1294  .n_next_nodes = 1,
1295 
1296  .next_nodes = {
1297  [0] = "error-drop",
1298  },
1299 };
1300 
1301 
1304 {
1305  return ip6_sv_reassembly_handoff_inline (vm, node, frame, true /* is_feature */ );
1306 }
1307 
1308 
1309 /* *INDENT-OFF* */
1311  .name = "ip6-sv-reass-feature-hoff",
1312  .vector_size = sizeof (u32),
1314  .error_strings = ip6_sv_reassembly_handoff_error_strings,
1316 
1317  .n_next_nodes = 1,
1318 
1319  .next_nodes = {
1320  [0] = "error-drop",
1321  },
1322 };
1323 /* *INDENT-ON* */
1324 
1325 #ifndef CLIB_MARCH_VARIANT
1326 int
1328 {
1331  if (is_enable)
1332  {
1334  {
1336  return vnet_feature_enable_disable ("ip6-unicast",
1337  "ip6-sv-reassembly-feature",
1338  sw_if_index, 1, 0, 0);
1339  }
1341  }
1342  else
1343  {
1346  return vnet_feature_enable_disable ("ip6-unicast",
1347  "ip6-sv-reassembly-feature",
1348  sw_if_index, 0, 0, 0);
1349  }
1350  return 0;
1351 }
1352 #endif
1353 
1354 /*
1355  * fd.io coding-style-patch-verification: ON
1356  *
1357  * Local Variables:
1358  * eval: (c-set-style "gnu")
1359  * End:
1360  */
vec_reset_length
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
Definition: vec_bootstrap.h:194
REASS_PASSTHROUGH
@ REASS_PASSTHROUGH
Definition: ip6_sv_reass.c:176
clib_spinlock_init
static void clib_spinlock_init(clib_spinlock_t *p)
Definition: lock.h:65
tmp
u32 * tmp
Definition: interface_output.c:1078
vlib_buffer_t::next_buffer
u32 next_buffer
Next buffer for this linked-list of buffers.
Definition: buffer.h:149
ip6_sv_reass_per_thread_t::id_counter
u32 id_counter
Definition: ip6_sv_reass.c:115
vlib_buffer_free
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
Definition: buffer_funcs.h:982
ip6_sv_reass_kv_t
Definition: ip6_sv_reass.c:72
ip6_frag_hdr_more
#define ip6_frag_hdr_more(hdr)
Definition: ip6_packet.h:706
vlib_num_workers
static u32 vlib_num_workers()
Definition: threads.h:354
show_ip6_sv_reassembly_cmd
static vlib_cli_command_t show_ip6_sv_reassembly_cmd
(constructor) VLIB_CLI_COMMAND (show_ip6_sv_reassembly_cmd)
Definition: ip6_sv_reass.c:1176
while
while(n_left_from > 0)
Definition: nat44_ei_hairpinning.c:419
ip6_sv_reass_t::tcp_seq_number
u32 tcp_seq_number
Definition: ip6_sv_reass.c:101
thread_index
u32 thread_index
Definition: nat44_ei_hairpinning.c:492
bufs
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
Definition: nat44_ei_out2in.c:717
ip6_sv_reass_main_t::vlib_main
vlib_main_t * vlib_main
Definition: ip6_sv_reass.c:140
ip6_sv_reass_set
vnet_api_error_t ip6_sv_reass_set(u32 timeout_ms, u32 max_reassemblies, u32 max_reassembly_length, u32 expire_walk_interval_ms)
set ip6 reassembly configuration
Definition: ip6_sv_reass.c:896
ip6_sv_reass_main_t::fq_index
u32 fq_index
Worker handoff.
Definition: ip6_sv_reass.c:149
vlib_buffer_enqueue_to_thread
static_always_inline u32 vlib_buffer_enqueue_to_thread(vlib_main_t *vm, vlib_node_runtime_t *node, u32 frame_queue_index, u32 *buffer_indices, u16 *thread_indices, u32 n_packets, int drop_on_congestion)
Definition: buffer_node.h:358
frame
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
Definition: nat44_ei.c:3048
ip6_sv_reass_key_t::xx_id
u32 xx_id
Definition: ip6_sv_reass.c:53
icmp6_error_set_vnet_buffer
void icmp6_error_set_vnet_buffer(vlib_buffer_t *b, u8 type, u8 code, u32 data)
Definition: icmp6.c:446
ip_proto
ip_proto
Definition: ip_types.api:75
MSEC_PER_SEC
#define MSEC_PER_SEC
Definition: ip6_sv_reass.c:30
IP6_SV_REASS_TIMEOUT_DEFAULT_MS
#define IP6_SV_REASS_TIMEOUT_DEFAULT_MS
Definition: ip6_sv_reass.c:31
next_index
nat44_ei_hairpin_src_next_t next_index
Definition: nat44_ei_hairpinning.c:412
ip6_sv_reass_t::id
u64 id
Definition: ip6_sv_reass.c:89
ip6_sv_reass_main_t::expire_walk_interval_ms
u32 expire_walk_interval_ms
Definition: ip6_sv_reass.c:127
vlib_get_buffer
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
Definition: buffer_funcs.h:111
IP6_SV_REASS_EXPIRE_WALK_INTERVAL_DEFAULT_MS
#define IP6_SV_REASS_EXPIRE_WALK_INTERVAL_DEFAULT_MS
Definition: ip6_sv_reass.c:32
f
vlib_frame_t * f
Definition: interface_output.c:1080
ip6_rehash_cb_ctx
Definition: ip6_full_reass.c:1355
ip6_sv_reass_update
static ip6_sv_reass_rc_t ip6_sv_reass_update(vlib_main_t *vm, vlib_node_runtime_t *node, ip6_sv_reass_main_t *rm, ip6_sv_reass_per_thread_t *rt, ip6_sv_reass_t *reass, u32 bi0, ip6_frag_hdr_t *frag_hdr)
Definition: ip6_sv_reass.c:384
ip6_sv_reass_trace_t::l4_src_port
u16 l4_src_port
Definition: ip6_sv_reass.c:185
format_ip6_sv_reass_trace
static u8 * format_ip6_sv_reass_trace(u8 *s, va_list *args)
Definition: ip6_sv_reass.c:190
pool_elt_at_index
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:553
ip6_sv_reass_t
Definition: ip6_sv_reass.c:82
ip6_sv_reass_trace_t::ip_proto
u8 ip_proto
Definition: ip6_sv_reass.c:184
ip6_sv_reass_main_t::fq_feature_index
u32 fq_feature_index
Definition: ip6_sv_reass.c:150
ip6_header_t::protocol
u8 protocol
Definition: ip6_packet.h:304
ip6_sv_reass_verify_upper_layer_present
static bool ip6_sv_reass_verify_upper_layer_present(vlib_node_runtime_t *node, vlib_buffer_t *b, ip6_frag_hdr_t *frag_hdr)
Definition: ip6_sv_reass.c:447
vlib_get_buffers
vlib_get_buffers(vm, from, b, n_left_from)
ip6_sv_reass_key_t::dst
ip6_address_t dst
Definition: ip6_sv_reass.c:52
IP6_SV_REASS_RC_INTERNAL_ERROR
@ IP6_SV_REASS_RC_INTERNAL_ERROR
Definition: ip6_sv_reass.c:41
VLIB_FRAME_SIZE
#define VLIB_FRAME_SIZE
Definition: node.h:368
node
vlib_main_t vlib_node_runtime_t * node
Definition: nat44_ei.c:3047
ip6_sv_reass_kv_t::k
ip6_sv_reass_key_t k
Definition: ip6_sv_reass.c:76
ip6_sv_reass_t::trace_op_counter
u32 trace_op_counter
Definition: ip6_sv_reass.c:91
vlib_cli_command_t::path
char * path
Definition: cli.h:96
ip6_sv_reass_enable_disable
vnet_api_error_t ip6_sv_reass_enable_disable(u32 sw_if_index, u8 enable_disable)
Definition: ip6_sv_reass.c:1185
ip6_sv_reass_main_t::ip6_icmp_error_idx
u32 ip6_icmp_error_idx
Definition: ip6_sv_reass.c:145
ip6_sv_reassembly_handoff_node
vlib_node_registration_t ip6_sv_reassembly_handoff_node
(constructor) VLIB_REGISTER_NODE (ip6_sv_reassembly_handoff_node)
Definition: ip6_sv_reass.c:1287
ip6_sv_reassembly_inline
static uword ip6_sv_reassembly_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, bool is_feature)
Definition: ip6_sv_reass.c:514
u16
unsigned short u16
Definition: types.h:57
ip6_sv_reass_t::key
ip6_sv_reass_key_t key
Definition: ip6_sv_reass.c:85
vlib_call_init_function
#define vlib_call_init_function(vm, x)
Definition: init.h:259
pool_put
#define pool_put(P, E)
Free an object E in pool P.
Definition: pool.h:305
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
VLIB_RX
@ VLIB_RX
Definition: defs.h:46
ip6_sv_reass_get
vnet_api_error_t ip6_sv_reass_get(u32 *timeout_ms, u32 *max_reassemblies, u32 *max_reassembly_length, u32 *expire_walk_interval_ms)
get ip6 reassembly configuration
Definition: ip6_sv_reass.c:934
ip6_sv_reass_main_t::per_thread_data
ip6_sv_reass_per_thread_t * per_thread_data
Definition: ip6_sv_reass.c:137
ip6_sv_reassembly_handoff_inline
static uword ip6_sv_reassembly_handoff_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, bool is_feature)
Definition: ip6_sv_reass.c:1231
ip6_sv_reass_enable_disable_with_refcnt
int ip6_sv_reass_enable_disable_with_refcnt(u32 sw_if_index, int is_enable)
Definition: ip6_sv_reass.c:1327
unformat_input_t
struct _unformat_input_t unformat_input_t
ip6_sv_reass_main
ip6_sv_reass_main_t ip6_sv_reass_main
Definition: ip6_sv_reass.c:159
ip6_sv_reass_node
vlib_node_registration_t ip6_sv_reass_node
(constructor) VLIB_REGISTER_NODE (ip6_sv_reass_node)
Definition: ip6_sv_reass.c:790
vlib_frame_t
Definition: node.h:372
vlib_process_signal_event
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
Definition: node_funcs.h:1019
vlib_buffer_length_in_chain
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
Definition: buffer_funcs.h:433
clib_memcpy_fast
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
Definition: string.h:92
IP6_SV_REASS_RC_OK
@ IP6_SV_REASS_RC_OK
Definition: ip6_sv_reass.c:39
ip6_sv_reass_t::l4_src_port
u16 l4_src_port
Definition: ip6_sv_reass.c:103
ip6_sv_reass_main_t::feature_use_refcount_per_intf
u32 * feature_use_refcount_per_intf
Definition: ip6_sv_reass.c:153
ip6_sv_reass_main_t::timeout_ms
u32 timeout_ms
Definition: ip6_sv_reass.c:125
error
Definition: cJSON.c:88
ip6_sv_reass_event_t
ip6_sv_reass_event_t
Definition: ip6_sv_reass.c:860
key
typedef key
Definition: ipsec_types.api:88
IP6_SV_REASS_MAX_REASSEMBLIES_DEFAULT
#define IP6_SV_REASS_MAX_REASSEMBLIES_DEFAULT
Definition: ip6_sv_reass.c:33
vlib_frame_queue_main_init
u32 vlib_frame_queue_main_init(u32 node_index, u32 frame_queue_nelts)
Definition: threads.c:1572
unformat
uword unformat(unformat_input_t *i, const char *fmt,...)
Definition: unformat.c:978
vnet_buffer_opaque_t::ip
struct vnet_buffer_opaque_t::@157::@159 ip
IP6_SV_REASS_MAX_REASSEMBLY_LENGTH_DEFAULT
#define IP6_SV_REASS_MAX_REASSEMBLY_LENGTH_DEFAULT
Definition: ip6_sv_reass.c:34
pool_is_free_index
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
Definition: pool.h:302
vec_elt
#define vec_elt(v, i)
Get vector value at index i.
Definition: vec_bootstrap.h:210
ip6_sv_reass_expire_node
vlib_node_registration_t ip6_sv_reass_expire_node
(constructor) VLIB_REGISTER_NODE (ip6_sv_reass_expire_node)
Definition: ip6_sv_reass.c:1070
ip6_sv_reass_per_thread_t::pool
ip6_sv_reass_t * pool
Definition: ip6_sv_reass.c:113
format_ip6_sv_reassembly_handoff_trace
static u8 * format_ip6_sv_reassembly_handoff_trace(u8 *s, va_list *args)
Definition: ip6_sv_reass.c:1216
vlib_process_get_events
static uword vlib_process_get_events(vlib_main_t *vm, uword **data_vector)
Return the first event type which has occurred and a vector of per-event data of that type,...
Definition: node_funcs.h:583
ti
u32 ti
Definition: interface_output.c:405
ip6_sv_reass_val_t::as_u64
u64 as_u64
Definition: ip6_sv_reass.c:69
pool_foreach
#define pool_foreach(VAR, POOL)
Iterate through pool.
Definition: pool.h:534
ip6_sv_reass_kv_t::kv
clib_bihash_kv_48_8_t kv
Definition: ip6_sv_reass.c:79
ip6_sv_reass_find_or_create
static ip6_sv_reass_t * ip6_sv_reass_find_or_create(vlib_main_t *vm, vlib_node_runtime_t *node, ip6_sv_reass_main_t *rm, ip6_sv_reass_per_thread_t *rt, ip6_sv_reass_kv_t *kv, u32 *icmp_bi, u8 *do_handoff)
Definition: ip6_sv_reass.c:306
ip6_sv_reass_t::is_complete
bool is_complete
Definition: ip6_sv_reass.c:96
ip6_sv_reass_kv_t::v
ip6_sv_reass_val_t v
Definition: ip6_sv_reass.c:77
ip6_sv_reass_init
static void ip6_sv_reass_init(ip6_sv_reass_t *reass)
Definition: ip6_sv_reass.c:299
ip6_sv_reassembly_feature_handoff_node
vlib_node_registration_t ip6_sv_reassembly_feature_handoff_node
(constructor) VLIB_REGISTER_NODE (ip6_sv_reassembly_feature_handoff_node)
Definition: ip6_sv_reass.c:1310
vec_len
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Definition: vec_bootstrap.h:142
vlib_buffer_t::error
vlib_error_t error
Error code for buffers to be enqueued to error handler.
Definition: buffer.h:145
IP6_SV_REASS_RC_UNSUPP_IP_PROTO
@ IP6_SV_REASS_RC_UNSUPP_IP_PROTO
Definition: ip6_sv_reass.c:42
ip6_sv_reass.h
IPv6 shallow virtual reassembly.
VLIB_NODE_FN
#define VLIB_NODE_FN(node)
Definition: node.h:202
vec_add1
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Definition: vec.h:606
CLIB_UNUSED
#define CLIB_UNUSED(x)
Definition: clib.h:90
vnet_buffer
#define vnet_buffer(b)
Definition: buffer.h:437
vnet_get_main
vnet_main_t * vnet_get_main(void)
Definition: pnat_test_stubs.h:56
VLIB_NODE_FLAG_TRACE
#define VLIB_NODE_FLAG_TRACE
Definition: node.h:291
ip6_sv_reass_trace_t::op_id
u32 op_id
Definition: ip6_sv_reass.c:183
PREDICT_FALSE
#define PREDICT_FALSE(x)
Definition: clib.h:124
IP6_EVENT_CONFIG_CHANGED
@ IP6_EVENT_CONFIG_CHANGED
Definition: ip6_sv_reass.c:862
vnet_feature_next
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
Definition: feature.h:322
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
vlib_frame_vector_args
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
Definition: node_funcs.h:301
clib_spinlock_lock
static_always_inline void clib_spinlock_lock(clib_spinlock_t *p)
Definition: lock.h:82
ip6_ext_header_find
static void * ip6_ext_header_find(vlib_main_t *vm, vlib_buffer_t *b, ip6_header_t *ip6_header, u8 header_type, ip6_ext_header_t **prev_ext_header)
Definition: ip6_packet.h:575
clib_bihash_copied
__clib_export void clib_bihash_copied(void *dst, void *src)
Definition: bihash_all_vector.c:36
clib_spinlock_s
Definition: lock.h:51
ip6_sv_reass_get_nbuckets
static u32 ip6_sv_reass_get_nbuckets()
Definition: ip6_sv_reass.c:843
IP6_SV_REASS_RC_TOO_MANY_FRAGMENTS
@ IP6_SV_REASS_RC_TOO_MANY_FRAGMENTS
Definition: ip6_sv_reass.c:40
vec_foreach_index
#define vec_foreach_index(var, v)
Iterate over vector indices.
Definition: vec_bootstrap.h:220
ip6_sv_reass_per_thread_t::lru_first
u32 lru_first
Definition: ip6_sv_reass.c:118
uword
u64 uword
Definition: types.h:112
ip6_sv_reassembly_handoff_error_t
ip6_sv_reassembly_handoff_error_t
Definition: ip6_sv_reass.c:1196
vlib_main_t::thread_index
u32 thread_index
Definition: main.h:213
ip6_sv_reass_key_t::proto
u8 proto
Definition: ip6_sv_reass.c:56
vlib_node_increment_counter
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
Definition: node_funcs.h:1244
i
sll srl srl sll sra u16x4 i
Definition: vector_sse42.h:261
ip6_sv_reass_verify_fragment_multiple_8
static bool ip6_sv_reass_verify_fragment_multiple_8(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b, ip6_frag_hdr_t *frag_hdr)
Definition: ip6_sv_reass.c:469
ip6_sv_reass_verify_packet_size_lt_64k
static bool ip6_sv_reass_verify_packet_size_lt_64k(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b, ip6_frag_hdr_t *frag_hdr)
Definition: ip6_sv_reass.c:491
f64
double f64
Definition: types.h:142
ip6_header_t::dst_address
ip6_address_t dst_address
Definition: ip6_packet.h:310
ip6_sv_reass_per_thread_t
Definition: ip6_sv_reass.c:111
ip6_frag_hdr_offset
#define ip6_frag_hdr_offset(hdr)
Definition: ip6_packet.h:700
pool_get
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
Definition: pool.h:255
vec_validate
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
Definition: vec.h:523
ip6_main_t::fib_index_by_sw_if_index
u32 * fib_index_by_sw_if_index
Definition: ip6.h:127
VLIB_CLI_COMMAND
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:163
ip6_to_ip4.h
IPv6 to IPv4 translation.
ip6_sv_reass_t::l4_dst_port
u16 l4_dst_port
Definition: ip6_sv_reass.c:105
ip6_sv_reass_key_t::src
ip6_address_t src
Definition: ip6_sv_reass.c:51
foreach_ip6_sv_reassembly_handoff_error
#define foreach_ip6_sv_reassembly_handoff_error
Definition: ip6_sv_reass.c:1192
ip6_sv_reass_next_t
ip6_sv_reass_next_t
Definition: ip6_sv_reass.c:162
ip6_sv_reass_trace_t::action
ip6_sv_reass_trace_operation_e action
Definition: ip6_sv_reass.c:181
IP6_SV_REASSEMBLY_NEXT_ICMP_ERROR
@ IP6_SV_REASSEMBLY_NEXT_ICMP_ERROR
Definition: ip6_sv_reass.c:166
ip6_sv_reass_node_feature
vlib_node_registration_t ip6_sv_reass_node_feature
(constructor) VLIB_REGISTER_NODE (ip6_sv_reass_node_feature)
Definition: ip6_sv_reass.c:815
REASS_FINISH
@ REASS_FINISH
Definition: ip6_sv_reass.c:174
ip_main_init
clib_error_t * ip_main_init(vlib_main_t *vm)
Definition: ip_init.c:45
ip6_sv_reass_key_t::as_u64
u64 as_u64[6]
Definition: ip6_sv_reass.c:58
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
vlib_cli_output
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
Definition: cli.c:716
ip6_sv_reass_val_t::reass_index
u32 reass_index
Definition: ip6_sv_reass.c:66
REASS_FRAGMENT_CACHE
@ REASS_FRAGMENT_CACHE
Definition: ip6_sv_reass.c:173
vlib_buffer_t::current_length
u16 current_length
Nbytes between current data and the end of this buffer.
Definition: buffer.h:122
ip6_sv_reass_t::tcp_ack_number
u32 tcp_ack_number
Definition: ip6_sv_reass.c:100
format_ip6_sv_reass
static u8 * format_ip6_sv_reass(u8 *s, va_list *args)
Definition: ip6_sv_reass.c:1093
IP6_SV_REASSEMBLY_NEXT_DROP
@ IP6_SV_REASSEMBLY_NEXT_DROP
Definition: ip6_sv_reass.c:165
ip6_sv_reass_set_params
static void ip6_sv_reass_set_params(u32 timeout_ms, u32 max_reassemblies, u32 max_reassembly_length, u32 expire_walk_interval_ms)
Definition: ip6_sv_reass.c:884
ip6_main
ip6_main_t ip6_main
Definition: ip6_forward.c:2787
ip6_sv_reass_t::cached_buffers
u32 * cached_buffers
Definition: ip6_sv_reass.c:94
ip6_sv_reass_trace_operation_e
ip6_sv_reass_trace_operation_e
Definition: ip6_sv_reass.c:171
vnet_main_t
Definition: vnet.h:76
vec_free
#define vec_free(V)
Free vector's memory (no header).
Definition: vec.h:395
ip6_sv_reass_t::lru_prev
u32 lru_prev
Definition: ip6_sv_reass.c:107
vlib_validate_buffer_enqueue_x1
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
Definition: buffer_node.h:224
index
u32 index
Definition: flow_types.api:221
ip6_sv_reass_per_thread_t::reass_n
u32 reass_n
Definition: ip6_sv_reass.c:114
ip6_sv_reassembly_error_strings
static char * ip6_sv_reassembly_error_strings[]
Definition: ip6_sv_reass.c:776
always_inline
#define always_inline
Definition: rdma_mlx5dv.h:23
vlib_get_node_by_name
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
Definition: node.c:45
vnet_buffer_opaque_t
Definition: buffer.h:149
ip6_sv_reass_main_t
Definition: ip6_sv_reass.c:122
ip6_sv_reass_walk_expired
static uword ip6_sv_reass_walk_expired(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
Definition: ip6_sv_reass.c:1000
pool_foreach_index
#define pool_foreach_index(i, v)
Definition: pool.h:576
ip6_sv_reass_t::ip_proto
u8 ip_proto
Definition: ip6_sv_reass.c:98
ip6_sv_reass_free
static void ip6_sv_reass_free(vlib_main_t *vm, ip6_sv_reass_main_t *rm, ip6_sv_reass_per_thread_t *rt, ip6_sv_reass_t *reass)
Definition: ip6_sv_reass.c:259
u64
unsigned long u64
Definition: types.h:89
vlib_trace_main_t::trace_buffer_pool
vlib_trace_header_t ** trace_buffer_pool
Definition: trace.h:86
vlib_process_wait_for_event_or_clock
static f64 vlib_process_wait_for_event_or_clock(vlib_main_t *vm, f64 dt)
Suspend a cooperative multi-tasking thread Waits for an event, or for the indicated number of seconds...
Definition: node_funcs.h:755
format
description fragment has unexpected format
Definition: map.api:433
ASSERT
#define ASSERT(truth)
Definition: error_bootstrap.h:69
ip6_sv_reass_t::lru_next
u32 lru_next
Definition: ip6_sv_reass.c:108
vlib_put_next_frame
vlib_put_next_frame(vm, node, next_index, 0)
ip6_sv_reass_per_thread_t::lock
clib_spinlock_t lock
Definition: ip6_sv_reass.c:116
ip.h
ip6_ext_hdr
static u8 ip6_ext_hdr(u8 nexthdr)
Definition: ip6_packet.h:524
u32
unsigned int u32
Definition: types.h:88
VLIB_INIT_FUNCTION
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:172
ip6_sv_reass_key_t::frag_id
u32 frag_id
Definition: ip6_sv_reass.c:54
REASS_FRAGMENT_FORWARD
@ REASS_FRAGMENT_FORWARD
Definition: ip6_sv_reass.c:175
ip6_sv_reass_init_function
static clib_error_t * ip6_sv_reass_init_function(vlib_main_t *vm)
Definition: ip6_sv_reass.c:945
IP6_SV_REASSEMBLY_HANDOFF_N_ERROR
@ IP6_SV_REASSEMBLY_HANDOFF_N_ERROR
Definition: ip6_sv_reass.c:1201
ip6_sv_reass_main_t::ip6_drop_idx
u32 ip6_drop_idx
Definition: ip6_sv_reass.c:144
IP6_SV_REASS_HT_LOAD_FACTOR
#define IP6_SV_REASS_HT_LOAD_FACTOR
Definition: ip6_sv_reass.c:35
format_ip6_sv_reass_key
static u8 * format_ip6_sv_reass_key(u8 *s, va_list *args)
Definition: ip6_sv_reass.c:1083
ctx
long ctx[MAX_CONNS]
Definition: main.c:144
clib_bihash_kv_48_8_t::key
u64 key[6]
Definition: bihash_48_8.h:41
vec_foreach
#define vec_foreach(var, vec)
Vector iterator.
Definition: vec_bootstrap.h:213
VLIB_NODE_TYPE_PROCESS
@ VLIB_NODE_TYPE_PROCESS
Definition: node.h:84
as_u64
u64 as_u64
Definition: bihash_doc.h:63
n_vectors
return frame n_vectors
Definition: nat44_ei_hairpinning.c:485
ip6_sv_reass_key_t
Definition: ip6_sv_reass.c:45
ip6_sv_reass_main_t::ip6_sv_reass_expire_node_idx
u32 ip6_sv_reass_expire_node_idx
Definition: ip6_sv_reass.c:146
ip6_sv_reass_per_thread_t::lru_last
u32 lru_last
Definition: ip6_sv_reass.c:119
clib_spinlock_unlock
static_always_inline void clib_spinlock_unlock(clib_spinlock_t *p)
Definition: lock.h:121
ip6_header_t
Definition: ip6_packet.h:294
vnet_feature_enable_disable
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
Definition: pnat_test_stubs.h:50
ip6_get_port
static u16 ip6_get_port(vlib_main_t *vm, vlib_buffer_t *b, ip6_header_t *ip6, u16 buffer_len, u8 *ip_protocol, u16 *src_port, u16 *dst_port, u8 *icmp_type_or_tcp_flags, u32 *tcp_ack_number, u32 *tcp_seq_number)
Get L4 information like port number or ICMP id from IPv6 packet.
Definition: ip6_to_ip4.h:117
ip6_sv_reass_main_t::hash
clib_bihash_48_8_t hash
Definition: ip6_sv_reass.c:134
vec.h
ip6_frag_hdr_offset_bytes
#define ip6_frag_hdr_offset_bytes(hdr)
Definition: ip6_packet.h:703
now
f64 now
Definition: nat44_ei_out2in.c:710
ip6_header_t::src_address
ip6_address_t src_address
Definition: ip6_packet.h:310
clib_memset
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vlib_main_t
Definition: main.h:102
ip6_sv_reassembly_handoff_trace_t::next_worker_index
u32 next_worker_index
Definition: ip6_sv_reass.c:1212
vlib_node_t
Definition: node.h:247
vlib_add_trace
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
Definition: trace.c:628
b
vlib_buffer_t ** b
Definition: nat44_ei_out2in.c:717
VNET_FEATURES
#define VNET_FEATURES(...)
Definition: feature.h:470
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
vlib_buffer_get_current
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
Definition: buffer.h:257
rt
vnet_interface_output_runtime_t * rt
Definition: interface_output.c:399
ip
vl_api_address_t ip
Definition: l2.api:558
IP6_SV_REASSEMBLY_NEXT_INPUT
@ IP6_SV_REASSEMBLY_NEXT_INPUT
Definition: ip6_sv_reass.c:164
vlib_init_function_t
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
Definition: init.h:51
IP6_SV_REASSEMBLY_N_NEXT
@ IP6_SV_REASSEMBLY_N_NEXT
Definition: ip6_sv_reass.c:168
format_ip6_address
format_function_t format_ip6_address
Definition: format.h:91
ip6_sv_reassembly_handoff_trace_t
Definition: ip6_sv_reass.c:1210
ip6_sv_reass_val_t::thread_index
u32 thread_index
Definition: ip6_sv_reass.c:67
ip6_sv_reass_trace_t::l4_dst_port
u16 l4_dst_port
Definition: ip6_sv_reass.c:186
ip6_sv_reass_rc_t
ip6_sv_reass_rc_t
Definition: ip6_sv_reass.c:37
clib_warning
#define clib_warning(format, args...)
Definition: error.h:59
pool_alloc
#define pool_alloc(P, N)
Allocate N more free elements to pool (unspecified alignment).
Definition: pool.h:367
ip6_rehash_cb
static int ip6_rehash_cb(clib_bihash_kv_48_8_t *kv, void *_ctx)
Definition: ip6_sv_reass.c:873
ip6_sv_reass_add_trace
static void ip6_sv_reass_add_trace(vlib_main_t *vm, vlib_node_runtime_t *node, ip6_sv_reass_main_t *rm, ip6_sv_reass_t *reass, u32 bi, ip6_sv_reass_trace_operation_e action, u32 ip_proto, u16 l4_src_port, u16 l4_dst_port)
Definition: ip6_sv_reass.c:224
ip6_sv_reass_main_t::timeout
f64 timeout
Definition: ip6_sv_reass.c:126
vlib_time_now
static f64 vlib_time_now(vlib_main_t *vm)
Definition: main.h:325
vnet.h
vlib_main_t::trace_main
vlib_trace_main_t trace_main
Definition: main.h:174
ip6_ext_next_header
static void * ip6_ext_next_header(ip6_ext_header_t *ext_hdr)
Definition: ip6_packet.h:549
vlib_node_runtime_t
Definition: node.h:454
show_ip6_sv_reass
static clib_error_t * show_ip6_sv_reass(vlib_main_t *vm, unformat_input_t *input, CLIB_UNUSED(vlib_cli_command_t *lmd))
Definition: ip6_sv_reass.c:1120
ip6_sv_reass_main_t::vnet_main
vnet_main_t * vnet_main
Definition: ip6_sv_reass.c:141
vlib_buffer_get_trace_index
static u32 vlib_buffer_get_trace_index(vlib_buffer_t *b)
Extract the trace (pool) index from a trace handle.
Definition: buffer.h:416
vlib_cli_command_t
Definition: cli.h:92
ip6_sv_reassembly_handoff_error_strings
static char * ip6_sv_reassembly_handoff_error_strings[]
Definition: ip6_sv_reass.c:1204
from
from
Definition: nat44_ei_hairpinning.c:415
action
vl_api_mac_event_action_t action
Definition: l2.api:211
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
vlib_get_next_frame
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
Definition: node_funcs.h:395
ip6_sv_reass_main_t::max_reass_n
u32 max_reass_n
Definition: ip6_sv_reass.c:131
ip6_sv_reass_main_t::max_reass_len
u32 max_reass_len
Definition: ip6_sv_reass.c:129
n_left_from
n_left_from
Definition: nat44_ei_hairpinning.c:416
clib_bihash_kv_48_8_t
Definition: bihash_48_8.h:39
VNET_FEATURE_INIT
VNET_FEATURE_INIT(ip6_sv_reassembly_feature)
ip6_sv_reass_trace_t::reass_id
u32 reass_id
Definition: ip6_sv_reass.c:182
bihash_48_8.h
vnet_api_error_t
vnet_api_error_t
Definition: api_errno.h:162
vlib_buffer_t::flags
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
Definition: buffer.h:133
ip6_sv_reass_val_t
Definition: ip6_sv_reass.c:62
foreach_ip6_error
#define foreach_ip6_error
Definition: ip6_error.h:43
vlib_buffer_t
VLIB buffer representation.
Definition: buffer.h:111
ip6_sv_reass_t::last_heard
f64 last_heard
Definition: ip6_sv_reass.c:87
VLIB_REGISTER_NODE
#define VLIB_REGISTER_NODE(x,...)
Definition: node.h:169
ip6_sv_reass_trace_t
Definition: ip6_sv_reass.c:179
ip6_sv_reass_t::icmp_type_or_tcp_flags
u8 icmp_type_or_tcp_flags
Definition: ip6_sv_reass.c:99
IP6_SV_REASSEMBLY_NEXT_HANDOFF
@ IP6_SV_REASSEMBLY_NEXT_HANDOFF
Definition: ip6_sv_reass.c:167