@@ -373,17 +373,15 @@ static inline int mask2bits(__be32 mask) {
373
373
static DEFINE_MUTEX (worker_lock );
374
374
375
375
static int worker_delay = HZ / 10 ;
376
- static inline void _schedule_scan_worker (const int status )
376
+ static inline void _schedule_scan_worker (const int pdus )
377
377
{
378
378
int cpu = exportcpu ;
379
379
380
380
/* rudimentary congestion avoidance */
381
- if (status > 0 )
382
- worker_delay -= status ;
383
- else if (status < 0 )
384
- worker_delay /= 2 ;
381
+ if (pdus > 0 )
382
+ worker_delay /= pdus ;
385
383
else
386
- worker_delay ++ ;
384
+ worker_delay *= 2 ;
387
385
388
386
if (worker_delay < scan_min )
389
387
worker_delay = scan_min ;
@@ -3795,7 +3793,7 @@ static inline int active_needs_export(const struct ipt_netflow *nf, const long a
3795
3793
3796
3794
/* could be called with zero to flush cache and pdu */
3797
3795
/* this function is guaranteed to be called non-concurrently */
3798
- /* return -1 is trylockfailed, 0 if nothin gexported, >=1 if exported something */
3796
+ /* return number of pdus sent */
3799
3797
static int netflow_scan_and_export (const int flush )
3800
3798
{
3801
3799
long i_timeout = inactive_timeout * HZ ;
@@ -3929,15 +3927,15 @@ static void netflow_work_fn(void *dummy)
3929
3927
static void netflow_work_fn (struct work_struct * dummy )
3930
3928
#endif
3931
3929
{
3932
- int status ;
3930
+ int pdus ;
3933
3931
3934
3932
wk_count = 0 ;
3935
3933
wk_trylock = 0 ;
3936
3934
wk_llist = 0 ;
3937
3935
wk_cpu = smp_processor_id ();
3938
3936
wk_start = jiffies ;
3939
- status = netflow_scan_and_export (DONT_FLUSH );
3940
- _schedule_scan_worker (status );
3937
+ pdus = netflow_scan_and_export (DONT_FLUSH );
3938
+ _schedule_scan_worker (pdus );
3941
3939
wk_busy = jiffies - wk_start ;
3942
3940
}
3943
3941
0 commit comments