aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
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 /drivers/net
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 'drivers/net')
-rw-r--r--drivers/net/pppol2tp.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c
index 5910df60c93e..849cc9c62c2a 100644
--- a/drivers/net/pppol2tp.c
+++ b/drivers/net/pppol2tp.c
@@ -516,7 +516,7 @@ static inline int pppol2tp_verify_udp_checksum(struct sock *sk,
516 return 0; 516 return 0;
517 517
518 inet = inet_sk(sk); 518 inet = inet_sk(sk);
519 psum = csum_tcpudp_nofold(inet->saddr, inet->daddr, ulen, 519 psum = csum_tcpudp_nofold(inet->inet_saddr, inet->inet_daddr, ulen,
520 IPPROTO_UDP, 0); 520 IPPROTO_UDP, 0);
521 521
522 if ((skb->ip_summed == CHECKSUM_COMPLETE) && 522 if ((skb->ip_summed == CHECKSUM_COMPLETE) &&
@@ -949,8 +949,8 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh
949 inet = inet_sk(sk_tun); 949 inet = inet_sk(sk_tun);
950 udp_len = hdr_len + sizeof(ppph) + total_len; 950 udp_len = hdr_len + sizeof(ppph) + total_len;
951 uh = (struct udphdr *) skb->data; 951 uh = (struct udphdr *) skb->data;
952 uh->source = inet->sport; 952 uh->source = inet->inet_sport;
953 uh->dest = inet->dport; 953 uh->dest = inet->inet_dport;
954 uh->len = htons(udp_len); 954 uh->len = htons(udp_len);
955 uh->check = 0; 955 uh->check = 0;
956 skb_put(skb, sizeof(struct udphdr)); 956 skb_put(skb, sizeof(struct udphdr));
@@ -978,7 +978,8 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh
978 else if (!(skb_dst(skb)->dev->features & NETIF_F_V4_CSUM)) { 978 else if (!(skb_dst(skb)->dev->features & NETIF_F_V4_CSUM)) {
979 skb->ip_summed = CHECKSUM_COMPLETE; 979 skb->ip_summed = CHECKSUM_COMPLETE;
980 csum = skb_checksum(skb, 0, udp_len, 0); 980 csum = skb_checksum(skb, 0, udp_len, 0);
981 uh->check = csum_tcpudp_magic(inet->saddr, inet->daddr, 981 uh->check = csum_tcpudp_magic(inet->inet_saddr,
982 inet->inet_daddr,
982 udp_len, IPPROTO_UDP, csum); 983 udp_len, IPPROTO_UDP, csum);
983 if (uh->check == 0) 984 if (uh->check == 0)
984 uh->check = CSUM_MANGLED_0; 985 uh->check = CSUM_MANGLED_0;
@@ -986,7 +987,8 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh
986 skb->ip_summed = CHECKSUM_PARTIAL; 987 skb->ip_summed = CHECKSUM_PARTIAL;
987 skb->csum_start = skb_transport_header(skb) - skb->head; 988 skb->csum_start = skb_transport_header(skb) - skb->head;
988 skb->csum_offset = offsetof(struct udphdr, check); 989 skb->csum_offset = offsetof(struct udphdr, check);
989 uh->check = ~csum_tcpudp_magic(inet->saddr, inet->daddr, 990 uh->check = ~csum_tcpudp_magic(inet->inet_saddr,
991 inet->inet_daddr,
990 udp_len, IPPROTO_UDP, 0); 992 udp_len, IPPROTO_UDP, 0);
991 } 993 }
992 994
@@ -1136,8 +1138,8 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
1136 __skb_push(skb, sizeof(*uh)); 1138 __skb_push(skb, sizeof(*uh));
1137 skb_reset_transport_header(skb); 1139 skb_reset_transport_header(skb);
1138 uh = udp_hdr(skb); 1140 uh = udp_hdr(skb);
1139 uh->source = inet->sport; 1141 uh->source = inet->inet_sport;
1140 uh->dest = inet->dport; 1142 uh->dest = inet->inet_dport;
1141 uh->len = htons(udp_len); 1143 uh->len = htons(udp_len);
1142 uh->check = 0; 1144 uh->check = 0;
1143 1145
@@ -1181,7 +1183,8 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
1181 else if (!(skb_dst(skb)->dev->features & NETIF_F_V4_CSUM)) { 1183 else if (!(skb_dst(skb)->dev->features & NETIF_F_V4_CSUM)) {
1182 skb->ip_summed = CHECKSUM_COMPLETE; 1184 skb->ip_summed = CHECKSUM_COMPLETE;
1183 csum = skb_checksum(skb, 0, udp_len, 0); 1185 csum = skb_checksum(skb, 0, udp_len, 0);
1184 uh->check = csum_tcpudp_magic(inet->saddr, inet->daddr, 1186 uh->check = csum_tcpudp_magic(inet->inet_saddr,
1187 inet->inet_daddr,
1185 udp_len, IPPROTO_UDP, csum); 1188 udp_len, IPPROTO_UDP, csum);
1186 if (uh->check == 0) 1189 if (uh->check == 0)
1187 uh->check = CSUM_MANGLED_0; 1190 uh->check = CSUM_MANGLED_0;
@@ -1189,7 +1192,8 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
1189 skb->ip_summed = CHECKSUM_PARTIAL; 1192 skb->ip_summed = CHECKSUM_PARTIAL;
1190 skb->csum_start = skb_transport_header(skb) - skb->head; 1193 skb->csum_start = skb_transport_header(skb) - skb->head;
1191 skb->csum_offset = offsetof(struct udphdr, check); 1194 skb->csum_offset = offsetof(struct udphdr, check);
1192 uh->check = ~csum_tcpudp_magic(inet->saddr, inet->daddr, 1195 uh->check = ~csum_tcpudp_magic(inet->inet_saddr,
1196 inet->inet_daddr,
1193 udp_len, IPPROTO_UDP, 0); 1197 udp_len, IPPROTO_UDP, 0);
1194 } 1198 }
1195 1199