Re: Are "skb->data" physically continuous?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 16, 2003 at 02:16:21PM +0300, Nick Patavalis wrote:

 <refering to the receive-path>

>
> What should the driver / hardware fill-in as checksum values for IP /
> TCP / UDP checksums? Will it fill-in pseudo-header ckecksums so that
> the kernel can easily veryfy them, or complete payload-also checksums?
> In the e100 case, does the hardware fill-in these pseude-checksums by
> itself (or does the driver do it)? 
>

These are, of-course, bullshit!

In the receive-path, the driver / device does not need to fill-in any
checksum values (as they are allready part of the received packet). It
only needs to *verify* these checksums, and if they are invalid to set
the "skb->ip_summed" field to "CHECKSUM_NONE" (forcing the kernel to
recalculate them, and hence find-out anew that they are invalid). If
they are valid it should set the "skb->ip_summed" field to either
"CHECKSUM_UNNECESSARY" or to "CHECKSUM_HW".

The difference between the two (UNNECESSARY and HW) in this case,
escapes me. There are some comments in skbuff.h, but to me they are
almost unparsable:

    UNNECESSARY: device parsed packet and wouldbe verified checksum.
       skb->csum is undefined.
       It is bad option, but, unfortunately, many of vendors do this.
       Apparently with secret goal to sell you new device, when you
       will add new protocol to your host. F.e. IPv6. 8)

    HW: the most generic way. Device supplied checksum of _all_
       the packet as seen by netif_rx in skb->csum.
       NOTE: Even if device supports only some protocols, but
       is able to produce some skb->csum, it MUST use HW,
       not UNNECESSARY.

If anyone can shed some light to this, and especialy if somebody could
explain what "skb->csum" should keep, and what it is used for, I would
be grateful.

/npat

-- 
I'm writing a book.  I've got the page numbers done.
  -- Stephen Wright
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux