Hi Herbert,

Things seem to be more clear for me.

When not in netpoll mode, before an udp package passed to "udp_rcv",
the ip layer will call the routine  "__skb_checksum_complete(skb);" 
to do the checksum. After ip checksum, "skb->ip_summed" will be
assigned to CHECKSUM_UNNECESSARY.
============================================================
unsigned int __skb_checksum_complete(struct sk_buff *skb)
{
        unsigned int sum;

        sum = (u16)csum_fold(skb_checksum(skb, 0, skb->len, skb->csum));
        if (likely(!sum)) {
                if (unlikely(skb->ip_summed == CHECKSUM_HW))
                        netdev_rx_csum_fault(skb->dev);
                skb->ip_summed = CHECKSUM_UNNECESSARY;
        }
        return sum;
}
============================================================
So, in the routine "udp_rcv", actually, the csum is not checked.
Consequently, udp has no problem in the non-netpoll mode.

When in the netpoll mode, ip checksum is implemented by the routine
"ip_fast_csum", which does not assgin CHECKSUM_UNNECESSARY to
"skb->ip_summed", so udp has to  check sum. Although checksum_udp in
the netpoll mode uses the same method  as non-netpoll mode(see below),
it failed still.
============================
       skb->csum = csum_tcpudp_nofold(saddr, daddr, ulen, IPPROTO_UDP, 0);
       return __skb_checksum_complete(skb);
============================
So, Is the udp checksum algorithm wrong? or should we add one line
------------------------------
skb->ip_summed = CHECKSUM_UNNECESSARY;
------------------------------
after/into the routine "ip_fast_csum"?

Regards,
-Aubrey
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to