diff options
author | David S. Miller <davem@davemloft.net> | 2012-07-13 11:21:29 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-13 11:21:29 -0400 |
commit | 85b91b0339e764f7e56ff5968fa10d85451378b4 (patch) | |
tree | 539c368948900b35ee8d474829724a796b482d44 /include/net/ip_fib.h | |
parent | d01cb20711e3c2df41677ee270d6bdeff24e9902 (diff) |
ipv4: Don't store a rule pointer in fib_result.
We only use it to fetch the rule's tclassid, so just store the
tclassid there instead.
This also decreases the size of fib_result by a full 8 bytes on
64-bit. On 32-bits it's a wash.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip_fib.h')
-rw-r--r-- | include/net/ip_fib.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index e91fedd22db2..5697acefeba3 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
@@ -106,12 +106,10 @@ struct fib_result { | |||
106 | unsigned char nh_sel; | 106 | unsigned char nh_sel; |
107 | unsigned char type; | 107 | unsigned char type; |
108 | unsigned char scope; | 108 | unsigned char scope; |
109 | u32 tclassid; | ||
109 | struct fib_info *fi; | 110 | struct fib_info *fi; |
110 | struct fib_table *table; | 111 | struct fib_table *table; |
111 | struct list_head *fa_head; | 112 | struct list_head *fa_head; |
112 | #ifdef CONFIG_IP_MULTIPLE_TABLES | ||
113 | struct fib_rule *r; | ||
114 | #endif | ||
115 | }; | 113 | }; |
116 | 114 | ||
117 | struct fib_result_nl { | 115 | struct fib_result_nl { |
@@ -215,10 +213,6 @@ static inline int fib_lookup(struct net *net, const struct flowi4 *flp, | |||
215 | extern int __net_init fib4_rules_init(struct net *net); | 213 | extern int __net_init fib4_rules_init(struct net *net); |
216 | extern void __net_exit fib4_rules_exit(struct net *net); | 214 | extern void __net_exit fib4_rules_exit(struct net *net); |
217 | 215 | ||
218 | #ifdef CONFIG_IP_ROUTE_CLASSID | ||
219 | extern u32 fib_rules_tclass(const struct fib_result *res); | ||
220 | #endif | ||
221 | |||
222 | extern struct fib_table *fib_new_table(struct net *net, u32 id); | 216 | extern struct fib_table *fib_new_table(struct net *net, u32 id); |
223 | extern struct fib_table *fib_get_table(struct net *net, u32 id); | 217 | extern struct fib_table *fib_get_table(struct net *net, u32 id); |
224 | 218 | ||
@@ -229,7 +223,7 @@ static inline int fib_lookup(struct net *net, struct flowi4 *flp, | |||
229 | struct fib_result *res) | 223 | struct fib_result *res) |
230 | { | 224 | { |
231 | if (!net->ipv4.fib_has_custom_rules) { | 225 | if (!net->ipv4.fib_has_custom_rules) { |
232 | res->r = NULL; | 226 | res->tclassid = 0; |
233 | if (net->ipv4.fib_local && | 227 | if (net->ipv4.fib_local && |
234 | !fib_table_lookup(net->ipv4.fib_local, flp, res, | 228 | !fib_table_lookup(net->ipv4.fib_local, flp, res, |
235 | FIB_LOOKUP_NOREF)) | 229 | FIB_LOOKUP_NOREF)) |
@@ -289,7 +283,7 @@ static inline void fib_combine_itag(u32 *itag, const struct fib_result *res) | |||
289 | #endif | 283 | #endif |
290 | *itag = FIB_RES_NH(*res).nh_tclassid<<16; | 284 | *itag = FIB_RES_NH(*res).nh_tclassid<<16; |
291 | #ifdef CONFIG_IP_MULTIPLE_TABLES | 285 | #ifdef CONFIG_IP_MULTIPLE_TABLES |
292 | rtag = fib_rules_tclass(res); | 286 | rtag = res->tclassid; |
293 | if (*itag == 0) | 287 | if (*itag == 0) |
294 | *itag = (rtag<<16); | 288 | *itag = (rtag<<16); |
295 | *itag |= (rtag>>16); | 289 | *itag |= (rtag>>16); |