On Fri, 2016-11-18 at 18:57 -0800, Jakub Kicinski wrote: > On Fri, 18 Nov 2016 18:43:55 -0800, John Fastabend wrote: > > On 16-11-18 06:10 PM, Jakub Kicinski wrote: > > > On Fri, 18 Nov 2016 13:09:53 -0800, Jakub Kicinski wrote: > > >> Looks very cool! :) > > >> > > >> On Fri, 18 Nov 2016 11:00:41 -0800, John Fastabend wrote: > > [...] > > >> > > >> Is num_online_cpus() correct here? > > > > > > Sorry, I don't know the virto_net code, so I'm probably wrong. I was > > > concerned whether the number of cpus can change but also that the cpu > > > mask may be sparse and therefore offsetting by smp_processor_id() > > > into the queue table below could bring trouble. > > > > > > > Seem like a valid concerns to me how about num_possible_cpus() instead. > > That would solve problem 1, but could cpu_possible_mask still be sparse > on strange setups? Let me try to dig into this, I recall someone > (Eric?) was fixing similar problems some time ago.
nr_cpu_ids is probably what you want ;)