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

Cyrill Gorcunov gorcunov at virtuozzo.com
Mon Jul 20 06:42:48 PDT 2015


On Mon, Jul 20, 2015 at 04:29:19PM +0300, Vladimir Davydov wrote:
> 
> 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.

Oh, what a mess :/

> 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?

Yes I believe: the stat destruction happens on module exit, where
all netfilter hoos are already unregistered so we can't access these
members from inside of netfilter code.

> 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?

I considered it but thought using hooks gonna be easier. Letme switch
to pernet operations and see how it goes (I've addressed Andrew's
comments in my new patch, so if pernet won't look better I send out
my current updated hook based version).



More information about the Devel mailing list