* [NETFILTER] NAT sequence adjustment: Save eight bytes per conntrack
@ 2006-01-30 23:22 Harald Welte
2006-01-30 23:50 ` David S. Miller
2006-01-31 8:50 ` Balazs Scheidler
0 siblings, 2 replies; 4+ messages in thread
From: Harald Welte @ 2006-01-30 23:22 UTC (permalink / raw)
To: David Miller; +Cc: Linux Netdev List, Netfilter Development Mailinglist
[-- Attachment #1: Type: text/plain, Size: 1781 bytes --]
Hi Dave!
Please apply this humble little step towards ip_conntrack shrinking,
thanks!
[NETFILTER] NAT sequence adjustment: Save eight bytes per conntrack
This patch reduces the size of 'struct ip_conntrack' on systems with NAT
by eight bytes. The sequence number delta values can be int16_t, since
we only support one sequence number modification per window anyway, and
one such modification is not going to exceed 32kB ;)
Signed-off-by: Harald Welte <laforge@netfilter.org>
---
commit 94d3d40c84672b74e59ea5252f61602610e1513e
tree 63e5ae5174af9f982be6d8d1bbe11e750e4ace32
parent e3c7a1f99300fbd6de35a40fcd9c4dc1b0fbfee2
author Harald Welte <laforge@netfilter.org> Fri, 27 Jan 2006 16:03:45 +0100
committer Harald Welte <laforge@netfilter.org> Fri, 27 Jan 2006 16:03:45 +0100
include/linux/netfilter_ipv4/ip_nat.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h
index 41a107d..e9f5ed1 100644
--- a/include/linux/netfilter_ipv4/ip_nat.h
+++ b/include/linux/netfilter_ipv4/ip_nat.h
@@ -23,7 +23,7 @@ struct ip_nat_seq {
* modification (if any) */
u_int32_t correction_pos;
/* sequence number offset before and after last modification */
- int32_t offset_before, offset_after;
+ int16_t offset_before, offset_after;
};
/* Single range specification. */
--
- Harald Welte <laforge@netfilter.org> http://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
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [NETFILTER] NAT sequence adjustment: Save eight bytes per conntrack
2006-01-30 23:22 [NETFILTER] NAT sequence adjustment: Save eight bytes per conntrack Harald Welte
@ 2006-01-30 23:50 ` David S. Miller
2006-01-31 8:50 ` Balazs Scheidler
1 sibling, 0 replies; 4+ messages in thread
From: David S. Miller @ 2006-01-30 23:50 UTC (permalink / raw)
To: laforge; +Cc: netdev, netfilter-devel
From: Harald Welte <laforge@netfilter.org>
Date: Tue, 31 Jan 2006 00:22:09 +0100
> [NETFILTER] NAT sequence adjustment: Save eight bytes per conntrack
>
> This patch reduces the size of 'struct ip_conntrack' on systems with NAT
> by eight bytes. The sequence number delta values can be int16_t, since
> we only support one sequence number modification per window anyway, and
> one such modification is not going to exceed 32kB ;)
>
> Signed-off-by: Harald Welte <laforge@netfilter.org>
Applied to net-2.6.17, thanks Harald.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [NETFILTER] NAT sequence adjustment: Save eight bytes per conntrack
2006-01-30 23:22 [NETFILTER] NAT sequence adjustment: Save eight bytes per conntrack Harald Welte
2006-01-30 23:50 ` David S. Miller
@ 2006-01-31 8:50 ` Balazs Scheidler
2006-01-31 9:26 ` Harald Welte
1 sibling, 1 reply; 4+ messages in thread
From: Balazs Scheidler @ 2006-01-31 8:50 UTC (permalink / raw)
To: Harald Welte; +Cc: Linux Netdev List, Netfilter Development Mailinglist
On Tue, 2006-01-31 at 00:22 +0100, Harald Welte wrote:
> ---
> commit 94d3d40c84672b74e59ea5252f61602610e1513e
> tree 63e5ae5174af9f982be6d8d1bbe11e750e4ace32
> parent e3c7a1f99300fbd6de35a40fcd9c4dc1b0fbfee2
> author Harald Welte <laforge@netfilter.org> Fri, 27 Jan 2006 16:03:45 +0100
> committer Harald Welte <laforge@netfilter.org> Fri, 27 Jan 2006 16:03:45 +0100
>
> include/linux/netfilter_ipv4/ip_nat.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h
> index 41a107d..e9f5ed1 100644
> --- a/include/linux/netfilter_ipv4/ip_nat.h
> +++ b/include/linux/netfilter_ipv4/ip_nat.h
> @@ -23,7 +23,7 @@ struct ip_nat_seq {
> * modification (if any) */
> u_int32_t correction_pos;
> /* sequence number offset before and after last modification */
> - int32_t offset_before, offset_after;
> + int16_t offset_before, offset_after;
> };
Am I missing something or is it only 4 bytes?
--
Bazsi
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [NETFILTER] NAT sequence adjustment: Save eight bytes per conntrack
2006-01-31 8:50 ` Balazs Scheidler
@ 2006-01-31 9:26 ` Harald Welte
0 siblings, 0 replies; 4+ messages in thread
From: Harald Welte @ 2006-01-31 9:26 UTC (permalink / raw)
To: Balazs Scheidler; +Cc: Linux Netdev List, Netfilter Development Mailinglist
[-- Attachment #1: Type: text/plain, Size: 759 bytes --]
On Tue, Jan 31, 2006 at 09:50:52AM +0100, Balazs Scheidler wrote:
> > - int32_t offset_before, offset_after;
> > + int16_t offset_before, offset_after;
>
> Am I missing something or is it only 4 bytes?
I knew someone would ask that question ;)
we have that structure as part of an IP_CT_DIR_MAX array, therefore it's
twice in every conntrack, and thus we save 8 bytes ;)
--
- Harald Welte <laforge@netfilter.org> http://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
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-01-31 9:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-30 23:22 [NETFILTER] NAT sequence adjustment: Save eight bytes per conntrack Harald Welte
2006-01-30 23:50 ` David S. Miller
2006-01-31 8:50 ` Balazs Scheidler
2006-01-31 9:26 ` Harald Welte
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox