From: Andy Grover Subject: netfront leaking two pages on unload? Date: Wed, 16 Jan 2008 13:16:28 -0800 Message-ID: <1200518188.2845.78.camel@lute.groveronline.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org Hi all, It appears netfront is leaking 2 pages (info->tx.sring and rx.sring) on netfront unload, because netback is not unmapping them when entering the Closed state. I came across this while working on the Windows Xennet driver unload routines. I am trying to end access to those two pages after both netfront and netback are in the "Closed" state (having passed through "Closing") but they are still in use. See below from netback/xenbus.c. Backend is online: case XenbusStateClosed: xenbus_switch_state(dev, XenbusStateClosed); if (xenbus_dev_is_online(dev)) break; /* fall through if not online */ Should it instead be: case XenbusStateClosed: if (xenbus_dev_is_online(dev)) { struct backend_info *be = dev->dev.driver_data; netif_disconnect(be->netif); break; } xenbus_switch_state(dev, XenbusStateClosed); /* fall through if not online */ ? Otherwise the pages cannot be freed properly in the guest, right? Thanks -- Regards -- Andy