All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Sean Tranchetti <stranche@codeaurora.org>,
	davem@davemloft.net, netdev@vger.kernel.org
Cc: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Subject: Re: [PATCH net-next] udp: Avoid post-GRO UDP checksum recalculation
Date: Fri, 24 May 2019 14:50:45 +0200	[thread overview]
Message-ID: <1d96f8253ade31028489351fbfacedfc12cdae39.camel@redhat.com> (raw)
In-Reply-To: <1558640177-10984-1-git-send-email-stranche@codeaurora.org>

On Thu, 2019-05-23 at 13:36 -0600, Sean Tranchetti wrote:
> Currently, when resegmenting an unexpected UDP GRO packet, the full UDP
> checksum will be calculated for every new SKB created by skb_segment()
> because the netdev features passed in by udp_rcv_segment() lack any
> information about checksum offload capabilities.
> 
> We have no need to perform this calculation again, as
>   1) The GRO implementation guarantees that any packets making it to the
>      udp_rcv_segment() function had correct checksums, and, more
>      importantly,
>   2) Upon the successful return of udp_rcv_segment(), we immediately pull
>      the UDP header off and either queue the segment to the socket or
>      hand it off to a new protocol handler. In either case, the checksum
>      is not needed.

I *think* there is a possible, even if unlikely, exception to the
above: if userspace has set the IP_CHECKSUM sockopt, recvmsg can later
try to access skb csum.

I think that setting NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM only if
!inet_get_convert_csum() would address the above,

Other than that LGTM, thanks for catching this!

Paolo

p.s. I suspect that with this patch GRO + resegmentation is notably
faster than the plain unaggregated path, do you have by chance any
related datapoint?


  reply	other threads:[~2019-05-24 12:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23 19:36 [PATCH net-next] udp: Avoid post-GRO UDP checksum recalculation Sean Tranchetti
2019-05-24 12:50 ` Paolo Abeni [this message]
2019-05-25 17:53 ` David Miller

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=1d96f8253ade31028489351fbfacedfc12cdae39.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=stranche@codeaurora.org \
    --cc=subashab@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.