]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/af_inet.c
Merge branch 'core/percpu' into percpu-cpumask-x86-for-linus-2
[linux-2.6-omap-h63xx.git] / net / ipv4 / af_inet.c
index c79087719df0e4f8242eca4c25a6df37dd94b5a2..7f03373b8c07b8efd7d3bba01221297dfad5ebaa 100644 (file)
@@ -1263,7 +1263,7 @@ static struct sk_buff **inet_gro_receive(struct sk_buff **head,
        if (!ops || !ops->gro_receive)
                goto out_unlock;
 
-       if (iph->version != 4 || iph->ihl != 5)
+       if (*(u8 *)iph != 0x45)
                goto out_unlock;
 
        if (unlikely(ip_fast_csum((u8 *)iph, iph->ihl)))
@@ -1281,17 +1281,18 @@ static struct sk_buff **inet_gro_receive(struct sk_buff **head,
 
                iph2 = ip_hdr(p);
 
-               if (iph->protocol != iph2->protocol ||
-                   iph->tos != iph2->tos ||
-                   memcmp(&iph->saddr, &iph2->saddr, 8)) {
+               if ((iph->protocol ^ iph2->protocol) |
+                   (iph->tos ^ iph2->tos) |
+                   (iph->saddr ^ iph2->saddr) |
+                   (iph->daddr ^ iph2->daddr)) {
                        NAPI_GRO_CB(p)->same_flow = 0;
                        continue;
                }
 
                /* All fields must match except length and checksum. */
                NAPI_GRO_CB(p)->flush |=
-                       memcmp(&iph->frag_off, &iph2->frag_off, 4) ||
-                       (u16)(ntohs(iph2->id) + NAPI_GRO_CB(p)->count) != id;
+                       (iph->ttl ^ iph2->ttl) |
+                       ((u16)(ntohs(iph2->id) + NAPI_GRO_CB(p)->count) ^ id);
 
                NAPI_GRO_CB(p)->flush |= flush;
        }
@@ -1374,10 +1375,10 @@ EXPORT_SYMBOL_GPL(snmp_fold_field);
 int snmp_mib_init(void *ptr[2], size_t mibsize)
 {
        BUG_ON(ptr == NULL);
-       ptr[0] = __alloc_percpu(mibsize);
+       ptr[0] = __alloc_percpu(mibsize, __alignof__(unsigned long long));
        if (!ptr[0])
                goto err0;
-       ptr[1] = __alloc_percpu(mibsize);
+       ptr[1] = __alloc_percpu(mibsize, __alignof__(unsigned long long));
        if (!ptr[1])
                goto err1;
        return 0;
@@ -1499,7 +1500,7 @@ static int ipv4_proc_init(void);
  *     IP protocol layer initialiser
  */
 
-static struct packet_type ip_packet_type = {
+static struct packet_type ip_packet_type __read_mostly = {
        .type = cpu_to_be16(ETH_P_IP),
        .func = ip_rcv,
        .gso_send_check = inet_gso_send_check,