All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/10] updates for ctnetlink and conntrack core
@ 2006-07-07  2:11 Pablo Neira Ayuso
  2006-07-07  5:13 ` Patrick McHardy
  0 siblings, 1 reply; 8+ messages in thread
From: Pablo Neira Ayuso @ 2006-07-07  2:11 UTC (permalink / raw)
  To: Netfilter Development Mailinglist; +Cc: Harald Welte, Patrick McHardy

Hi,

Here follows a set of patches for ctnetlink and the conntrack core API.

Basically, at the time that I was working on the ctnetlink patches, I 
tried to keep in mind the idea of reducing the netlink bandwidth 
consumption following the principle of just dumping meaningful fields 
depending on the type of event.

Please let me know what you think. Thanks!

cheers,
	Pablo

-- 
The dawn of the fourth age of Linux firewalling is coming; a time of 
great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/10] updates for ctnetlink and conntrack core
  2006-07-07  2:11 [PATCH 0/10] updates for ctnetlink and conntrack core Pablo Neira Ayuso
@ 2006-07-07  5:13 ` Patrick McHardy
  2006-07-07  5:58   ` Patrick McHardy
  0 siblings, 1 reply; 8+ messages in thread
From: Patrick McHardy @ 2006-07-07  5:13 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Harald Welte, Netfilter Development Mailinglist

Pablo Neira Ayuso wrote:
> Hi,
> 
> Here follows a set of patches for ctnetlink and the conntrack core API.

I'm perfectly fine with 1, 2, and 9. Still need to look at 10 in
more detail, 3 - 5 need a bit more work. As for 6 - 8, see below.

> Basically, at the time that I was working on the ctnetlink patches, I
> tried to keep in mind the idea of reducing the netlink bandwidth
> consumption following the principle of just dumping meaningful fields
> depending on the type of event.
> 
> Please let me know what you think. Thanks!

I think this is something we need to agree on in principle. I'm
not convinced that we really do save much bandwidth in the
common case, and that its worth diverging from the usual update
notifications containing full updates sent by the remaining
network stack (besides unset fields or fields containing 0).

I'll see if I can get some numbers of the actual differences
without too much effort.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/10] updates for ctnetlink and conntrack core
  2006-07-07  5:13 ` Patrick McHardy
@ 2006-07-07  5:58   ` Patrick McHardy
  2006-07-07  6:20     ` Patrick McHardy
  0 siblings, 1 reply; 8+ messages in thread
From: Patrick McHardy @ 2006-07-07  5:58 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Harald Welte, Netfilter Development Mailinglist

Patrick McHardy wrote:
> Pablo Neira Ayuso wrote:
> 
>>Basically, at the time that I was working on the ctnetlink patches, I
>>tried to keep in mind the idea of reducing the netlink bandwidth
>>consumption following the principle of just dumping meaningful fields
>>depending on the type of event.
>>
> I think this is something we need to agree on in principle. I'm
> not convinced that we really do save much bandwidth in the
> common case, and that its worth diverging from the usual update
> notifications containing full updates sent by the remaining
> network stack (besides unset fields or fields containing 0).
> 
> I'll see if I can get some numbers of the actual differences
> without too much effort.

In some very unscientific tests it showed a difference of about
4% when dumping everything compared to only diffs (measured
with conntrack accounting enabled). Not something to easily
throw away, but I bet we can easily increase the netlink bandwidth
for ctnetlink by using more reasonable allocation size and
avoiding the netlink_trim call for every single packet.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/10] updates for ctnetlink and conntrack core
  2006-07-07  5:58   ` Patrick McHardy
@ 2006-07-07  6:20     ` Patrick McHardy
  2006-07-07 13:46       ` Pablo Neira Ayuso
  0 siblings, 1 reply; 8+ messages in thread
From: Patrick McHardy @ 2006-07-07  6:20 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Harald Welte, Netfilter Development Mailinglist

Patrick McHardy wrote:
> In some very unscientific tests it showed a difference of about
> 4% when dumping everything compared to only diffs (measured
> with conntrack accounting enabled). Not something to easily
> throw away, but I bet we can easily increase the netlink bandwidth
> for ctnetlink by using more reasonable allocation size and
> avoiding the netlink_trim call for every single packet.

Some more unscientific tests: saving the netlink_trim call by using
an allocation size of 200 reduces overhead for the entire notification
function (including broadcasting) by about 13% (and also reduces
the overruns experienced by conntrack -E for ~390000 packets with
65536 new connections from 17 to 7, which I don't really understand
since it shouldn't save any netlink bandwidth and this is a SMP system).

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/10] updates for ctnetlink and conntrack core
  2006-07-07  6:20     ` Patrick McHardy
