diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-10-15 02:30:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-18 21:52:53 -0400 |
commit | c720c7e8383aff1cb219bddf474ed89d850336e3 (patch) | |
tree | 4f12337e6690fccced376db9f501eaf98614a65e /include/net/inet_hashtables.h | |
parent | 988ade6b8e27e79311812f83a87b5cea11fabcd7 (diff) |
inet: rename some inet_sock fields
In order to have better cache layouts of struct sock (separate zones
for rx/tx paths), we need this preliminary patch.
Goal is to transfert fields used at lookup time in the first
read-mostly cache line (inside struct sock_common) and move sk_refcnt
to a separate cache line (only written by rx path)
This patch adds inet_ prefix to daddr, rcv_saddr, dport, num, saddr,
sport and id fields. This allows a future patch to define these
fields as macros, like sk_refcnt, without name clashes.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/inet_hashtables.h')
-rw-r--r-- | include/net/inet_hashtables.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 5f11c4a0daca..5b698b3b463d 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
@@ -241,7 +241,7 @@ static inline int inet_lhashfn(struct net *net, const unsigned short num) | |||
241 | 241 | ||
242 | static inline int inet_sk_listen_hashfn(const struct sock *sk) | 242 | static inline int inet_sk_listen_hashfn(const struct sock *sk) |
243 | { | 243 | { |
244 | return inet_lhashfn(sock_net(sk), inet_sk(sk)->num); | 244 | return inet_lhashfn(sock_net(sk), inet_sk(sk)->inet_num); |
245 | } | 245 | } |
246 | 246 | ||
247 | /* Caller must disable local BH processing. */ | 247 | /* Caller must disable local BH processing. */ |
@@ -301,8 +301,8 @@ typedef __u64 __bitwise __addrpair; | |||
301 | #endif /* __BIG_ENDIAN */ | 301 | #endif /* __BIG_ENDIAN */ |
302 | #define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ | 302 | #define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ |
303 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ | 303 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ |
304 | ((*((__addrpair *)&(inet_sk(__sk)->daddr))) == (__cookie)) && \ | 304 | ((*((__addrpair *)&(inet_sk(__sk)->inet_daddr))) == (__cookie)) && \ |
305 | ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | 305 | ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \ |
306 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) | 306 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) |
307 | #define INET_TW_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ | 307 | #define INET_TW_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ |
308 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ | 308 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ |
@@ -313,9 +313,9 @@ typedef __u64 __bitwise __addrpair; | |||
313 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) | 313 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) |
314 | #define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif) \ | 314 | #define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif) \ |
315 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ | 315 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ |
316 | (inet_sk(__sk)->daddr == (__saddr)) && \ | 316 | (inet_sk(__sk)->inet_daddr == (__saddr)) && \ |
317 | (inet_sk(__sk)->rcv_saddr == (__daddr)) && \ | 317 | (inet_sk(__sk)->inet_rcv_saddr == (__daddr)) && \ |
318 | ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | 318 | ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \ |
319 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) | 319 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) |
320 | #define INET_TW_MATCH(__sk, __net, __hash,__cookie, __saddr, __daddr, __ports, __dif) \ | 320 | #define INET_TW_MATCH(__sk, __net, __hash,__cookie, __saddr, __daddr, __ports, __dif) \ |
321 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ | 321 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ |