Skip to content

Commit

Permalink
[NET]: Reorder fields of struct dst_entry
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Feb 11, 2007
1 parent 0c195c3 commit 1e19e02
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions include/net/dst.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 */
Expand All @@ -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];
};

Expand Down

0 comments on commit 1e19e02

Please sign in to comment.