@ 2006-07-07 13:46       ` Pablo Neira Ayuso
  2006-07-10  4:42         ` Patrick McHardy
  0 siblings, 1 reply; 8+ messages in thread
From: Pablo Neira Ayuso @ 2006-07-07 13:46 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: Harald Welte, Netfilter Development Mailinglist

Patrick McHardy wrote:
> Patrick McHardy wrote:
> 
>>In some very unscientific tests it showed a difference of about
>>4% when dumping everything compared to only diffs (measured
>>with conntrack accounting enabled). Not something to easily
>>throw away, but I bet we can easily increase the netlink bandwidth
>>for ctnetlink by using more reasonable allocation size and
>>avoiding the netlink_trim call for every single packet..

4% is not too much but it is something, anyway it is true that my 
argument of bandwidth consumption is weak.

But I still like patch 8, if the event cache works fine, I can't see why 
we should force the dumping of all fields. BTW, patch 7 is a new feature 
that I think that we need.

> Some more unscientific tests: saving the netlink_trim call by using
> an allocation size of 200 reduces overhead for the entire notification
> function (including broadcasting) by about 13% (and also reduces
> the overruns experienced by conntrack -E for ~390000 packets with
> 65536 new connections from 17 to 7, which I don't really understand
> since it shouldn't save any netlink bandwidth and this is a SMP system).

Who ever said that benchmarking can be scientific? :) I usually have to 
redo my tests several times. These results are interesting but, in 
previous discussions, I thought that we could not change current 
allocation size because of memory fragmentation issues?

-- 
The dawn of the fourth age of Linux firewalling is coming; a time of 
great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/10] updates for ctnetlink and conntrack core
  2006-07-07 13:46       ` Pablo Neira Ayuso
@ 2006-07-10  4:42         ` Patrick McHardy
  2006-07-13 20:01           ` Pablo Neira Ayuso
  0 siblings, 1 reply; 8+ messages in thread
From: Patrick McHardy @ 2006-07-10  4:42 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Harald Welte, Netfilter Development Mailinglist

Pablo Neira Ayuso wrote:
> Patrick McHardy wrote:
> 
>> Patrick McHardy wrote:
>>
>>> [...]
> 
> 4% is not too much but it is something, anyway it is true that my
> argument of bandwidth consumption is weak.
> 
> But I still like patch 8, if the event cache works fine, I can't see why
> we should force the dumping of all fields. BTW, patch 7 is a new feature
> that I think that we need.

Patch 7 is something we definitely want. For patch 8 we need to come
to a conclusion on how ctnetlink should work first, I prefer to keep
it similar to other network netlink protocols and have it send full
update notifications, containing the entire current state. I also
fail to see the difference it makes, of the four things that are
dumped conditionally (status, refresh, protoinfo, helpinfo) the
first three are always set for new conntracks. The last one only
if we have a helper, but if we don't nothing is dumped anyway.

>> Some more unscientific tests: saving the netlink_trim call by using
>> an allocation size of 200 reduces overhead for the entire notification
>> function (including broadcasting) by about 13% (and also reduces
>> the overruns experienced by conntrack -E for ~390000 packets with
>> 65536 new connections from 17 to 7, which I don't really understand
>> since it shouldn't save any netlink bandwidth and this is a SMP system).
> 
> 
> Who ever said that benchmarking can be scientific? :) I usually have to
> redo my tests several times. These results are interesting but, in
> previous discussions, I thought that we could not change current
> allocation size because of memory fragmentation issues?

I _decreased_ the size, the messages sent are about 150-200 bytes, yet
we're allocating an entire page, which makes netlink clone the skb
and shrink it to its actual size. We should just to it right ourselves.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/10] updates for ctnetlink and conntrack core
  2006-07-10  4:42         ` Patrick McHardy
