summaryrefslogtreecommitdiffstats
path: root/include/net/route.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-04 21:47:09 -0800
committerDavid S. Miller <davem@davemloft.net>2011-03-04 21:55:31 -0800
commit5e2b61f78411be25f0b84f97d5b5d312f184dfd1 (patch)
tree6a5faa5fb7a2242bebacba4cdb5722b988d3e909 /include/net/route.h
parent1018b5c01636c7c6bda31a719bda34fc631db29a (diff)
downloadop-kernel-dev-5e2b61f78411be25f0b84f97d5b5d312f184dfd1.zip
op-kernel-dev-5e2b61f78411be25f0b84f97d5b5d312f184dfd1.tar.gz
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/route.h')
-rw-r--r--include/net/route.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/include/net/route.h b/include/net/route.h
index 8905d90..9257f5f 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -53,16 +53,20 @@ struct fib_info;
struct rtable {
struct dst_entry dst;
- /* Cache lookup keys */
- struct flowi fl;
+ /* Lookup key. */
+ __be32 rt_key_dst;
+ __be32 rt_key_src;
int rt_genid;
unsigned rt_flags;
__u16 rt_type;
+ __u8 rt_tos;
__be32 rt_dst; /* Path destination */
__be32 rt_src; /* Path source */
int rt_iif;
+ int rt_oif;
+ __u32 rt_mark;
/* Info on neighbour */
__be32 rt_gateway;
@@ -76,12 +80,12 @@ struct rtable {
static inline bool rt_is_input_route(struct rtable *rt)
{
- return rt->fl.iif != 0;
+ return rt->rt_iif != 0;
}
static inline bool rt_is_output_route(struct rtable *rt)
{
- return rt->fl.iif == 0;
+ return rt->rt_iif == 0;
}
struct ip_rt_acct {
@@ -212,11 +216,11 @@ static inline struct rtable *ip_route_newports(struct rtable *rt,
__be16 dport, struct sock *sk)
{
if (sport != orig_sport || dport != orig_dport) {
- struct flowi fl = { .oif = rt->fl.oif,
- .mark = rt->fl.mark,
- .fl4_dst = rt->fl.fl4_dst,
- .fl4_src = rt->fl.fl4_src,
- .fl4_tos = rt->fl.fl4_tos,
+ struct flowi fl = { .oif = rt->rt_oif,
+ .mark = rt->rt_mark,
+ .fl4_dst = rt->rt_key_dst,
+ .fl4_src = rt->rt_key_src,
+ .fl4_tos = rt->rt_tos,
.proto = protocol,
.fl_ip_sport = sport,
.fl_ip_dport = dport };
OpenPOWER on IntegriCloud