udp: It only runs in the first netisr_ncpus netisrs.
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 3 Aug 2017 07:47:52 +0000 (15:47 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 3 Aug 2017 07:47:52 +0000 (15:47 +0800)
sys/netinet/udp_usrreq.c

index 48f6e05..fe0e700 100644 (file)
@@ -235,7 +235,7 @@ udp_init(void)
        /*
         * Initialize UDP statistics counters for each CPU.
         */
-       for (cpu = 0; cpu < ncpus; ++cpu)
+       for (cpu = 0; cpu < netisr_ncpus; ++cpu)
                bzero(&udpstat_percpu[cpu], sizeof(struct udpstat));
 }
 
@@ -244,7 +244,7 @@ sysctl_udpstat(SYSCTL_HANDLER_ARGS)
 {
        int cpu, error = 0;
 
-       for (cpu = 0; cpu < ncpus; ++cpu) {
+       for (cpu = 0; cpu < netisr_ncpus; ++cpu) {
                if ((error = SYSCTL_OUT(req, &udpstat_percpu[cpu],
                                        sizeof(struct udpstat))))
                        break;