#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;
+ /*
+ * 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;
}
* 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);
- KeSetTargetProcessorDpc(&co->timerdpc, 0);
+ KeSetTargetProcessorDpc(&co->timerdpc, cpu);
co->dpcinitialized = 1;
}
}