From: David Woodhouse <dwmw2@infradead.org>
To: Tom Herbert <tom@herbertland.com>
Cc: Jesse Brandeburg <jesse.brandeburg@gmail.com>,
Linux Kernel Network Developers <netdev@vger.kernel.org>
Subject: Re: [RFC PATCH] Fix false positives in can_checksum_protocol()
Date: Mon, 05 Oct 2015 21:22:39 +0100 [thread overview]
Message-ID: <1444076559.4674.205.camel@infradead.org> (raw)
In-Reply-To: <CALx6S34LzN5z3r3U-N_tu_xpzuohiVu1B9-NO5neyDhbmJ20BA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1749 bytes --]
On Mon, 2015-10-05 at 09:23 -0700, Tom Herbert wrote:
>
> 1) Drivers may advertise NETIF_F_HW_CSUM. The stack will indicate
> checksum offload exclusively using the
> CHECKSUM_PARTIAL/csum_start/csum_offset interface. No additional
> interfaces (bits in skbuff should not be needed)
> 2) A driver may inspect packets via ndo_check to decide if it wants to
> offload the checksum, if not cancels NETIF_F_HW_CSUM in the packet.
> 3) In driver xmit when CHECKSUM_PARTIAL is set the driver MUST
> correctly resolve the checksum-- either by properly offloading to the
> device or calling skb_checksum_help.
In cases where they haven't used .ndo_features_check() to ensure that
they don't *see* such packets, sure. But using .ndo_features_check()
should probably be the preferred method.
> 4) To help drivers for devices with limited offload capabilities we'll
> define a helper function to check for typical restrictions (.e.g. IPv4
> only, TCP/UDP only. no encapsulation, no IPv6 extension headers,
> etc.). I am working on this helper function and will send RFC shortly.
I do suspect that helper function would benefit from seeing TCP/UDP
flags in the high bits of csum_offset, rather than grubbing around in
the packet for itself to see if it's really TCP/UDP. After all, it's
almost free to set those in the first place — at least for locally
-generated packets. And not *so* hard to add them in
skb_partial_csum_set(). But hey, if you can push an implementation
which is grubbing around in the packet then at least *I* don't have to
feel dirty for it... :)
--
David Woodhouse Open Source Technology Centre
David.Woodhouse@intel.com Intel Corporation
[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5691 bytes --]
next prev parent reply other threads:[~2015-10-05 20:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-25 12:55 [RFC PATCH] Fix false positives in can_checksum_protocol() David Woodhouse
2015-09-28 17:03 ` Tom Herbert
2015-09-28 18:27 ` David Woodhouse
2015-09-28 19:13 ` Tom Herbert
2015-09-28 19:26 ` David Woodhouse
2015-09-28 19:37 ` Tom Herbert
2015-09-29 1:38 ` Jesse Brandeburg
2015-09-29 3:04 ` Tom Herbert
2015-09-29 7:12 ` David Woodhouse
2015-09-29 22:52 ` Tom Herbert
2015-10-05 11:16 ` David Woodhouse
2015-10-05 16:23 ` Tom Herbert
2015-10-05 18:28 ` Rustad, Mark D
2015-10-05 20:22 ` David Woodhouse [this message]
2015-09-29 7:08 ` David Woodhouse
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=1444076559.4674.205.camel@infradead.org \
--to=dwmw2@infradead.org \
--cc=jesse.brandeburg@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=tom@herbertland.com \
/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;
as well as URLs for NNTP newsgroup(s).