From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752111AbdBTDrx (ORCPT ); Sun, 19 Feb 2017 22:47:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55706 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751833AbdBTDrw (ORCPT ); Sun, 19 Feb 2017 22:47:52 -0500 Subject: Re: [PATCH net-next] virito-net: set queues after reset during xdp_set To: "Michael S. Tsirkin" References: <1487149689-28957-1-git-send-email-jasowang@redhat.com> <58A681E7.80907@gmail.com> <20170219064402-mutt-send-email-mst@kernel.org> Cc: John Fastabend , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org From: Jason Wang Message-ID: <2ecb6621-d118-14aa-e935-3ba09e2150f7@redhat.com> Date: Mon, 20 Feb 2017 11:47:46 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170219064402-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 20 Feb 2017 03:47:52 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017年02月19日 13:08, Michael S. Tsirkin wrote: >>>> - oxdp_qp = vi->xdp_queue_pairs; >>>> - >>>> /* Changing the headroom in buffers is a disruptive operation because >>>> * existing buffers must be flushed and reallocated. This will happen >>>> * when a xdp program is initially added or xdp is disabled by removing >>>> * the xdp program resulting in number of XDP queues changing. >>>> */ >>>> if (vi->xdp_queue_pairs != xdp_qp) { >>>> - vi->xdp_queue_pairs = xdp_qp; >>>> err = virtnet_reset(vi); >>>> - if (err) >>>> + if (err) { >>>> + dev_warn(&dev->dev, "XDP reset failure.\n"); >>>> goto virtio_reset_err; >>>> + } >>>> + 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 > Jason, wouldn't you say it's cleaner to avoid resets? > Would you be interested in completing this work: > > 20170207053455-mutt-send-email-mst@kernel.org > > Yes, but this seems still need drop packets, is this acceptable? Thanks