From f7b14315faf62935a791dd67969c4289563058f0 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 9 Feb 2007 15:46:51 -0800 Subject: [DECNET]: fix misannotation of linkinfo_dn Signed-off-by: Al Viro Signed-off-by: David S. Miller --- include/linux/dn.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/dn.h b/include/linux/dn.h index 10b6a6fd583..02bba040fcf 100644 --- a/include/linux/dn.h +++ b/include/linux/dn.h @@ -113,7 +113,7 @@ struct accessdata_dn * DECnet logical link information structure */ struct linkinfo_dn { - __le16 idn_segsize; /* Segment size for link */ + __u16 idn_segsize; /* Segment size for link */ __u8 idn_linkstate; /* Logical link state */ }; -- cgit v1.2.3 From 75ce7ceaa1221858c0163e75d19eb8a423a212ff Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Fri, 9 Feb 2007 16:14:24 -0800 Subject: [NET]: Introduce union in struct dst_entry to hold 'next' pointer This patch introduces an anonymous union to nicely express the fact that all objects inherited from struct dst_entry should access to the generic 'next' pointer but with appropriate type verification. This patch is a prereq before following patches. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- include/net/dst.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/net/dst.h b/include/net/dst.h index 62b7e7598e9..5d62342e8bc 100644 --- a/include/net/dst.h +++ b/include/net/dst.h @@ -37,7 +37,12 @@ struct sk_buff; struct dst_entry { - struct dst_entry *next; + 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 dst_entry *child; -- cgit v1.2.3 From 093c2ca4167cf66f69020329d14138da0da8599b Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Fri, 9 Feb 2007 16:19:26 -0800 Subject: [IPV4]: Convert ipv4 route to use the new dst_entry 'next' pointer This patch removes the rt_next pointer from 'struct rtable.u' union, and renames u.rt_next to u.dst_rt_next. It also moves 'struct flowi' right after 'struct dst_entry' to prepare the gain on lookups. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- include/net/route.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/net/route.h b/include/net/route.h index 1440bdb5a27..749e4dfe5ff 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -53,9 +53,11 @@ struct rtable union { struct dst_entry dst; - struct rtable *rt_next; } u; + /* Cache lookup keys */ + struct flowi fl; + struct in_device *idev; unsigned rt_flags; @@ -69,9 +71,6 @@ struct rtable /* Info on neighbour */ __be32 rt_gateway; - /* Cache lookup keys */ - struct flowi fl; - /* Miscellaneous cached information */ __be32 rt_spec_dst; /* RFC1122 specific destination */ struct inet_peer *peer; /* long-living peer info */ -- cgit v1.2.3 From 7cc482634f1f1e1db5401007658c8e8d6cf1617d Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Fri, 9 Feb 2007 16:22:57 -0800 Subject: [IPV6]: Convert ipv6 route to use the new dst_entry 'next' pointer This patch removes the next pointer from 'struct rt6_info.u' union, and renames u.next to u.dst.rt6_next. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- include/net/ip6_fib.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 7be4f4e3a0f..9eda572a2a6 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h @@ -83,7 +83,6 @@ struct rt6_info { union { struct dst_entry dst; - struct rt6_info *next; } u; struct inet6_dev *rt6i_idev; -- cgit v1.2.3 From 0c195c3fc4e95a06b0c0017506f074c94af99c35 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Fri, 9 Feb 2007 16:25:52 -0800 Subject: [DECNET]: Convert decnet route to use the new dst_entry 'next' pointer This patch removes the next pointer from 'struct dn_route.u' union, and renames u.rt_next to u.dst.dn_next. It also moves 'struct flowi' right after 'struct dst_entry' to prepare speedup lookups. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- include/net/dn_route.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/net/dn_route.h b/include/net/dn_route.h index 76f957e258b..a566944c496 100644 --- a/include/net/dn_route.h +++ b/include/net/dn_route.h @@ -68,9 +68,10 @@ extern void dn_rt_cache_flush(int delay); struct dn_route { union { struct dst_entry dst; - struct dn_route *rt_next; } u; + struct flowi fl; + __le16 rt_saddr; __le16 rt_daddr; __le16 rt_gateway; @@ -80,8 +81,6 @@ struct dn_route { unsigned rt_flags; unsigned rt_type; - - struct flowi fl; }; extern void dn_route_init(void); -- cgit v1.2.3 From 1e19e02ca0c5e33ea73a25127dbe6c3b8fcaac4b Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Fri, 9 Feb 2007 16:26:55 -0800 Subject: [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 Signed-off-by: David S. Miller --- include/net/dst.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/net/dst.h b/include/net/dst.h index 5d62342e8bc..e12a8ce0b9b 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]; }; -- cgit v1.2.3