Implement sack based tcp loss recovery (RFC 6675)
[vpp.git] / src / vlib / threads.c
index 9ccfd3a..0c775e2 100644 (file)
@@ -35,16 +35,8 @@ vl (void *p)
 vlib_worker_thread_t *vlib_worker_threads;
 vlib_thread_main_t vlib_thread_main;
 
-__thread uword vlib_thread_index = 0;
-
-uword
-os_get_cpu_number (void)
-{
-  return vlib_thread_index;
-}
-
 uword
-os_get_ncpus (void)
+os_get_nthreads (void)
 {
   u32 len;
 
@@ -467,7 +459,7 @@ vlib_worker_thread_bootstrap_fn (void *arg)
   w->lwp = syscall (SYS_gettid);
   w->thread_id = pthread_self ();
 
-  vlib_thread_index = w - vlib_worker_threads;
+  __os_thread_index = w - vlib_worker_threads;
 
   rv = (void *) clib_calljmp
     ((uword (*)(uword)) w->thread_function,
@@ -678,7 +670,7 @@ start_workers (vlib_main_t * vm)
 
              /* zap the (per worker) frame freelists, etc */
              nm_clone->frame_sizes = 0;
-             nm_clone->frame_size_hash = 0;
+             nm_clone->frame_size_hash = hash_create (0, sizeof (uword));
 
              /* Packet trace buffers are guaranteed to be empty, nothing to do here */