Subject: Re: [PATCH net] net/packet: tpacket_rcv: do not increment ring index on drop

From: "Michael S. Tsirkin" <[email-masked]>
Date: Tue, 10 Mar 2020 02:46:10 -0400

On Mon, Mar 09, 2020 at 11:50:23AM -0400, Willem de Bruijn wrote:
> On Mon, Mar 9, 2020 at 11:42 AM Willem de Bruijn
> <[email-masked]> wrote:
> >
> > On Mon, Mar 9, 2020 at 11:34 AM Willem de Bruijn
> > <[email-masked]> wrote:
> > >
> > > From: Willem de Bruijn <[email-masked]>
> > >
> > > In one error case, tpacket_rcv drops packets after incrementing the
> > > ring producer index.
> > >
> > > If this happens, it does not update tp_status to TP_STATUS_USER and
> > > thus the reader is stalled for an iteration of the ring, causing out
> > > of order arrival.
> > >
> > > The only such error path is when virtio_net_hdr_from_skb fails due
> > > to encountering an unknown GSO type.
> > >
> > > Signed-off-by: Willem de Bruijn <[email-masked]>
> >
> >
> > Fixes: bfd5f4a3d605 ("packet: Add GSO/csum offload support.")
> >
> > I forgot to add the Fixes tag, sorry. This goes back to the
> > introduction of GSO support for virtio_net.
> 
> The problem of blinding receivers to certain packet types goes back to
> that commit.
> 
> But the specific issue of ring out of order arrival is added later,
> when vnet_hdr support is extended to tpacket_rcv:
> 
> Fixes: 58d19b19cd99 ("packet: vnet_hdr support for tpacket_rcv")

In fact it looks like

commit 9fd1ff5d2ac7181844735806b0a703c942365291
Author: Steffen Klassert <[email-masked]>
Date:   Sat Jan 25 11:26:45 2020 +0100

    udp: Support UDP fraglist GRO/GSO.

and

commit 90017accff61ae89283ad9a51f9ac46ca01633fb
Author: Marcelo Ricardo Leitner <[email-masked]>
Date:   Thu Jun 2 15:05:43 2016 -0300

    sctp: Add GSO support
    
both break userspace using virtio due to lack of fallback...

-- 
MST