diff options
author | David S. Miller <davem@davemloft.net> | 2011-03-05 00:47:09 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-05 00:55:31 -0500 |
commit | 5e2b61f78411be25f0b84f97d5b5d312f184dfd1 (patch) | |
tree | 6a5faa5fb7a2242bebacba4cdb5722b988d3e909 /include/net | |
parent | 1018b5c01636c7c6bda31a719bda34fc631db29a (diff) |
ipv4: Remove flowi from struct rtable.
The only necessary parts are the src/dst addresses, the
interface indexes, the TOS, and the mark.
The rest is unnecessary bloat, which amounts to nearly
50 bytes on 64-bit.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/route.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/include/net/route.h b/include/net/route.h index 8905d90e0044..9257f5f17337 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -53,16 +53,20 @@ struct fib_info; | |||
53 | struct rtable { | 53 | struct rtable { |
54 | struct dst_entry dst; | 54 | struct dst_entry dst; |
55 | 55 | ||
56 | /* Cache lookup keys */ | 56 | /* Lookup key. */ |
57 | struct flowi fl; | 57 | __be32 rt_key_dst; |
58 | __be32 rt_key_src; | ||
58 | 59 | ||
59 | int rt_genid; | 60 | int rt_genid; |
60 | unsigned rt_flags; | 61 | unsigned rt_flags; |
61 | __u16 rt_type; | 62 | __u16 rt_type; |
63 | __u8 rt_tos; | ||
62 | 64 | ||
63 | __be32 rt_dst; /* Path destination */ | 65 | __be32 rt_dst; /* Path destination */ |
64 | __be32 rt_src; /* Path source */ | 66 | __be32 rt_src; /* Path source */ |
65 | int rt_iif; | 67 | int rt_iif; |
68 | int rt_oif; | ||
69 | __u32 rt_mark; | ||
66 | 70 | ||
67 | /* Info on neighbour */ | 71 | /* Info on neighbour */ |
68 | __be32 rt_gateway; | 72 | __be32 rt_gateway; |
@@ -76,12 +80,12 @@ struct rtable { | |||
76 | 80 | ||
77 | static inline bool rt_is_input_route(struct rtable *rt) | 81 | static inline bool rt_is_input_route(struct rtable *rt) |
78 | { | 82 | { |
79 | return rt->fl.iif != 0; | 83 | return rt->rt_iif != 0; |
80 | } | 84 | } |
81 | 85 | ||
82 | static inline bool rt_is_output_route(struct rtable *rt) | 86 | static inline bool rt_is_output_route(struct rtable *rt) |
83 | { | 87 | { |
84 | return rt->fl.iif == 0; | 88 | return rt->rt_iif == 0; |
85 | } | 89 | } |
86 | 90 | ||
87 | struct ip_rt_acct { | 91 | struct ip_rt_acct { |
@@ -212,11 +216,11 @@ static inline struct rtable *ip_route_newports(struct rtable *rt, | |||
212 | __be16 dport, struct sock *sk) | 216 | __be16 dport, struct sock *sk) |
213 | { | 217 | { |
214 | if (sport != orig_sport || dport != orig_dport) { | 218 | if (sport != orig_sport || dport != orig_dport) { |
215 | struct flowi fl = { .oif = rt->fl.oif, | 219 | struct flowi fl = { .oif = rt->rt_oif, |
216 | .mark = rt->fl.mark, | 220 | .mark = rt->rt_mark, |
217 | .fl4_dst = rt->fl.fl4_dst, | 221 | .fl4_dst = rt->rt_key_dst, |
218 | .fl4_src = rt->fl.fl4_src, | 222 | .fl4_src = rt->rt_key_src, |
219 | .fl4_tos = rt->fl.fl4_tos, | 223 | .fl4_tos = rt->rt_tos, |
220 | .proto = protocol, | 224 | .proto = protocol, |
221 | .fl_ip_sport = sport, | 225 | .fl_ip_sport = sport, |
222 | .fl_ip_dport = dport }; | 226 | .fl_ip_dport = dport }; |