diff options
author | David S. Miller <davem@davemloft.net> | 2011-05-06 15:02:07 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-06 15:37:57 -0700 |
commit | bdc712b4c2baf9515887de3a52e7ecd89fafc0c7 (patch) | |
tree | 3ce09227fb75593256403eaa459d178a2668db25 /include/net/inet_sock.h | |
parent | ad638bd16d91012a512979327b5c17c867d260c6 (diff) |
inet: Decrease overhead of on-stack inet_cork.
When we fast path datagram sends to avoid locking by putting
the inet_cork on the stack we use up lots of space that isn't
necessary.
This is because inet_cork contains a "struct flowi" which isn't
used in these code paths.
Split inet_cork to two parts, "inet_cork" and "inet_cork_full".
Only the latter of which has the "struct flowi" and is what is
stored in inet_sock.
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Diffstat (limited to 'include/net/inet_sock.h')
-rw-r--r-- | include/net/inet_sock.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index ed2ba6eca72..caaff5f5f39 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h @@ -96,17 +96,21 @@ static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk) struct inet_cork { unsigned int flags; - unsigned int fragsize; + __be32 addr; struct ip_options *opt; + unsigned int fragsize; struct dst_entry *dst; int length; /* Total length of all frames */ - __be32 addr; - struct flowi fl; struct page *page; u32 off; u8 tx_flags; }; +struct inet_cork_full { + struct inet_cork base; + struct flowi fl; +}; + struct ip_mc_socklist; struct ipv6_pinfo; struct rtable; @@ -164,7 +168,7 @@ struct inet_sock { int mc_index; __be32 mc_addr; struct ip_mc_socklist __rcu *mc_list; - struct inet_cork cork; + struct inet_cork_full cork; }; #define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */ |