integrated
[ipfw.git] / dummynet2 / include / sys / systm.h
index db8ef7a..e98335e 100644 (file)
 #endif
 #define callout timer_list
 static __inline int
 #endif
 #define callout timer_list
 static __inline int
-callout_reset(struct callout *co, int ticks, void (*fn)(void *), void *arg)
+callout_reset_on(struct callout *co, int ticks, void (*fn)(void *), void *arg, int cpu)
 {
         co->expires = jiffies + ticks;
         co->function = (void (*)(unsigned long))fn;
         co->data = (unsigned long)arg;
 {
         co->expires = jiffies + ticks;
         co->function = (void (*)(unsigned long))fn;
         co->data = (unsigned long)arg;
+       /*
+        * Linux 2.6.31 and above has add_timer_on(co, cpu),
+        * otherwise add_timer() always schedules a callout on the same
+        * CPU used the first time, so we don't need more.
+        */
         add_timer(co);
         return 0;
 }
         add_timer(co);
         return 0;
 }
@@ -71,14 +76,14 @@ VOID ipfw_dpc(
  * timer is called only once a sec, this won't hurt that much.
  */
 static __inline int
  * timer is called only once a sec, this won't hurt that much.
  */
 static __inline int
-callout_reset(struct callout *co, int ticks, void (*fn)(void *), void *arg
+callout_reset_on(struct callout *co, int ticks, void (*fn)(void *), void *arg, int cpu
 {
        if(fn == &dummynet)
        {
                if(co->dpcinitialized == 0)
                {
                        KeInitializeDpc(&co->timerdpc, dummynet_dpc, NULL);
 {
        if(fn == &dummynet)
        {
                if(co->dpcinitialized == 0)
                {
                        KeInitializeDpc(&co->timerdpc, dummynet_dpc, NULL);
-                       KeSetTargetProcessorDpc(&co->timerdpc, 0);
+                       KeSetTargetProcessorDpc(&co->timerdpc, cpu);
                        co->dpcinitialized = 1;
                }
        }
                        co->dpcinitialized = 1;
                }
        }