aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/inet_sock.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-05-06 18:02:07 -0400
committerDavid S. Miller <davem@davemloft.net>2011-05-06 18:37:57 -0400
commitbdc712b4c2baf9515887de3a52e7ecd89fafc0c7 (patch)
tree3ce09227fb75593256403eaa459d178a2668db25 /include/net/inet_sock.h
parentad638bd16d91012a512979327b5c17c867d260c6 (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.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index ed2ba6eca724..caaff5f5f39f 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)
96 96
97struct inet_cork { 97struct inet_cork {
98 unsigned int flags; 98 unsigned int flags;
99 unsigned int fragsize; 99 __be32 addr;
100 struct ip_options *opt; 100 struct ip_options *opt;
101 unsigned int fragsize;
101 struct dst_entry *dst; 102 struct dst_entry *dst;
102 int length; /* Total length of all frames */ 103 int length; /* Total length of all frames */
103 __be32 addr;
104 struct flowi fl;
105 struct page *page; 104 struct page *page;
106 u32 off; 105 u32 off;
107 u8 tx_flags; 106 u8 tx_flags;
108}; 107};
109 108
109struct inet_cork_full {
110 struct inet_cork base;
111 struct flowi fl;
112};
113
110struct ip_mc_socklist; 114struct ip_mc_socklist;
111struct ipv6_pinfo; 115struct ipv6_pinfo;
112struct rtable; 116struct rtable;
@@ -164,7 +168,7 @@ struct inet_sock {
164 int mc_index; 168 int mc_index;
165 __be32 mc_addr; 169 __be32 mc_addr;
166 struct ip_mc_socklist __rcu *mc_list; 170 struct ip_mc_socklist __rcu *mc_list;
167 struct inet_cork cork; 171 struct inet_cork_full cork;
168}; 172};
169 173
170#define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */ 174#define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */