From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH v2 net-next] veth: Free queues on link delete Date: Tue, 14 Aug 2018 19:29:52 -0600 Message-ID: <990e3b33-02b9-c6a6-a48e-8fcc52bdcde9@gmail.com> References: <20180815010418.5521-1-dsahern@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: davem@davemloft.net To: Toshiaki Makita , dsahern@kernel.org, netdev@vger.kernel.org Return-path: Received: from mail-pf1-f170.google.com ([209.85.210.170]:39327 "EHLO mail-pf1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725847AbeHOETq (ORCPT ); Wed, 15 Aug 2018 00:19:46 -0400 Received: by mail-pf1-f170.google.com with SMTP id j8-v6so10048716pff.6 for ; Tue, 14 Aug 2018 18:29:54 -0700 (PDT) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 8/14/18 7:16 PM, Toshiaki Makita wrote: > Hmm, on second thought this queues need to be freed after veth_close() > to make sure no packet will reference them. That means we need to free > them in .ndo_uninit() or destructor. > (rtnl_delete_link() calls dellink() before unregister_netdevice_many() > which calls dev_close_many() through rollback_registered_many()) > > Currently veth has destructor veth_dev_free() for vstats, so we can free > queues in the function. > To be in line with vstats, allocation also should be moved to > veth_dev_init(). given that, can you take care of the free in the proper location?