X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fnat%2Fin2out_ed.c;h=a70369aae4e5baa25af9f209c5be06a5ae1dbf03;hb=1a0a89770688a37e500f634b68805b1984eccac0;hp=0ca1dd89ca86e01b309c3c661d76d90c7796f56e;hpb=85bee7548bc5a360851d92807dae6d4159b68314;p=vpp.git diff --git a/src/plugins/nat/in2out_ed.c b/src/plugins/nat/in2out_ed.c index 0ca1dd89ca8..a70369aae4e 100644 --- a/src/plugins/nat/in2out_ed.c +++ b/src/plugins/nat/in2out_ed.c @@ -309,18 +309,12 @@ slow_path_ed (snat_main_t * sm, }; nat44_is_idle_session_ctx_t ctx; - u32 cleared = 0; - if (PREDICT_FALSE (nat44_maximum_sessions_exceeded (sm, thread_index))) { - if (PREDICT_FALSE - (!(cleared = nat44_users_cleanup (thread_index, now)))) - { - b->error = node->errors[NAT_IN2OUT_ED_ERROR_MAX_SESSIONS_EXCEEDED]; - nat_ipfix_logging_max_sessions (thread_index, sm->max_translations); - nat_elog_notice ("maximum sessions exceeded"); - return NAT_NEXT_DROP; - } + b->error = node->errors[NAT_IN2OUT_ED_ERROR_MAX_SESSIONS_EXCEEDED]; + nat_ipfix_logging_max_sessions (thread_index, sm->max_translations); + nat_elog_notice ("maximum sessions exceeded"); + return NAT_NEXT_DROP; } key0.addr = key->l_addr; @@ -339,16 +333,9 @@ slow_path_ed (snat_main_t * sm, sm->port_per_thread, tsm->snat_thread_index)) { - if (cleared || !nat44_out_of_ports_cleanup (thread_index, now) || - nat_alloc_addr_and_port_ed (sm->addresses, rx_fib_index, - thread_index, key, &key1, - sm->port_per_thread, - tsm->snat_thread_index)) - { - nat_elog_notice ("addresses exhausted"); - b->error = node->errors[NAT_IN2OUT_ED_ERROR_OUT_OF_PORTS]; - return NAT_NEXT_DROP; - } + nat_elog_notice ("addresses exhausted"); + b->error = node->errors[NAT_IN2OUT_ED_ERROR_OUT_OF_PORTS]; + return NAT_NEXT_DROP; } } else @@ -951,7 +938,6 @@ nat44_ed_in2out_fast_path_node_fn_inline (vlib_main_t * vm, snat_main_per_thread_data_t *tsm = &sm->per_thread_data[thread_index]; u32 tcp_packets = 0, udp_packets = 0, icmp_packets = 0, other_packets = 0, def_slow; - u32 tcp_closed_drops = 0; def_slow = is_output_feature ? NAT_NEXT_IN2OUT_ED_OUTPUT_SLOW_PATH : NAT_NEXT_IN2OUT_ED_SLOW_PATH; @@ -1065,7 +1051,6 @@ nat44_ed_in2out_fast_path_node_fn_inline (vlib_main_t * vm, else { // session in transitory timeout, drop - ++tcp_closed_drops; b0->error = node->errors[NAT_IN2OUT_ED_ERROR_TCP_CLOSED]; next0 = NAT_NEXT_DROP; } @@ -1078,11 +1063,9 @@ nat44_ed_in2out_fast_path_node_fn_inline (vlib_main_t * vm, (f64) nat44_session_get_timeout (sm, s0); if (now >= sess_timeout_time) { - // delete session nat_free_session_data (sm, s0, thread_index, 0); nat44_delete_session (sm, s0, thread_index); - - // session no longer exists, go slow path + // session is closed, go slow path next0 = def_slow; goto trace0; }