summaryrefslogtreecommitdiffstats
path: root/src/vlib/unix
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib/unix')
-rw-r--r--src/vlib/unix/input.c12
-rwxr-xr-xsrc/vlib/unix/main.c1
2 files changed, 10 insertions, 3 deletions
diff --git a/src/vlib/unix/input.c b/src/vlib/unix/input.c
index 8be0770bfd3..6b519e5ce95 100644
--- a/src/vlib/unix/input.c
+++ b/src/vlib/unix/input.c
@@ -223,12 +223,13 @@ linux_epoll_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
em->epoll_events,
vec_len (em->epoll_events), timeout_ms);
}
+
}
else
{
if (timeout_ms)
usleep (timeout_ms * 1000);
- return 0;
+ goto done;
}
}
@@ -238,7 +239,7 @@ linux_epoll_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
vlib_panic_with_error (vm, clib_error_return_unix (0, "epoll_wait"));
/* non fatal error (e.g. EINTR). */
- return 0;
+ goto done;
}
em->epoll_waits += 1;
@@ -314,6 +315,13 @@ linux_epoll_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
}
}
+done:
+ if (PREDICT_FALSE (vm->cpu_id != clib_get_current_cpu_id ()))
+ {
+ vm->cpu_id = clib_get_current_cpu_id ();
+ vm->numa_node = clib_get_current_numa_node ();
+ }
+
return 0;
}
diff --git a/src/vlib/unix/main.c b/src/vlib/unix/main.c
index ae92d93adc2..08f0506fbc2 100755
--- a/src/vlib/unix/main.c
+++ b/src/vlib/unix/main.c
@@ -671,7 +671,6 @@ vlib_unix_main (int argc, char *argv[])
__os_thread_index = 0;
vm->thread_index = 0;
- vm->cpu_id = ~0;
i = clib_calljmp (thread0, (uword) vm,
(void *) (vlib_thread_stacks[0] +