@ 2006-07-13 20:01           ` Pablo Neira Ayuso
  2006-07-19 16:39             ` Patrick McHardy
  0 siblings, 1 reply; 8+ messages in thread
From: Pablo Neira Ayuso @ 2006-07-13 20:01 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: Harald Welte, Netfilter Development Mailinglist

Patrick McHardy wrote:
> Pablo Neira Ayuso wrote:
> 
>>Patrick McHardy wrote:
>>
>>
>>>Patrick McHardy wrote:
>>>
>>>
>>>>[...]
>>
>>4% is not too much but it is something, anyway it is true that my
>>argument of bandwidth consumption is weak.
>>
>>But I still like patch 8, if the event cache works fine, I can't see why
>>we should force the dumping of all fields. BTW, patch 7 is a new feature
>>that I think that we need.
> 
> 
> Patch 7 is something we definitely want. For patch 8 we need to come
> to a conclusion on how ctnetlink should work first, I prefer to keep
> it similar to other network netlink protocols and have it send full
> update notifications, containing the entire current state.

If other network netlink protocols behave like that, I agree that we 
should send full update notifications, I like this argument. The only 
thing that annoys me is the limited netlink throughput, sending more 
data means that on stress situations an overflow could comes before.

> I also fail to see the difference it makes, of the four things that are
> dumped conditionally (status, refresh, protoinfo, helpinfo) the
> first three are always set for new conntracks. The last one only
> if we have a helper, but if we don't nothing is dumped anyway.

So, to keep consistency with other netlink subsystem, I can remake my 
patch based on this assumptions:

- NEW events dump everything but values that are unset like counters, 
mark, ...
- UPDATE events dump everything but unset fields and the counters, they 
don't provide very useful information AFAICS.
- DESTROY, dump everything, counters included.

Please let me know what you think.

>>>Some more unscientific tests: saving the netlink_trim call by using
>>>an allocation size of 200 reduces overhead for the entire notification
>>>function (including broadcasting) by about 13% (and also reduces
>>>the overruns experienced by conntrack -E for ~390000 packets with
>>>65536 new connections from 17 to 7, which I don't really understand
>>>since it shouldn't save any netlink bandwidth and this is a SMP system).
>>
>>
>>Who ever said that benchmarking can be scientific? :) I usually have to
>>redo my tests several times. These results are interesting but, in
>>previous discussions, I thought that we could not change current
>>allocation size because of memory fragmentation issues?
> 
> 
> I _decreased_ the size, the messages sent are about 150-200 bytes, yet
> we're allocating an entire page, which makes netlink clone the skb
> and shrink it to its actual size. We should just to it right ourselves.

OK, I see, sorry I misunderstood.

-- 
The dawn of the fourth age of Linux firewalling is coming; a time of 
great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/10] updates for ctnetlink and conntrack core
  2006-07-13 20:01           ` Pablo Neira Ayuso
@ 2006-07-19 16:39             ` Patrick McHardy
  0 siblings, 0 replies; 8+ messages in thread
From: Patrick McHardy @ 2006-07-19 16:39 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Harald Welte, Netfilter Development Mailinglist

Pablo Neira Ayuso wrote:
> So, to keep consistency with other netlink subsystem, I can remake my
> patch based on this assumptions:
> 
> - NEW events dump everything but values that are unset like counters,
> mark, ...
> - UPDATE events dump everything but unset fields and the counters, they
> don't provide very useful information AFAICS.
> - DESTROY, dump everything, counters included.
> 
> Please let me know what you think.

That sounds good, but I don't think DESTROY needs to dump more than
NEW or UPDATE.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-07-19 16:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-07  2:11 [PATCH 0/10] updates for ctnetlink and conntrack core Pablo Neira Ayuso
2006-07-07  5:13 ` Patrick McHardy
2006-07-07  5:58   ` Patrick McHardy
2006-07-07  6:20     ` Patrick McHardy
2006-07-07 13:46       ` Pablo Neira Ayuso
2006-07-10  4:42         ` Patrick McHardy
2006-07-13 20:01           ` Pablo Neira Ayuso
2006-07-19 16:39             ` Patrick McHardy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.