aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2009-05-26 14:50:29 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-27 06:26:02 -0400
commit1075f3f65d0e0f49351b7d4310e9f94483972a51 (patch)
treee5b4a0dbf4eef170da483ce5c52855b7b354e4e0 /net/ipv4
parenta5b1cf288d4200506ab62fbb86cc81ace948a306 (diff)
ipv4: Use 32-bit loads for ID and length in GRO
This patch optimises the IPv4 GRO code by using 32-bit loads (instead of 16-bit ones) on the ID and length checks in the receive function. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/af_inet.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 644cc5535319..5abee4c97449 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1248,9 +1248,9 @@ static struct sk_buff **inet_gro_receive(struct sk_buff **head,
1248 struct iphdr *iph; 1248 struct iphdr *iph;
1249 unsigned int hlen; 1249 unsigned int hlen;
1250 unsigned int off; 1250 unsigned int off;
1251 unsigned int id;
1251 int flush = 1; 1252 int flush = 1;
1252 int proto; 1253 int proto;
1253 int id;
1254 1254
1255 off = skb_gro_offset(skb); 1255 off = skb_gro_offset(skb);
1256 hlen = off + sizeof(*iph); 1256 hlen = off + sizeof(*iph);
@@ -1274,9 +1274,9 @@ static struct sk_buff **inet_gro_receive(struct sk_buff **head,
1274 if (unlikely(ip_fast_csum((u8 *)iph, iph->ihl))) 1274 if (unlikely(ip_fast_csum((u8 *)iph, iph->ihl)))
1275 goto out_unlock; 1275 goto out_unlock;
1276 1276
1277 flush = ntohs(iph->tot_len) != skb_gro_len(skb) || 1277 id = ntohl(*(u32 *)&iph->id);
1278 iph->frag_off != htons(IP_DF); 1278 flush = (u16)((ntohl(*(u32 *)iph) ^ skb_gro_len(skb)) | (id ^ IP_DF));
1279 id = ntohs(iph->id); 1279 id >>= 16;
1280 1280
1281 for (p = *head; p; p = p->next) { 1281 for (p = *head; p; p = p->next) {
1282 struct iphdr *iph2; 1282 struct iphdr *iph2;