[Devel] [RFC rh7 v2] ve/vznetstat: Move VE networks statistics allocation into a commaon place

Vladimir Davydov vdavydov at parallels.com
Mon Jul 20 06:29:19 PDT 2015


On Mon, Jul 20, 2015 at 11:47:46AM +0300, Cyrill Gorcunov wrote:
> We have three modules serving network statictics:
> 
>  - vznetstat.ko
>  - ip_vznetstat.ko
>  - ip6_vznetstat.ko
> 
> where ip6_vznetstat depends on ip_vznetstat and both depends on general vznetstat
> module. While vznetstat does are real work on network packets counting the
> counters are allocated in somehow nontrivial way
> 
>  1) ip_vznetstat depends on ip6_vznetstat, and both require vznetstat module
>  2) when ip_vznetstat loads it walks over all existing VE and allocates counters
>     setting up a ve-startup hook to allocate counters for VE which will be
>     started after
>  3) in turn ip6_vznetstat module doesn't depend on ip_vznetstat (which does
>     a real counters allocations, in commit 3ad7b9565dc63734 we fixed
>     ip6_vznetstat so it allocates counters for newly created VEs if
>     former ip_vznetstat get unloaded, but this doesn't take existing
>     VEs into account)

Here's how it all evolved:

1) Initially, in PCS6 we used VE_SS_CHAIN init/fini hooks for
initializing venet stats from both ip4 and ip6.

2) Then it turned out that it is not safe to destroy stats on
VE_SS_CHAIN fini, so that VE_CLEANUP_CHAIN was introduced and venet
stats destruction was moved to it in case of ip4. See "[PATCH COMMIT]
diff-ve-hooks-introduce-ve_cleanup-chain" for more details.

3) During rebae to RH7 VE_CLEANUP_CHAIN was dropped and stats
destruction was moved to vzredir by commit "[PATCH 3.10.14 COMMIT]
vznetstat: don't use vehooks" (not a wise move if you ask me).

4) Finally vzredir was dropped and we finally got the mess we have now.

That said I've a couple of questions I'd like you to answer before I
start reviewing this patch:

1) Since your patch uses VE_SS_CHAIN fini for destroying the stats, it
can be affected to the issue fixed by #2 above. Is it or is it not?

2) IMO ve hooks infrastructure is a kind of legacy we'd better rid of.
Since there are only a few users of them this seems to be plausible. So
the question is did you consider using pernet_operations for destroying
venet stats instead of VE_SS_CHAIN?

Thanks,
Vladimir



More information about the Devel mailing list