summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
diff options
context:
space:
mode:
authorJuraj Sloboda <jsloboda@cisco.com>2018-10-10 10:15:54 +0200
committerDamjan Marion <dmarion@me.com>2018-10-10 16:06:19 +0000
commitcd80692dfccb31a1200a2c8701151705765e51bc (patch)
treed328db223898d07ed3c6b6e317fb7b6402519b86 /src/vnet/ip
parent8b0995366110ff8c97d1d10aaa8291ad465b0b2f (diff)
reassembly: get number of workers instead of threads (VPP-1435)
Change-Id: If3abeab2b304e2df41139707a4c8d045fab6ef99 Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
Diffstat (limited to 'src/vnet/ip')
-rw-r--r--src/vnet/ip/ip4_reassembly.c6
-rw-r--r--src/vnet/ip/ip6_reassembly.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/vnet/ip/ip4_reassembly.c b/src/vnet/ip/ip4_reassembly.c
index 08b3e544e02..87fb7643823 100644
--- a/src/vnet/ip/ip4_reassembly.c
+++ b/src/vnet/ip/ip4_reassembly.c
@@ -1153,7 +1153,7 @@ ip4_reass_init_function (vlib_main_t * vm)
rm->vlib_main = vm;
rm->vnet_main = vnet_get_main ();
- vec_validate (rm->per_thread_data, vlib_num_workers () + 1);
+ vec_validate (rm->per_thread_data, vlib_num_workers ());
ip4_reass_per_thread_t *rt;
vec_foreach (rt, rm->per_thread_data)
{
@@ -1214,7 +1214,7 @@ ip4_reass_walk_expired (vlib_main_t * vm,
uword thread_index = 0;
int index;
- const uword nthreads = os_get_nthreads ();
+ const uword nthreads = vlib_num_workers () + 1;
for (thread_index = 0; thread_index < nthreads; ++thread_index)
{
ip4_reass_per_thread_t *rt = &rm->per_thread_data[thread_index];
@@ -1381,7 +1381,7 @@ show_ip4_reass (vlib_main_t * vm, unformat_input_t * input,
u64 sum_buffers_n = 0;
ip4_reass_t *reass;
uword thread_index;
- const uword nthreads = os_get_nthreads ();
+ const uword nthreads = vlib_num_workers () + 1;
for (thread_index = 0; thread_index < nthreads; ++thread_index)
{
ip4_reass_per_thread_t *rt = &rm->per_thread_data[thread_index];
diff --git a/src/vnet/ip/ip6_reassembly.c b/src/vnet/ip/ip6_reassembly.c
index 50445f2a181..e62f9e50588 100644
--- a/src/vnet/ip/ip6_reassembly.c
+++ b/src/vnet/ip/ip6_reassembly.c
@@ -1193,7 +1193,7 @@ ip6_reass_init_function (vlib_main_t * vm)
rm->vlib_main = vm;
rm->vnet_main = vnet_get_main ();
- vec_validate (rm->per_thread_data, vlib_num_workers () + 1);
+ vec_validate (rm->per_thread_data, vlib_num_workers ());
ip6_reass_per_thread_t *rt;
vec_foreach (rt, rm->per_thread_data)
{
@@ -1262,7 +1262,7 @@ ip6_reass_walk_expired (vlib_main_t * vm,
uword thread_index = 0;
int index;
- const uword nthreads = os_get_nthreads ();
+ const uword nthreads = vlib_num_workers () + 1;
u32 *vec_icmp_bi = NULL;
for (thread_index = 0; thread_index < nthreads; ++thread_index)
{
@@ -1472,7 +1472,7 @@ show_ip6_reass (vlib_main_t * vm, unformat_input_t * input,
u64 sum_buffers_n = 0;
ip6_reass_t *reass;
uword thread_index;
- const uword nthreads = os_get_nthreads ();
+ const uword nthreads = vlib_num_workers () + 1;
for (thread_index = 0; thread_index < nthreads; ++thread_index)
{
ip6_reass_per_thread_t *rt = &rm->per_thread_data[thread_index];