Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: johannes@sipsolutions.net
Cc: netdev@vger.kernel.org, herbert@gondor.apana.org.au,
	linux-wireless@vger.kernel.org
Subject: Re: S/G operation, skb checksums, data copying
Date: Sun, 04 May 2008 15:50:47 -0700 (PDT)	[thread overview]
Message-ID: <20080504.155047.56630645.davem@davemloft.net> (raw)
In-Reply-To: <1209925725.3655.15.camel@johannes.berg>

From: Johannes Berg <johannes@sipsolutions.net>
Date: Sun, 04 May 2008 20:28:45 +0200

> Should we do IP checksumming in software within mac80211, announce s/g
> support and hardware checksumming to the rest of the networking layer
> and hope that we only have to copy the header instead of the data for
> many packets then, if the underlying hardware is capable enough?

No, this doesn't work.

There is a correctness reason why we don't allow SG without HW
checksum support.

Those scatter-gather pages could be in the page cache for a sendfile()
or similar operation.

Any process in the system can write into and change the contents of
those pages while the packet is still in flight to the device.

So the only way to always generate correct checksums is to enforce
that the hardware do it once the full packet is in the device FIFO
after being DMA'd.

If you do the checksum in software, we'll generate incorrect checksums
if another process is writing into the page at the same time, so we
must not allow this.

      parent reply	other threads:[~2008-05-04 22:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-04 18:28 S/G operation, skb checksums, data copying Johannes Berg
     [not found] ` <1209925725.3655.15.camel-YfaajirXv214zXjbi5bjpg@public.gmane.org>
2008-05-04 18:58   ` Johannes Berg
2008-05-04 22:50 ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080504.155047.56630645.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox