summaryrefslogtreecommitdiffstats
path: root/src/plugins/snat/in2out.c
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2017-08-03 00:58:05 -0700
committerNeale Ranns <nranns@cisco.com>2017-08-04 08:21:27 +0000
commit7801ca29b8f1b3a7b2ff68f3f84a0ae02a58b563 (patch)
treedc50748b1e03a0ae93f2214baa7ca98d5e6064fa /src/plugins/snat/in2out.c
parent33129bb9a3e954b7c9ba7a72f16550b1cf91dc9e (diff)
SNAT: fix address and port allocation for multiple worker threads (VPP-925)
There is a chance to allocate the same outside address and port. Assign a block of port numbers to each worker. Change-Id: I6ef7dc0aab4834705f4e6097c362940d18d747e8 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/snat/in2out.c')
-rw-r--r--src/plugins/snat/in2out.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/snat/in2out.c b/src/plugins/snat/in2out.c
index eb5b9da5dc7..abe0d9dbe87 100644
--- a/src/plugins/snat/in2out.c
+++ b/src/plugins/snat/in2out.c
@@ -356,8 +356,8 @@ static u32 slow_path (snat_main_t *sm, vlib_buffer_t *b0,
}
s->outside_address_index = ~0;
- if (snat_alloc_outside_address_and_port (sm, rx_fib_index0, &key1,
- &address_index))
+ if (snat_alloc_outside_address_and_port (sm, rx_fib_index0, thread_index,
+ &key1, &address_index))
{
ASSERT(0);
@@ -375,7 +375,8 @@ static u32 slow_path (snat_main_t *sm, vlib_buffer_t *b0,
{
static_mapping = 0;
/* Try to create dynamic translation */
- if (snat_alloc_outside_address_and_port (sm, rx_fib_index0, &key1,
+ if (snat_alloc_outside_address_and_port (sm, rx_fib_index0,
+ thread_index, &key1,
&address_index))
{
b0->error = node->errors[SNAT_IN2OUT_ERROR_OUT_OF_PORTS];