From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id 873F72904; Fri, 21 Apr 2017 01:23:41 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 3811920A78; Thu, 20 Apr 2017 19:23:41 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 20 Apr 2017 19:23:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=0T3fxSGUEbBtRkI djosepTDIghbaKYKYJNPQ3US92zw=; b=WECALQQIz7UkmWnE2IIdXKhGveWhlye 8ZitKwW/I6xkVcqHt0igfabQygZ00snNZ4usyRzkzne7IcbqFr/pVXoL3xo2INYf 8wFsEf/YA1ejSHklRk+KfmutcamGsTEezbNxdYLPlyYm/TlsiInhKlRAi2KKYKI/ PS97QuE/iDRs= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=0T3fxSGUEbBtRkIdjosepTDIghbaKYKYJNPQ3US92zw=; b=jJGPHg4y Y/QoxomlnONMkZRRZBV4UJBz9OPT7iPFdiQOyXc7z6ArJmPUQoNJmWRoBApARgqu yarS43+tkT87UydjeV9/WPwmvB5aYn/csKpityjjoCR+CsXykA7NibWRv1NyAqRr i0PvqLUDuARW0duKm17i8LubikQB6KuHWWjMJRxTSy3rBktFCm1ycdFA2XV3P9z8 DAEejtaTkx3h74Vnp1Y4I4t3RQd32lHGpK7hwkjUDkzLL5OT05B2K2PEAlLoPtHA rqVMi7doLJQ8tuqdPsHiOU/wz6nv+lN6ojL3kapE/u3/44IIDu4ZOEMQK+QwEA4W 2gcvS/LWcRvI2Q== X-ME-Sender: X-Sasl-enc: N5hwLc6az3saNaaSmFqdtI52WgqJhsZOMk32WTiCICs0 1492730620 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id E7C1E241ED; Thu, 20 Apr 2017 19:23:40 -0400 (EDT) From: Thomas Monjalon To: Ferruh Yigit Cc: stable@dpdk.org, dev@dpdk.org Date: Fri, 21 Apr 2017 01:23:40 +0200 Message-ID: <5601561.lanJxOWneZ@xps> In-Reply-To: <20170418142144.6762-1-ferruh.yigit@intel.com> References: <20170418142144.6762-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-stable] [PATCH] kni: fix possible memory leak X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Apr 2017 23:23:41 -0000 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