Uploaded image for project: 'vpp'
  1. vpp
  2. VPP-1435

Incorrect use of os_get_nthreads()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • 18.10
    • None
    • IP
    • None

      os_get_nthreads() return the total number of threads. Not the number of workers.

      E.g. the stats thread is not a worker thread.

      This crashes if new thread is added with VLIB_REGISTER_THREAD()      

       

      uword thread_index = 0;

            int index;

            const uword nthreads = os_get_nthreads ();

            u32 *vec_icmp_bi = NULL;

            for (thread_index = 0; thread_index < nthreads; ++thread_index)

              {

                ip6_reass_per_thread_t *rt = &rm->per_thread_data[thread_index];

                clib_spinlock_lock (&rt->lock);

            jsloboda Juraj Sloboda
            otroan Ole Trøan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: