All of lore.kernel.org
 help / color / mirror / Atom feed
* num_possible_cpus() usage in iptables
@ 2005-10-10  3:47 David S. Miller
  2005-10-10  6:23 ` Eric Dumazet
  2005-10-10  8:19 ` Harald Welte
  0 siblings, 2 replies; 7+ messages in thread
From: David S. Miller @ 2005-10-10  3:47 UTC (permalink / raw)
  To: netfilter-devel; +Cc: laforge, kaber


Guys, you can't use this interface like that.

It's a _COUNT_ of the number of possible processors, not the number of
the higest PHYSICAL cpu index.

So you can have cpu's numbered "0" and "2", but num_possible_cpus()
will return 2.  This is not just theoretical, Ultra60 sparc64 systems
have this exact physical cpu numbering.   And as a result, when the
changes went into iptables to use num_possible_cpus() instead of NR_CPUS
it broke iptables.  It OOPS's when you load the module, in fact.

So, on such a system, this loop:

	/* And one copy for every other CPU */
	for (i = 1; i < num_possible_cpus(); i++) {
		memcpy(newinfo->entries + SMP_ALIGN(newinfo->size)*i,
		       newinfo->entries,
		       SMP_ALIGN(newinfo->size));
	}

would initialize the wrong entries.

We need to fix this.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-10-11 20:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-10  3:47 num_possible_cpus() usage in iptables David S. Miller
2005-10-10  6:23 ` Eric Dumazet
2005-10-11  0:27   ` David S. Miller
2005-10-11 14:35     ` Harald Welte
2005-10-11 20:00       ` David S. Miller
2005-10-10  8:19 ` Harald Welte
2005-10-10  8:52   ` seb

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.