route: Routing table is replicated to all CPUs, not # of CPUs on power of 2
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 23 Aug 2012 03:04:19 +0000 (11:04 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 23 Aug 2012 03:08:24 +0000 (11:08 +0800)
DragonFly-bug: http://bugs.dragonflybsd.org/issues/2355

sys/net/if.c
sys/netinet/in_rmx.c

index cc830a9..f02d2fc 100644 (file)
@@ -746,7 +746,7 @@ if_detach(struct ifnet *ifp)
         * to this interface...oh well...
         */
        origcpu = mycpuid;
         * to this interface...oh well...
         */
        origcpu = mycpuid;
-       for (cpu = 0; cpu < ncpus2; cpu++) {
+       for (cpu = 0; cpu < ncpus; cpu++) {
                lwkt_migratecpu(cpu);
                for (i = 1; i <= AF_MAX; i++) {
                        if ((rnh = rt_tables[cpu][i]) == NULL)
                lwkt_migratecpu(cpu);
                for (i = 1; i <= AF_MAX; i++) {
                        if ((rnh = rt_tables[cpu][i]) == NULL)
index 635a4dc..c3edc01 100644 (file)
@@ -444,7 +444,7 @@ in_ifadown(struct ifaddr *ifa, int delete)
         * doing this the inconsistancy could trigger a panic.
         */
        origcpu = mycpuid;
         * doing this the inconsistancy could trigger a panic.
         */
        origcpu = mycpuid;
-       for (cpu = 0; cpu < ncpus2; cpu++) {
+       for (cpu = 0; cpu < ncpus; cpu++) {
                lwkt_migratecpu(cpu);
 
                arg.rnh = rnh = rt_tables[cpu][AF_INET];
                lwkt_migratecpu(cpu);
 
                arg.rnh = rnh = rt_tables[cpu][AF_INET];