aboutsummaryrefslogtreecommitdiffstats
path: root/vlib
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2016-08-08 15:13:42 -0400
committerKeith Burns <alagalah@gmail.com>2016-08-09 00:44:03 +0000
commit01d86c7f6f05938c7d3fe181bd0aa2f75ccdd1df (patch)
treee75aec2b423eb0e532d0dc51445b0f28b4652820 /vlib
parent3cff0e70766c2aa243edad3174df54885bb5c07b (diff)
VPP-189 Fix Coverity warnings
Remove a bunch of historical SMP code that we're not using; clean up coverity warnings as a side-effect. Change-Id: Ic80d2f87c7fd4e654078cac23ad5ec287a1d7ffe Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vlib')
-rw-r--r--vlib/vlib/threads.c12
-rw-r--r--vlib/vlib/unix/main.c5
2 files changed, 12 insertions, 5 deletions
diff --git a/vlib/vlib/threads.c b/vlib/vlib/threads.c
index 72f340ea205..302e201397b 100644
--- a/vlib/vlib/threads.c
+++ b/vlib/vlib/threads.c
@@ -77,6 +77,18 @@ os_get_cpu_number (void)
return n;
}
+uword
+os_get_ncpus (void)
+{
+ u32 len;
+
+ len = vec_len (vlib_thread_stacks);
+ if (len == 0)
+ return 1;
+ else
+ return len;
+}
+
void
vlib_set_thread_name (char *name)
{
diff --git a/vlib/vlib/unix/main.c b/vlib/vlib/unix/main.c
index 3c17031b884..efa4f20f03f 100644
--- a/vlib/vlib/unix/main.c
+++ b/vlib/vlib/unix/main.c
@@ -439,8 +439,6 @@ int
vlib_unix_main (int argc, char *argv[])
{
vlib_main_t *vm = &vlib_global_main; /* one and only time for this! */
-
- clib_smp_main_t *sm = &clib_smp_main;
vlib_thread_main_t *tm = &vlib_thread_main;
unformat_input_t input;
u8 *thread_stacks;
@@ -472,9 +470,6 @@ vlib_unix_main (int argc, char *argv[])
((uword) tm->n_thread_stacks * VLIB_THREAD_STACK_SIZE,
(VLIB_MAX_CPUS << VLIB_LOG2_THREAD_STACK_SIZE));
- sm->vm_base = thread_stacks;
- sm->log2_n_per_cpu_vm_bytes = VLIB_LOG2_THREAD_STACK_SIZE;
-
vec_validate (vlib_thread_stacks, tm->n_thread_stacks - 1);
for (i = 0; i < vec_len (vlib_thread_stacks); i++)
{