aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/inet_sock.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-01-28 01:01:53 -0500
committerDavid S. Miller <davem@davemloft.net>2011-01-28 01:01:53 -0500
commita4daad6b0923030fbd3b00a01f570e4c3eef446b (patch)
treeb8e5b9a2110628503e57149f0bb2a4bb1bf3f027 /include/net/inet_sock.h
parent8571a19c4ac140f1a507f3e7eb716892afa27109 (diff)
net: Pre-COW metrics for TCP.
TCP is going to record metrics for the connection, so pre-COW the route metrics at route cache entry creation time. This avoids several atomic operations that have to occur if we COW the metrics after the entry reaches global visibility. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/inet_sock.h')
-rw-r--r--include/net/inet_sock.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 8181498fa96c..6e6dfd757682 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -219,7 +219,13 @@ static inline struct request_sock *inet_reqsk_alloc(struct request_sock_ops *ops
219 219
220static inline __u8 inet_sk_flowi_flags(const struct sock *sk) 220static inline __u8 inet_sk_flowi_flags(const struct sock *sk)
221{ 221{
222 return inet_sk(sk)->transparent ? FLOWI_FLAG_ANYSRC : 0; 222 __u8 flags = 0;
223
224 if (inet_sk(sk)->transparent)
225 flags |= FLOWI_FLAG_ANYSRC;
226 if (sk->sk_protocol == IPPROTO_TCP)
227 flags |= FLOWI_FLAG_PRECOW_METRICS;
228 return flags;
223} 229}
224 230
225#endif /* _INET_SOCK_H */ 231#endif /* _INET_SOCK_H */