Subject: Re: Hardware IPv4/TCP/UDP checksumming support
To: =?iso-8859-1?B?UOVs?= Halvorsen <email@example.com>
From: Andreas Persson <firstname.lastname@example.org>
Date: 09/06/2001 22:19:44
On Thu, Sep 06, 2001 at 01:48:46PM +0200, Pål Halvorsen <email@example.com> wrote:
>On Thu, 6 Sep 2001, Ignatios Souvatzis wrote:
>> On Thu, Sep 06, 2001 at 01:17:57PM +0200, Pål Halvorsen wrote:
>> > If we assume using NIC DMA to access main memory and using UDP/IP
>> > calculating UDP checksum, filling the IP header and caclulating IP header
>> > checksum.
>> > Does this mean that the checksum offload requires more bus transfers than
>> > native checksum mechanisms only transfering the original packet once?
>> > (data and UDP header twice, and IP header three times - including the
>> > UDPIP pseudo header used during UDP checksum)
>> > Or is the data transfered to the NIC during UDP checksum and only the
>> > headers are transfered several times?
It seems like it would transfer it some onboard memory, otherwise it can be
starved for bus accesses. With gigabit ethernet, its crucial to have
packets ready to send all the time in order to get decent performance.
Also note that you can essentially get the checksum for free when copying
the data into kernel space. Linux does this last I checked. Hopefully
we'll get zero copy tcp instead.
>> There is a third option. Never return the checksum to the cpu's main memory.
>Nevertheless, the headers are used both before and after checksum
>operations. Thus, the header itself must be available in the cpu's main
>memory during the rest of the protocol processing. Which means that at
>least the headers should be transfered several times over the bus!???
>That is if not the whole protocol processing is done on-board the NIC...
>> I don't know what is implemented by the hardware & driver in question, but
>> you can easily check that yourself.
>I'm using the ti driver. How do you tell the system to use HW
>checksumming, setsockopt/ioctl? Or is it default if an on-board NIC CPU is
>present? Do you know a nice starting point to look at the code?
I had to switch it on with ifconfig(8) for my 3com card (ex). Works great!