From: David Miller <davem@davemloft.net>
To: dwmw2@infradead.org
Cc: netdev@vger.kernel.org
Subject: Re: [RFC PATCH 1/3] Avoid making inappropriate requests of NETIF_F_V[46]_CSUM devices
Date: Wed, 16 Jan 2013 15:54:06 -0500 (EST) [thread overview]
Message-ID: <20130116.155406.351676228334066120.davem@davemloft.net> (raw)
In-Reply-To: <1358165431.27054.62.camel@shinybook.infradead.org>
From: David Woodhouse <dwmw2@infradead.org>
Date: Mon, 14 Jan 2013 12:10:31 +0000
> Devices with the NETIF_F_V[46]_CSUM feature(s) are *only* required to
> handle checksumming of UDP and TCP.
>
> In netif_skb_features() we attempt to filter out the capabilities which
> are inappropriate for the device that the skb will actually be sent
> from... but there we assume that NETIF_F_V4_CSUM devices can handle
> *all* Legacy IP, and that NETIF_F_V6_CSUM devices can handle *all* IPv6.
>
> This may have been OK in the days when CHECKSUM_PARTIAL packets would
> *only* be produced by the local stack, and we knew the local stack
> didn't generate them for anything but UDP and TCP. But these days that's
> not true. When a tun device receives a packet from userspace with
> VIRTIO_NET_HDR_F_NEEDS_CSUM, that translates fairly directly into
> setting CHECKSUM_PARTIAL on the resulting skb. Since virtio_net
> advertises NETIF_F_HW_CSUM to its guests, we should expect to be asked
> to checksum *anything*.
My opinion on this is that the injectors of packets are responsible
for ensuring checksum types are set on SKBs in an appropriate way.
So we ensure this in the local protocol stacks that generate packets,
and if foreign alien entities can inject SKBs with these checksum
settings (like the tun device can) the burdon of verification falls
upon whatever layer allows that to happen.
So really, the fix is in the tun device and the virtio layer.
next prev parent reply other threads:[~2013-01-16 20:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-14 12:10 [RFC PATCH 1/3] Avoid making inappropriate requests of NETIF_F_V[46]_CSUM devices David Woodhouse
2013-01-14 12:12 ` [RFC PATCH 2/3] Prepare to allow for hardware checksum of ICMPv6 David Woodhouse
2013-01-14 12:15 ` [RFC PATCH 3/3] Use hardware checksum for UDPv6 and ICMPv6 David Woodhouse
2013-01-16 20:54 ` David Miller [this message]
2013-01-16 22:34 ` [RFC PATCH 1/3] Avoid making inappropriate requests of NETIF_F_V[46]_CSUM devices David Woodhouse
2013-01-16 23:00 ` David Miller
2013-01-17 0:03 ` David Woodhouse
2013-01-29 16:35 ` David Woodhouse
2015-09-21 16:29 ` David Woodhouse
2015-09-23 15:42 ` 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=20130116.155406.351676228334066120.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=dwmw2@infradead.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;
as well as URLs for NNTP newsgroup(s).