@@ -175,6 +175,10 @@ static int active_timeout = 30 * 60;
175175module_param (active_timeout , int , 0644 );
176176MODULE_PARM_DESC (active_timeout , "active flows timeout in seconds" );
177177
178+ static int exportcpu = -1 ;
179+ module_param (exportcpu , int , 0644 );
180+ MODULE_PARM_DESC (exportcpu , "lock exporter to this cpu" );
181+
178182static int debug = 0 ;
179183module_param (debug , int , 0644 );
180184MODULE_PARM_DESC (debug , "debug verbosity level" );
@@ -185,7 +189,7 @@ MODULE_PARM_DESC(sndbuf, "udp socket SNDBUF size");
185189
186190static int protocol = 5 ;
187191module_param (protocol , int , 0444 );
188- MODULE_PARM_DESC (protocol , "netflow protocol version (5, 9, 10)" );
192+ MODULE_PARM_DESC (protocol , "netflow protocol version (5, 9, 10=IPFIX )" );
189193
190194static unsigned int refresh_rate = 20 ;
191195module_param (refresh_rate , uint , 0644 );
@@ -213,7 +217,7 @@ static DEFINE_SPINLOCK(snmp_lock);
213217#ifdef CONFIG_NF_NAT_NEEDED
214218static int natevents = 0 ;
215219module_param (natevents , int , 0444 );
216- MODULE_PARM_DESC (natevents , "send NAT Events" );
220+ MODULE_PARM_DESC (natevents , "enable NAT Events" );
217221#endif
218222
219223static int hashsize ;
@@ -358,6 +362,8 @@ static DEFINE_MUTEX(worker_lock);
358362static int worker_delay = HZ / 10 ;
359363static inline void _schedule_scan_worker (const int status )
360364{
365+ int cpu = exportcpu ;
366+
361367 /* rudimentary congestion avoidance */
362368 if (status > 0 )
363369 worker_delay -= status ;
@@ -370,6 +376,17 @@ static inline void _schedule_scan_worker(const int status)
370376 worker_delay = scan_min ;
371377 else if (worker_delay > scan_max )
372378 worker_delay = scan_max ;
379+
380+ if (cpu >= 0 ) {
381+ if (cpu < NR_CPUS &&
382+ cpu_online (cpu )) {
383+ schedule_delayed_work_on (cpu , & netflow_work , worker_delay );
384+ return ;
385+ }
386+ printk (KERN_WARNING "ipt_NETFLOW: can't schedule exporter on cpu %d. Disabling cpu lock.\n" ,
387+ cpu );
388+ exportcpu = -1 ;
389+ }
373390 schedule_delayed_work (& netflow_work , worker_delay );
374391}
375392
0 commit comments