Subject: Re: calculation in UDP
To: Thomas Finneid <tfinneid@ifi.uio.no>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: tech-net
Date: 12/08/2002 07:49:06
On Sun, Dec 08, 2002 at 04:31:30PM +0100, Thomas Finneid wrote:
> Ok, so this is why the ip processing is consuming so many clock cycles. I
> have'nt gotten to the details of the ip part just yet. I thought the
> checksum might have be done in the socket layer when copying the data from
> the user process, but I could'nt find it there either.
Right. And, to be accurate, it's not like this makes IP processing "more
expensive", because the deferred checksum only happens if a higher-level
protocol set it up, and that higher-level protocol would have had to pay
the cost of the checksum anyway. We are just deferring it until we know
whether or not it will be needed.
> The page loan stuff(zero-copy path ?) in the socket layer, do I understand
> it right in that it transfers ownership, temporarily, of the page from the
> process to the kernel so as to avoid the data copying at that level? So the
> data is only copied when transferred from memory to the NIC,
Correct. Note, in most cases, the "copy" that happens from memory->NIC
is DMA by the NIC itself, so the CPU is not directly involved in the data
movement.
--
-- Jason R. Thorpe <thorpej@wasabisystems.com>