aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/inet_sock.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/inet_sock.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/inet_sock.h')
-rw-r--r--include/net/inet_sock.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 47004f35cc7e..bd4c53f75ac0 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -93,14 +93,14 @@ struct rtable;
93 * 93 *
94 * @sk - ancestor class 94 * @sk - ancestor class
95 * @pinet6 - pointer to IPv6 control block 95 * @pinet6 - pointer to IPv6 control block
96 * @daddr - Foreign IPv4 addr 96 * @inet_daddr - Foreign IPv4 addr
97 * @rcv_saddr - Bound local IPv4 addr 97 * @inet_rcv_saddr - Bound local IPv4 addr
98 * @dport - Destination port 98 * @inet_dport - Destination port
99 * @num - Local port 99 * @inet_num - Local port
100 * @saddr - Sending source 100 * @inet_saddr - Sending source
101 * @uc_ttl - Unicast TTL 101 * @uc_ttl - Unicast TTL
102 * @sport - Source port 102 * @inet_sport - Source port
103 * @id - ID counter for DF pkts 103 * @inet_id - ID counter for DF pkts
104 * @tos - TOS 104 * @tos - TOS
105 * @mc_ttl - Multicasting TTL 105 * @mc_ttl - Multicasting TTL
106 * @is_icsk - is this an inet_connection_sock? 106 * @is_icsk - is this an inet_connection_sock?
@@ -115,16 +115,16 @@ struct inet_sock {
115 struct ipv6_pinfo *pinet6; 115 struct ipv6_pinfo *pinet6;
116#endif 116#endif
117 /* Socket demultiplex comparisons on incoming packets. */ 117 /* Socket demultiplex comparisons on incoming packets. */
118 __be32 daddr; 118 __be32 inet_daddr;
119 __be32 rcv_saddr; 119 __be32 inet_rcv_saddr;
120 __be16 dport; 120 __be16 inet_dport;
121 __u16 num; 121 __u16 inet_num;
122 __be32 saddr; 122 __be32 inet_saddr;
123 __s16 uc_ttl; 123 __s16 uc_ttl;
124 __u16 cmsg_flags; 124 __u16 cmsg_flags;
125 struct ip_options *opt; 125 struct ip_options *opt;
126 __be16 sport; 126 __be16 inet_sport;
127 __u16 id; 127 __u16 inet_id;
128 __u8 tos; 128 __u8 tos;
129 __u8 mc_ttl; 129 __u8 mc_ttl;
130 __u8 pmtudisc; 130 __u8 pmtudisc;
@@ -190,10 +190,10 @@ static inline unsigned int inet_ehashfn(struct net *net,
190static inline int inet_sk_ehashfn(const struct sock *sk) 190static inline int inet_sk_ehashfn(const struct sock *sk)
191{ 191{
192 const struct inet_sock *inet = inet_sk(sk); 192 const struct inet_sock *inet = inet_sk(sk);
193 const __be32 laddr = inet->rcv_saddr; 193 const __be32 laddr = inet->inet_rcv_saddr;
194 const __u16 lport = inet->num; 194 const __u16 lport = inet->inet_num;
195 const __be32 faddr = inet->daddr; 195 const __be32 faddr = inet->inet_daddr;
196 const __be16 fport = inet->dport; 196 const __be16 fport = inet->inet_dport;
197 struct net *net = sock_net(sk); 197 struct net *net = sock_net(sk);
198 198
199 return inet_ehashfn(net, laddr, lport, faddr, fport); 199 return inet_ehashfn(net, laddr, lport, faddr, fport);