Skip to contentSkip to conversation

conntrack-acct patch

DISCUSSION Patrick McHardy 2 participants 2 messages Jul 23, 2004 netfilter

lore
Share & tools
lore
#0 lore raw

Hi Harald,

I have a question about the conntrack-acct patch. Why is accounting done with timer refreshing ? Is it just because the function already takes ip_conntrack_lock ? I think accounting should be done in the core after the conntrack protocol accepted the packet, instead of adding side-effects to ip_ct_refresh, which might even need some no-account flag one day for things like ctnetlink.

Regards
Patrick

#1 lore raw
Quoted 1 line · Patrick McHardy

Hi Harald,

Hi Patrick!

Quoted 3 lines

I have a question about the conntrack-acct patch. Why is accounting done with timer refreshing ? Is it just because the function already takes ip_conntrack_lock ?

Yes, exactly... this is the reason. ip_ct_refresh() was the only place where we always grabbed a writelock.

Quoted 4 lines

I think accounting should be done in the core after the conntrack protocol accepted the packet, instead of adding side-effects to ip_ct_refresh, which might even need some no-account flag one day for things like ctnetlink.

It already has a no-account parameter (as used by the amanda helper).

I know the API sucks, but I didn't want to introduce yet another lock/unlock cycle into this very performance-relevant path.

Quoted 2 lines

Regards
Patrick

Signature · 5 lines
- Harald Welte <[email protected]>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie