lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170220013627-mutt-send-email-mst@kernel.org>
Date:   Mon, 20 Feb 2017 02:12:18 +0200
From:   "Michael S. Tsirkin" <mst@...hat.com>
To:     John Fastabend <john.fastabend@...il.com>
Cc:     Jason Wang <jasowang@...hat.com>,
        virtualization@...ts.linux-foundation.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] virito-net: set queues after reset during
 xdp_set

On Fri, Feb 17, 2017 at 03:30:51PM -0800, John Fastabend wrote:
> On 17-02-16 09:10 PM, Jason Wang wrote:
> > 
> > 
> > On 2017年02月17日 12:53, John Fastabend wrote:
> >> On 17-02-15 01:08 AM, Jason Wang wrote:
> >>> We set queues before reset which will cause a crash[1]. This is
> >>> because is_xdp_raw_buffer_queue() depends on the old xdp queue pairs
> >>> number to do the correct detection. So fix this by:
> >>>
> >>> - set queues after reset, to keep the old vi->curr_queue_pairs. (in
> >>>    fact setting queues before reset does not works since after feature
> >>>    set, all queue pairs were enabled by default during reset).
> >>> - change xdp_queue_pairs only after virtnet_reset() is succeed.
> >>>
> >>> [1]
> >> I'm guessing this occurs when enabling XDP while receiving lots of traffic?
> > 
> > I hit this then disabling XDP while receiving lots of traffic.
> > 
> 
> [...]
> 
> >>> +        vi->xdp_queue_pairs = xdp_qp;
> >> But xdp_queue_pairs is being used to detect if we should allocate the XDP
> >> headroom. If we move it here do we have a set of buffers in the ring without
> >> the proper headroom when we assign the xdp program below?
> > 
> > Right, so how about passing xdp_queue_pairs as a parameter to virtnet_reset().
> > Then virtnet_reset() can set it after _remove_vq_common() but before
> > virtnet_restore_up()?
> > 
> > Thanks
> > 
> 
> Sounds like a reasonable fix to me.

I'm fine with that.

> >>
> >>> +    }
> >>> +
> >>> +    err = _virtnet_set_queues(vi, curr_qp + xdp_qp);
> >>> +    if (err) {
> >>> +        dev_warn(&dev->dev, "XDP Device queue allocation failure.\n");
> >>> +        goto virtio_queue_err;
> >>>       }
> >>>         netif_set_real_num_rx_queues(dev, curr_qp + xdp_qp);
> >>> @@ -1844,17 +1844,18 @@ static int virtnet_xdp_set(struct net_device *dev,
> >>> struct bpf_prog *prog)
> >>>         return 0;
> >> Thanks,
> >> John
> >>
> > 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