@@ -175,6 +175,10 @@ static int active_timeout = 30 * 60;
175
175
module_param (active_timeout , int , 0644 );
176
176
MODULE_PARM_DESC (active_timeout , "active flows timeout in seconds" );
177
177
178
+ static int exportcpu = -1 ;
179
+ module_param (exportcpu , int , 0644 );
180
+ MODULE_PARM_DESC (exportcpu , "lock exporter to this cpu" );
181
+
178
182
static int debug = 0 ;
179
183
module_param (debug , int , 0644 );
180
184
MODULE_PARM_DESC (debug , "debug verbosity level" );
@@ -185,7 +189,7 @@ MODULE_PARM_DESC(sndbuf, "udp socket SNDBUF size");
185
189
186
190
static int protocol = 5 ;
187
191
module_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 )" );
189
193
190
194
static unsigned int refresh_rate = 20 ;
191
195
module_param (refresh_rate , uint , 0644 );
@@ -213,7 +217,7 @@ static DEFINE_SPINLOCK(snmp_lock);
213
217
#ifdef CONFIG_NF_NAT_NEEDED
214
218
static int natevents = 0 ;
215
219
module_param (natevents , int , 0444 );
216
- MODULE_PARM_DESC (natevents , "send NAT Events" );
220
+ MODULE_PARM_DESC (natevents , "enable NAT Events" );
217
221
#endif
218
222
219
223
static int hashsize ;
@@ -358,6 +362,8 @@ static DEFINE_MUTEX(worker_lock);
358
362
static int worker_delay = HZ / 10 ;
359
363
static inline void _schedule_scan_worker (const int status )
360
364
{
365
+ int cpu = exportcpu ;
366
+
361
367
/* rudimentary congestion avoidance */
362
368
if (status > 0 )
363
369
worker_delay -= status ;
@@ -370,6 +376,17 @@ static inline void _schedule_scan_worker(const int status)
370
376
worker_delay = scan_min ;
371
377
else if (worker_delay > scan_max )
372
378
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
+ }
373
390
schedule_delayed_work (& netflow_work , worker_delay );
374
391
}
375
392
0 commit comments