]> git.baikalelectronics.ru Git - kernel.git/commit
ipvs: properly zero stats and rates
authorJulian Anastasov <ja@ssi.bg>
Sun, 13 Mar 2011 23:37:49 +0000 (01:37 +0200)
committerSimon Horman <horms@verge.net.au>
Tue, 15 Mar 2011 00:36:52 +0000 (09:36 +0900)
commit2803c65841a6ace93f71b4557a630d53f4c93dcd
treed1f1c52c77c04b717ca1a26bc7a0e90adb0498df
parent8ce74443d50ddca72c9da23af380df42ecc04bb4
ipvs: properly zero stats and rates

  Currently, the new percpu counters are not zeroed and
the zero commands do not work as expected, we still show the old
sum of percpu values. OTOH, we can not reset the percpu counters
from user context without causing the incrementing to use old
and bogus values.

  So, as Eric Dumazet suggested fix that by moving all overhead
to stats reading in user context. Do not introduce overhead in
timer context (estimator) and incrementing (packet handling in
softirqs).

  The new ustats0 field holds the zero point for all
counter values, the rates always use 0 as base value as before.
When showing the values to user space just give the difference
between counters and the base values. The only drawback is that
percpu stats are not zeroed, they are accessible only from /proc
and are new interface, so it should not be a compatibility problem
as long as the sum stats are correct after zeroing.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
include/net/ip_vs.h
net/netfilter/ipvs/ip_vs_ctl.c
net/netfilter/ipvs/ip_vs_est.c