From: Balazs Scheidler <bazsi@balabit.hu>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: netfilter-devel@vger.kernel.org, tproxy@lists.balabit.hu,
Harry Mason <harry.mason@smoothwall.net>
Subject: Re: [PATCH 03/11] TProxy: reuse a 32bit hole in struct ipv6_pinfo
Date: Sun, 30 Aug 2009 08:56:01 +0200 [thread overview]
Message-ID: <1251615361.18025.32.camel@bzorp.balabit> (raw)
In-Reply-To: <alpine.LSU.2.00.0908291842320.25008@fbirervta.pbzchgretzou.qr>
On Sat, 2009-08-29 at 18:46 +0200, Jan Engelhardt wrote:
> On Sunday 2009-08-23 11:02, Balazs Scheidler wrote:
>
> >While looking for a place to add a new bitfield in ipv6_pinfo,
> >I've found a 32 bit hole (in 64 bit mode) at the beginning of the struct.
> >Since dst_cookie is used in the output fastpath, I've moved this field to
> >fill the hole, thus decreasing the struct size on 64 bit platforms by
> >4 bytes.
>
> Hm? I do not see a size reduction. pahole(1) tells me [for a base of
> v2.6.31-rc1-103-g644fc2c] the size is the same before and after.
you are right. I was inserting another bitfield and with that the size
didn't grow. at the end the bitfield wasn't needed, but I still felt
that dst_cookie should be moved to the first cacheline. it is used in
the output fastpath.
However since that's not necessarily worth in itself I can completely
drop this patch.
An updated version follows.
By the way, what should be the proper procedure for posting patches that
are tproxy specific but touch the core networking code? Should those go
through Patrick, or should I just post them to netdev? Or just
cross-post the patch series to both lists?
commit 5ddc846b926be02c6cab93406d6e8adb1e3c9124
Author: Balazs Scheidler <bazsi@balabit.hu>
Date: Sun Aug 30 08:52:01 2009 +0200
TProxy: move dst_cookie to the first cacheline in ipv6_pinfo
While looking for a place to add a new bitfield in ipv6_pinfo,
I've found a 32 bit hole (in 64 bit mode) at the beginning of the struct.
Since dst_cookie is used in the output fastpath, I've moved this field to
fill the hole. The original place of dst_cookie is now empty, but
can become a place to add further fields to the struct.
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index c662efa..be4c9c6 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -285,6 +285,7 @@ struct ipv6_pinfo {
struct in6_addr saddr;
struct in6_addr rcv_saddr;
struct in6_addr daddr;
+ __u32 dst_cookie;
struct in6_pktinfo sticky_pktinfo;
struct in6_addr *daddr_cache;
#ifdef CONFIG_IPV6_SUBTREES
@@ -348,7 +349,7 @@ struct ipv6_pinfo {
*/
__u8 tclass;
- __u32 dst_cookie;
+ /* 32 bits hole on 64 bit platforms */
struct ipv6_mc_socklist *ipv6_mc_list;
struct ipv6_ac_socklist *ipv6_ac_list;
>
>
> --- p.1 2009-08-29 18:45:37.996787299 +0200
> +++ p.2 2009-08-29 18:43:08.152753849 +0200
> @@ -21824,10 +21824,8 @@ struct ipv6_pinfo {
> struct in6_addr saddr; /* 0 16 */
> struct in6_addr rcv_saddr; /* 16 16 */
> struct in6_addr daddr; /* 32 16 */
> - struct in6_pktinfo sticky_pktinfo; /* 48 20 */
> -
> - /* XXX 4 bytes hole, try to pack */
> -
> + __u32 dst_cookie; /* 48 4 */
> + struct in6_pktinfo sticky_pktinfo; /* 52 20 */
> /* --- cacheline 1 boundary (64 bytes) was 8 bytes ago --- */
> struct in6_addr * daddr_cache; /* 72 8 */
> struct in6_addr * saddr_cache; /* 80 8 */
> @@ -21862,7 +21860,9 @@ struct ipv6_pinfo {
> __u8 ipv6only:1; /* 106: 3 1 */
> __u8 srcprefs:3; /* 106: 0 1 */
> __u8 tclass; /* 107 1 */
> - __u32 dst_cookie; /* 108 4 */
> +
> + /* XXX 4 bytes hole, try to pack */
> +
> struct ipv6_mc_socklist * ipv6_mc_list; /* 112 8 */
> struct ipv6_ac_socklist * ipv6_ac_list; /* 120 8 */
> /* --- cacheline 2 boundary (128 bytes) --- */
>
--
Bazsi
next prev parent reply other threads:[~2009-08-30 6:56 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-26 14:03 [PATCH 00/11] TProxy for IPv6 Balazs Scheidler
2009-08-15 8:00 ` [PATCH 01/11] TProxy: kick out TIME_WAIT sockets in case a new connection comes in with the same tuple Balazs Scheidler
2009-08-15 12:01 ` [PATCH 02/11] TProxy: add lookup type checks for UDP in nf_tproxy_get_sock_v4() Balazs Scheidler
2009-08-23 9:02 ` [PATCH 03/11] TProxy: reuse a 32bit hole in struct ipv6_pinfo Balazs Scheidler
2009-08-29 16:46 ` Jan Engelhardt
2009-08-30 6:56 ` Balazs Scheidler [this message]
2009-08-30 10:49 ` Jan Engelhardt
2009-08-31 12:27 ` Patrick McHardy
2009-08-23 9:11 ` [PATCH 04/11] TProxy: split off ipv6 defragmentation to a separate module Balazs Scheidler
2009-08-23 9:16 ` [PATCH 05/11] TProxy: added const specifiers to udp lookup functions Balazs Scheidler
2009-08-23 9:19 ` [PATCH 06/11] TProxy: added udp6_lib_lookup function Balazs Scheidler
2009-08-24 12:47 ` [PATCH 07/11] TProxy: implement IPv6 "local" routing type Balazs Scheidler
2009-08-24 12:48 ` [PATCH 08/11] TProxy: allow non-local binds of IPv6 sockets if IP_TRANSPARENT is enabled Balazs Scheidler
2009-08-24 12:51 ` [PATCH 09/11] TProxy: added IPv6 socket lookup function to nf_tproxy_core Balazs Scheidler
2009-08-24 12:51 ` [PATCH 10/11] TProxy: added IPv6 support to the TPROXY target Balazs Scheidler
2009-08-24 12:52 ` [PATCH 11/11] TProxy: added IPv6 support to the socket match Balazs Scheidler
2009-09-04 6:07 ` [PATCH 00/11] TProxy for IPv6 Amos Jeffries
2009-09-04 9:28 ` Jan Engelhardt
2009-09-14 12:20 ` Amos Jeffries
2009-09-14 12:29 ` Jan Engelhardt
2009-09-15 11:58 ` Amos Jeffries
2009-09-08 18:42 ` Balazs Scheidler
2009-09-11 12:12 ` Amos Jeffries
[not found] ` <1252059564.7452.17.camel@nyarlathotep>
[not found] ` <1252435673.32029.45.camel@bzorp.balabit>
2009-09-14 7:41 ` Balazs Scheidler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1251615361.18025.32.camel@bzorp.balabit \
--to=bazsi@balabit.hu \
--cc=harry.mason@smoothwall.net \
--cc=jengelh@medozas.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=tproxy@lists.balabit.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).