netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Beschorner Daniel <Daniel.Beschorner@facton.com>
Cc: netdev@vger.kernel.org, Eric Dumazet <dada1@cosmosbay.com>
Subject: Re: IPSec freeze
Date: Mon, 16 Jul 2007 20:12:28 +0200	[thread overview]
Message-ID: <469BB50C.10203@trash.net> (raw)
In-Reply-To: <3C59DB883F7B0B4D8096010D45ACCD13230242@exch.facton.local>

[-- Attachment #1: Type: text/plain, Size: 646 bytes --]

Beschorner Daniel wrote:
>>I managed to reproduce a crash with ipcomp, will try to fix it later.
> 
> 
> Yes, I can confirm this.
> After disabling IPComp the crashes went away.


The crash happens in xfrm_bundle_ok when walking the bundle upwards
following xfrm_dst->u.next. The loop should be stopped when
xfrm_dst->u.next == first (the topmost xfrm_dst), but it points to
NULL instead. I'm pretty sure the attached patch is responsible,
it breaks XFRM's assumption that dst->next and xfrm_dst->u.next are
the same pointer and xfrm_dst now shares the next pointer with
rcu_head.next in struct dst_entry.

Eric, could you look into this please?

[-- Attachment #2: x --]
[-- Type: text/plain, Size: 1910 bytes --]

[NET]: Reorder fields of struct dst_entry

This last patch (but not least :) ) finally moves the next pointer at
the end of struct dst_entry. This permits to perform route cache
lookups with a minimal cost of one cache line per entry, instead of
two.

Both 32bits and 64bits platforms benefit from this new layout.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

---
commit 1e19e02ca0c5e33ea73a25127dbe6c3b8fcaac4b
tree 23afba2945a9e09b137b094a868ea176c1e1c800
parent 0c195c3fc4e95a06b0c0017506f074c94af99c35
author Eric Dumazet <dada1@cosmosbay.com> Fri, 09 Feb 2007 16:26:55 -0800
committer David S. Miller <davem@sunset.davemloft.net> Sat, 10 Feb 2007 23:20:45 -0800

 include/net/dst.h |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/net/dst.h b/include/net/dst.h
index 5d62342..e12a8ce 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -37,14 +37,7 @@ struct sk_buff;
 
 struct dst_entry
 {
-	union {
-		struct dst_entry *next;
-		struct rtable    *rt_next;
-		struct rt6_info   *rt6_next;
-		struct dn_route  *dn_next;
-	};
-	atomic_t		__refcnt;	/* client references	*/
-	int			__use;
+	struct rcu_head		rcu_head;
 	struct dst_entry	*child;
 	struct net_device       *dev;
 	short			error;
@@ -55,7 +48,6 @@ struct dst_entry
 #define DST_NOPOLICY		4
 #define DST_NOHASH		8
 #define DST_BALANCED            0x10
-	unsigned long		lastuse;
 	unsigned long		expires;
 
 	unsigned short		header_len;	/* more space at head required */
@@ -80,8 +72,16 @@ struct dst_entry
 #endif
 
 	struct  dst_ops	        *ops;
-	struct rcu_head		rcu_head;
 		
+	unsigned long		lastuse;
+	atomic_t		__refcnt;	/* client references	*/
+	int			__use;
+	union {
+		struct dst_entry *next;
+		struct rtable    *rt_next;
+		struct rt6_info   *rt6_next;
+		struct dn_route  *dn_next;
+	};
 	char			info[0];
 };
 

  reply	other threads:[~2007-07-16 18:12 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-15  6:29 IPSec freeze Beschorner Daniel
2007-07-15 15:00 ` Patrick McHardy
2007-07-16  8:27   ` Beschorner Daniel
2007-07-16 13:09     ` Beschorner Daniel
2007-07-16 13:17       ` Patrick McHardy
2007-07-16 13:26         ` Beschorner Daniel
2007-07-16 14:07           ` Patrick McHardy
2007-07-16 14:17             ` Beschorner Daniel
2007-07-16 14:58               ` Patrick McHardy
2007-07-16 14:59                 ` Patrick McHardy
2007-07-16 15:18                 ` Patrick McHardy
2007-07-16 15:36                   ` Beschorner Daniel
2007-07-16 18:12                     ` Patrick McHardy [this message]
2007-07-17 16:10                       ` Patrick McHardy
2007-07-17 19:03                         ` Beschorner Daniel
2007-07-17 21:45                           ` Patrick McHardy
2007-07-18 12:21                             ` pmtu discovery on SA Beschorner Daniel
2007-07-18 13:14                               ` Patrick McHardy
2007-07-18 16:13                                 ` Beschorner Daniel
2007-07-18 16:27                                   ` Patrick McHardy
2007-07-18 16:56                                     ` Mika Penttilä
2007-07-18 18:27                                       ` Patrick McHardy
2007-07-18 18:39                                         ` Mika Penttilä
2007-07-18 18:41                                           ` Patrick McHardy
2007-07-18 18:47                                             ` Mika Penttilä
2007-07-19 15:51                                     ` Beschorner Daniel
2007-07-18  8:58                           ` IPSec freeze David Miller
2007-07-18  8:58                         ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2007-07-16 16:49 Beschorner Daniel

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=469BB50C.10203@trash.net \
    --to=kaber@trash.net \
    --cc=Daniel.Beschorner@facton.com \
    --cc=dada1@cosmosbay.com \
    --cc=netdev@vger.kernel.org \
    /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).