From: Joseph Gasparakis <joseph.gasparakis@intel.com>
To: Tom Herbert <therbert@google.com>
Cc: Joseph Gasparakis <joseph.gasparakis@intel.com>,
Or Gerlitz <or.gerlitz@gmail.com>,
Or Gerlitz <ogerlitz@mellanox.com>,
David Miller <davem@davemloft.net>,
Linux Netdev List <netdev@vger.kernel.org>,
Jerry Chu <hkchu@google.com>, Eric Dumazet <edumazet@google.com>
Subject: Re: [PATCH 2/3] net: UDP gro_receive accept csum=0
Date: Fri, 14 Feb 2014 10:34:56 -0800 (PST) [thread overview]
Message-ID: <alpine.LFD.2.03.1402141034180.25492@intel.com> (raw)
In-Reply-To: <CA+mtBx8qbLU3vgDjPQPtU47+FS9R7f24gYw5wE+yNC7DGg-E4A@mail.gmail.com>
On Thu, 13 Feb 2014, Tom Herbert wrote:
> >> > But even worse, is there a fundamental issue where udp4_csum_init is able
> >> > to change ip_summed to be CHECKSUM_UNNECESSARY (either check == 0
> >> > or ip_summed == CHECKSUM_UNNECESSARY) regardless of
> >> > skb->encapsulation, sending the packet into encap_rcv which could
> >> > ultimately incorrectly apply ip_summed on the inner TCP/UDP packet?
> >>
> >> By fundamental you mean performance issue or functionality issue (bug) or both?
> >>
> >
> > I would expect the check to be for ip_summed == CHECKSUM_UNNECESSARY. This
> > was the original thought behind commit:
> >
> > 0afb166 vxlan: Add capability of Rx checksum offload for inner packet
>
> It looks like udp4_csum_init turns CHECKSUM_COMPLETE and check==0 into
> CHECKSUM_UNNECESSARY which could bypass the checksum validation for
> the encapsulated packet. This would be a significant functionality
> bug. Unfortunately udp4_csum_init writes ip_summed without regard to
> encapsulation.
>
> Seems like the logic in the UDP rcv path should be:
>
> if ip_summed == CHECKSUM_COMPLETE, ensure this is same value when
> calling encap_rcv
> if ip_summed == CHECKSUM_UNNECESSARY && !skb->encap change to
> CHECKSUM_NONE before calling encap_rcv
> if ip_summed == CHECKSUM_UNNECESSARY && skb->encap ip_summed value is okay
>
> In any case, we need to consider the orignal ip_summed value from the
> driver, not the one that udp4_csum_init (udp_gro or anywhere else in
> the path) would set.
>
> Also, udp_gro_receive should be able to handle the case where
> ip_summed == CHECKSUM_UNNECESSARY and !skb->encapsulation, that will
> be very common scenario. Probably CHECKSUM_NONE also.
>
Yes, I now see your point and totaly agree. Thanks.
next prev parent reply other threads:[~2014-02-14 18:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-11 17:43 [PATCH 2/3] net: UDP gro_receive accept csum=0 Tom Herbert
2014-02-13 8:06 ` Or Gerlitz
2014-02-13 22:27 ` Tom Herbert
2014-02-13 22:50 ` Or Gerlitz
2014-02-14 0:04 ` Joseph Gasparakis
2014-02-14 0:59 ` Tom Herbert
2014-02-14 18:34 ` Joseph Gasparakis [this message]
2014-02-14 23:54 ` Tom Herbert
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=alpine.LFD.2.03.1402141034180.25492@intel.com \
--to=joseph.gasparakis@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkchu@google.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=or.gerlitz@gmail.com \
--cc=therbert@google.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).