nat: remove unused code 93/27593/3
authorKlement Sekera <ksekera@cisco.com>
Thu, 18 Jun 2020 12:48:42 +0000 (12:48 +0000)
committerDamjan Marion <dmarion@me.com>
Fri, 19 Jun 2020 06:59:42 +0000 (06:59 +0000)
Type: refactor
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Icc55276c8a4c256049718610cb131a34dc8d0a80

src/plugins/nat/nat44_classify.c
src/plugins/nat/nat_inlines.h

index 54c52e3..a239c67 100644 (file)
@@ -84,7 +84,6 @@ nat44_classify_node_fn_inline (vlib_main_t * vm,
   nat44_classify_next_t next_index;
   snat_main_t *sm = &snat_main;
   snat_static_mapping_t *m;
-  u32 *fragments_to_drop = 0;
   u32 next_in2out = 0, next_out2in = 0;
 
   from = vlib_frame_vector_args (frame);
@@ -174,11 +173,6 @@ nat44_classify_node_fn_inline (vlib_main_t * vm,
       vlib_put_next_frame (vm, node, next_index, n_left_to_next);
     }
 
-  nat_send_all_to_node (vm, fragments_to_drop, node, 0,
-                       NAT44_CLASSIFY_NEXT_DROP);
-
-  vec_free (fragments_to_drop);
-
   vlib_node_increment_counter (vm, node->node_index,
                               NAT44_CLASSIFY_ERROR_NEXT_IN2OUT, next_in2out);
   vlib_node_increment_counter (vm, node->node_index,
@@ -195,7 +189,6 @@ nat44_handoff_classify_node_fn_inline (vlib_main_t * vm,
   nat44_classify_next_t next_index;
   snat_main_t *sm = &snat_main;
   snat_static_mapping_t *m;
-  u32 *fragments_to_drop = 0;
   u32 next_in2out = 0, next_out2in = 0;
 
   from = vlib_frame_vector_args (frame);
@@ -285,10 +278,6 @@ nat44_handoff_classify_node_fn_inline (vlib_main_t * vm,
       vlib_put_next_frame (vm, node, next_index, n_left_to_next);
     }
 
-  nat_send_all_to_node (vm, fragments_to_drop, node, 0, NAT_NEXT_DROP);
-
-  vec_free (fragments_to_drop);
-
   vlib_node_increment_counter (vm, node->node_index,
                               NAT44_CLASSIFY_ERROR_NEXT_IN2OUT, next_in2out);
   vlib_node_increment_counter (vm, node->node_index,
@@ -307,7 +296,6 @@ nat44_ed_classify_node_fn_inline (vlib_main_t * vm,
   snat_static_mapping_t *m;
   u32 thread_index = vm->thread_index;
   snat_main_per_thread_data_t *tsm = &sm->per_thread_data[thread_index];
-  u32 *fragments_to_drop = 0;
   u32 next_in2out = 0, next_out2in = 0;
 
   from = vlib_frame_vector_args (frame);
@@ -422,11 +410,6 @@ nat44_ed_classify_node_fn_inline (vlib_main_t * vm,
       vlib_put_next_frame (vm, node, next_index, n_left_to_next);
     }
 
-  nat_send_all_to_node (vm, fragments_to_drop, node, 0,
-                       NAT44_CLASSIFY_NEXT_DROP);
-
-  vec_free (fragments_to_drop);
-
   vlib_node_increment_counter (vm, node->node_index,
                               NAT44_CLASSIFY_ERROR_NEXT_IN2OUT, next_in2out);
   vlib_node_increment_counter (vm, node->node_index,
index 6741175..0254de3 100644 (file)
@@ -258,36 +258,6 @@ maximum_sessions_exceeded (snat_main_t * sm, u32 thread_index)
   return 0;
 }
 
-always_inline void
-nat_send_all_to_node (vlib_main_t * vm, u32 * bi_vector,
-                     vlib_node_runtime_t * node, vlib_error_t * error,
-                     u32 next)
-{
-  u32 n_left_from, *from, next_index, *to_next, n_left_to_next;
-
-  from = bi_vector;
-  n_left_from = vec_len (bi_vector);
-  next_index = node->cached_next_index;
-  while (n_left_from > 0)
-    {
-      vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
-      while (n_left_from > 0 && n_left_to_next > 0)
-       {
-         u32 bi0 = to_next[0] = from[0];
-         from += 1;
-         n_left_from -= 1;
-         to_next += 1;
-         n_left_to_next -= 1;
-         vlib_buffer_t *p0 = vlib_get_buffer (vm, bi0);
-         if (error)
-           p0->error = *error;
-         vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next,
-                                          n_left_to_next, bi0, next);
-       }
-      vlib_put_next_frame (vm, node, next_index, n_left_to_next);
-    }
-}
-
 always_inline void
 user_session_increment (snat_main_t * sm, snat_user_t * u, u8 is_static)
 {