aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ip.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-10-15 02:30:45 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-18 21:52:53 -0400
commitc720c7e8383aff1cb219bddf474ed89d850336e3 (patch)
tree4f12337e6690fccced376db9f501eaf98614a65e /include/net/ip.h
parent988ade6b8e27e79311812f83a87b5cea11fabcd7 (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/ip.h')
-rw-r--r--include/net/ip.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/net/ip.h b/include/net/ip.h
index 2f47e5482b55..376adf47764e 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -240,8 +240,8 @@ static inline void ip_select_ident(struct iphdr *iph, struct dst_entry *dst, str
240 * does not change, they drop every other packet in 240 * does not change, they drop every other packet in
241 * a TCP stream using header compression. 241 * a TCP stream using header compression.
242 */ 242 */
243 iph->id = (sk && inet_sk(sk)->daddr) ? 243 iph->id = (sk && inet_sk(sk)->inet_daddr) ?
244 htons(inet_sk(sk)->id++) : 0; 244 htons(inet_sk(sk)->inet_id++) : 0;
245 } else 245 } else
246 __ip_select_ident(iph, dst, 0); 246 __ip_select_ident(iph, dst, 0);
247} 247}
@@ -249,9 +249,9 @@ static inline void ip_select_ident(struct iphdr *iph, struct dst_entry *dst, str
249static inline void ip_select_ident_more(struct iphdr *iph, struct dst_entry *dst, struct sock *sk, int more) 249static inline void ip_select_ident_more(struct iphdr *iph, struct dst_entry *dst, struct sock *sk, int more)
250{ 250{
251 if (iph->frag_off & htons(IP_DF)) { 251 if (iph->frag_off & htons(IP_DF)) {
252 if (sk && inet_sk(sk)->daddr) { 252 if (sk && inet_sk(sk)->inet_daddr) {
253 iph->id = htons(inet_sk(sk)->id); 253 iph->id = htons(inet_sk(sk)->inet_id);
254 inet_sk(sk)->id += 1 + more; 254 inet_sk(sk)->inet_id += 1 + more;
255 } else 255 } else
256 iph->id = 0; 256 iph->id = 0;
257 } else 257 } else
@@ -317,7 +317,7 @@ static inline void ip_ib_mc_map(__be32 naddr, const unsigned char *broadcast, ch
317 317
318static __inline__ void inet_reset_saddr(struct sock *sk) 318static __inline__ void inet_reset_saddr(struct sock *sk)
319{ 319{
320 inet_sk(sk)->rcv_saddr = inet_sk(sk)->saddr = 0; 320 inet_sk(sk)->inet_rcv_saddr = inet_sk(sk)->inet_saddr = 0;
321#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 321#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
322 if (sk->sk_family == PF_INET6) { 322 if (sk->sk_family == PF_INET6) {
323 struct ipv6_pinfo *np = inet6_sk(sk); 323 struct ipv6_pinfo *np = inet6_sk(sk);