From: Paolo Abeni <pabeni@redhat.com>
To: Matthias Treydte <mt@waldheinz.de>
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
David Ahern <dsahern@gmail.com>,
stable@vger.kernel.org, netdev@vger.kernel.org,
regressions@lists.linux.dev, davem@davemloft.net,
yoshfuji@linux-ipv6.org, dsahern@kernel.org
Subject: Re: [regression] UDP recv data corruption
Date: Fri, 02 Jul 2021 17:32:54 +0200 [thread overview]
Message-ID: <54cd08089682aa14cc43236b0799ebf8424a23c5.camel@redhat.com> (raw)
In-Reply-To: <20210702172345.Horde.VhYvsDcOcRfOxOFrUo9F1Ge@mail.your-server.de>
On Fri, 2021-07-02 at 17:23 +0200, Matthias Treydte wrote:
> Quoting Paolo Abeni <pabeni@redhat.com>:
>
> > ---
> > diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
> > index 54e06b88af69..458c888337a5 100644
> > --- a/net/ipv4/udp_offload.c
> > +++ b/net/ipv4/udp_offload.c
> > @@ -526,6 +526,8 @@ struct sk_buff *udp_gro_receive(struct list_head
> > *head, struct sk_buff *skb,
> > if ((!sk && (skb->dev->features & NETIF_F_GRO_UDP_FWD)) ||
> > (sk && udp_sk(sk)->gro_enabled) ||
> > NAPI_GRO_CB(skb)->is_flist)
> > pp =
> > call_gro_receive(udp_gro_receive_segment, head, skb);
> > + else
> > + goto out;
> > return pp;
> > }
>
> Impressive! This patch, applied to 5.13, fixes the problem. What I
> like even more is that it again confirms my suspicion that an "if"
> without an "else" is always a code smell. :-)
Thank you for the quick feedback! I'll submit formally soon, after more
tests. I'll probably change the code to be something hopefully more
readable, as follow:
---
diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
index 7a670757f37a..b3aabc886763 100644
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -551,8 +551,10 @@ struct sk_buff *udp_gro_receive(struct list_head *head, struct sk_buff *skb,
if ((!sk && (skb->dev->features & NETIF_F_GRO_UDP_FWD)) ||
(sk && udp_sk(sk)->gro_enabled) || NAPI_GRO_CB(skb)->is_flist)
- pp = call_gro_receive(udp_gro_receive_segment, head, skb);
- return pp;
+ return call_gro_receive(udp_gro_receive_segment, head, skb);
+
+ /* no GRO, be sure flush the current packet */
+ goto out;
}
---
> With this and the reproducer in my previous mail, is there still value
> in doing the "perf" stuff?
Not needed, thank you!
Would be great instead if you could have a spin to the proposed variant
above - not stritly needed, I'm really asking for a few extra miles
here ;)
Cheers,
Paolo
next prev parent reply other threads:[~2021-07-02 15:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-01 10:47 [regression] UDP recv data corruption Matthias Treydte
2021-07-01 15:39 ` David Ahern
2021-07-02 0:31 ` Willem de Bruijn
2021-07-02 11:42 ` Paolo Abeni
2021-07-02 14:31 ` Matthias Treydte
2021-07-02 12:36 ` Matthias Treydte
2021-07-02 14:06 ` Paolo Abeni
2021-07-02 14:21 ` Paolo Abeni
2021-07-02 15:23 ` Matthias Treydte
2021-07-02 15:32 ` Paolo Abeni [this message]
2021-07-02 16:07 ` Matthias Treydte
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=54cd08089682aa14cc43236b0799ebf8424a23c5.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=dsahern@kernel.org \
--cc=mt@waldheinz.de \
--cc=netdev@vger.kernel.org \
--cc=regressions@lists.linux.dev \
--cc=stable@vger.kernel.org \
--cc=willemdebruijn.kernel@gmail.com \
--cc=yoshfuji@linux-ipv6.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).