diff options
author | David S. Miller <davem@davemloft.net> | 2010-04-27 18:05:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-27 18:11:48 -0400 |
commit | c58dc01babfd58ec9e71a6ce080150dc27755d88 (patch) | |
tree | 065c58b5236ea23ff0868a6bbf3c5233b990f0be /include/net/inet_sock.h | |
parent | c4ee6a5348102b9cea49fb9adf88307445407911 (diff) |
net: Make RFS socket operations not be inet specific.
Idea from Eric Dumazet.
As for placement inside of struct sock, I tried to choose a place
that otherwise has a 32-bit hole on 64-bit systems.
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 | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index c1d42957b86b..1653de515cee 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
@@ -102,7 +102,6 @@ struct rtable; | |||
102 | * @uc_ttl - Unicast TTL | 102 | * @uc_ttl - Unicast TTL |
103 | * @inet_sport - Source port | 103 | * @inet_sport - Source port |
104 | * @inet_id - ID counter for DF pkts | 104 | * @inet_id - ID counter for DF pkts |
105 | * @rxhash - flow hash received from netif layer | ||
106 | * @tos - TOS | 105 | * @tos - TOS |
107 | * @mc_ttl - Multicasting TTL | 106 | * @mc_ttl - Multicasting TTL |
108 | * @is_icsk - is this an inet_connection_sock? | 107 | * @is_icsk - is this an inet_connection_sock? |
@@ -126,9 +125,6 @@ struct inet_sock { | |||
126 | __u16 cmsg_flags; | 125 | __u16 cmsg_flags; |
127 | __be16 inet_sport; | 126 | __be16 inet_sport; |
128 | __u16 inet_id; | 127 | __u16 inet_id; |
129 | #ifdef CONFIG_RPS | ||
130 | __u32 rxhash; | ||
131 | #endif | ||
132 | 128 | ||
133 | struct ip_options *opt; | 129 | struct ip_options *opt; |
134 | __u8 tos; | 130 | __u8 tos; |
@@ -224,37 +220,4 @@ static inline __u8 inet_sk_flowi_flags(const struct sock *sk) | |||
224 | return inet_sk(sk)->transparent ? FLOWI_FLAG_ANYSRC : 0; | 220 | return inet_sk(sk)->transparent ? FLOWI_FLAG_ANYSRC : 0; |
225 | } | 221 | } |
226 | 222 | ||
227 | static inline void inet_rps_record_flow(const struct sock *sk) | ||
228 | { | ||
229 | #ifdef CONFIG_RPS | ||
230 | struct rps_sock_flow_table *sock_flow_table; | ||
231 | |||
232 | rcu_read_lock(); | ||
233 | sock_flow_table = rcu_dereference(rps_sock_flow_table); | ||
234 | rps_record_sock_flow(sock_flow_table, inet_sk(sk)->rxhash); | ||
235 | rcu_read_unlock(); | ||
236 | #endif | ||
237 | } | ||
238 | |||
239 | static inline void inet_rps_reset_flow(const struct sock *sk) | ||
240 | { | ||
241 | #ifdef CONFIG_RPS | ||
242 | struct rps_sock_flow_table *sock_flow_table; | ||
243 | |||
244 | rcu_read_lock(); | ||
245 | sock_flow_table = rcu_dereference(rps_sock_flow_table); | ||
246 | rps_reset_sock_flow(sock_flow_table, inet_sk(sk)->rxhash); | ||
247 | rcu_read_unlock(); | ||
248 | #endif | ||
249 | } | ||
250 | |||
251 | static inline void inet_rps_save_rxhash(struct sock *sk, u32 rxhash) | ||
252 | { | ||
253 | #ifdef CONFIG_RPS | ||
254 | if (unlikely(inet_sk(sk)->rxhash != rxhash)) { | ||
255 | inet_rps_reset_flow(sk); | ||
256 | inet_sk(sk)->rxhash = rxhash; | ||
257 | } | ||
258 | #endif | ||
259 | } | ||
260 | #endif /* _INET_SOCK_H */ | 223 | #endif /* _INET_SOCK_H */ |