X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fnat%2Fnat.c;h=90515acc5b6071f2d0edd6f4fa2edad21e6ef012;hb=c5c6a3342f3cbaaac647d52fd960b6f5b0fcd4e0;hp=721ad16d3dc1cf817e34cc80f4e67650918e94f3;hpb=cba6936c45bc3265ae695e8266bdefc65e7a5116;p=vpp.git diff --git a/src/plugins/nat/nat.c b/src/plugins/nat/nat.c index 721ad16d3dc..90515acc5b6 100644 --- a/src/plugins/nat/nat.c +++ b/src/plugins/nat/nat.c @@ -1586,7 +1586,7 @@ int snat_set_workers (uword * bitmap) clib_bitmap_foreach (i, bitmap, ({ vec_add1(sm->workers, i); - sm->per_thread_data[i].snat_thread_index = j; + sm->per_thread_data[sm->first_worker_index + i].snat_thread_index = j; j++; })); @@ -2758,6 +2758,7 @@ snat_get_worker_out2in_cb (ip4_header_t * ip0, u32 rx_fib_index0) snat_session_t *s; int i; u32 proto; + u32 next_worker_index = 0; /* first try static mappings without port */ if (PREDICT_FALSE (pool_elts (sm->static_mappings))) @@ -2873,7 +2874,10 @@ snat_get_worker_out2in_cb (ip4_header_t * ip0, u32 rx_fib_index0) } /* worker by outside port */ - return (u32) ((clib_net_to_host_u16 (port) - 1024) / sm->port_per_thread); + next_worker_index = sm->first_worker_index; + next_worker_index += + sm->workers[(clib_net_to_host_u16 (port) - 1024) / sm->port_per_thread]; + return next_worker_index; } static clib_error_t * @@ -2896,6 +2900,7 @@ snat_config (vlib_main_t * vm, unformat_input_t * input) u8 static_mapping_only = 0; u8 static_mapping_connection_tracking = 0; snat_main_per_thread_data_t *tsm; + dslite_main_t * dm = &dslite_main; sm->deterministic = 0; sm->out2in_dpo = 0; @@ -2941,6 +2946,8 @@ snat_config (vlib_main_t * vm, unformat_input_t * input) ; else if (unformat (input, "out2in dpo")) sm->out2in_dpo = 1; + else if (unformat (input, "dslite ce")) + dslite_set_ce(dm, 1); else return clib_error_return (0, "unknown input '%U'", format_unformat_error, input);