From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [dpdk-stable] [PATCH] kni: fix possible memory leak Date: Fri, 21 Apr 2017 01:23:40 +0200 Message-ID: <5601561.lanJxOWneZ@xps> References: <20170418142144.6762-1-ferruh.yigit@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: stable@dpdk.org, dev@dpdk.org To: Ferruh Yigit Return-path: In-Reply-To: <20170418142144.6762-1-ferruh.yigit@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 18/04/2017 16:21, Ferruh Yigit: > alloc_q and rx_q fifos holds physical address of the mbufs, and not able > to free those mbufs explicitly. > > But kernel thread reads from rx_q and puts used mbufs into free_q (with > their virtual addresses.) And kernel thread stopped when application > close the /dev/kni file on exit. So rx_q has time to be consumed by > kernel thread but leak is technically possible. > > Another fifo, alloc_q has physical addresses too, but all those coming > from same mempool provided by application, when application quit, all > mempool already returned back, so this leak can be ignored. > > Added check and wait logic for rx_q to be sure kernel consumed the fifo, > an error message printed after some ammount of wait, and an explicit > mempool free added for alloc_q. > > Fixes: 8451269e6d7b ("kni: remove continuous memory restriction") > Cc: stable@dpdk.org > > Signed-off-by: Ferruh Yigit Applied, thanks