From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id E77D21B772; Wed, 31 Jan 2018 11:05:04 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jan 2018 02:05:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,439,1511856000"; d="scan'208";a="170548836" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.237.220.145]) ([10.237.220.145]) by orsmga004.jf.intel.com with ESMTP; 31 Jan 2018 02:05:02 -0800 To: Phil Yang , "dev@dpdk.org" Cc: "radoslaw.biernacki@linaro.org" , "stable@dpdk.org" , nd References: From: "Burakov, Anatoly" Message-ID: <1a235b6f-b465-ef04-c941-02b038ac75d5@intel.com> Date: Wed, 31 Jan 2018 10:05:01 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 2/2] test/memzone: handle previously allocated memzones X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jan 2018 10:05:05 -0000 On 31-Jan-18 7:51 AM, Phil Yang wrote: > Hi Anatoly, > > I think your fix is elegant, however you can't grantee it doesn't have dirty memzone remained after memzone autotest. > What if some existed initial memzone released during the test and some dirty memzone remained. The counter cannot illustrate this state. > > My fix just care about the memzone used in memzone autotest. It is rough but it seems more reliable. 😊 > > Thanks, > Phil Yang We could combine the approaches. That way, we both ensure that no memzones were left in that should've been freed, and that total number of memzones didn't change as well (i.e. we didn't allocate/free any memzones we weren't supposed to allocate/free). As i side note, i think making a #define with memzone prefix in your patch will work better and will be less copypaste-error-prone in the long run. I will prepare a v2 combining both approaches. Is that OK with you? > >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Anatoly Burakov >> Sent: Saturday, January 27, 2018 1:41 AM >> To: dev@dpdk.org >> Cc: radoslaw.biernacki@linaro.org; stable@dpdk.org >> Subject: [dpdk-dev] [PATCH 2/2] test/memzone: handle previously allocated >> memzones >> >> Currently, memzone autotest expects there to be no memzones present by the >> time the test is run. Some hardware drivers will allocate memzones for internal >> use during initialization, resulting in tests failing due to unexpected memzones >> being allocated before the test was run. >> >> Fix this by making callback increment a counter instead. This also doubles as a >> test for correct operation of memzone_walk(). >> >> Fixes: 71330483a193 ("test/memzone: fix memory leak") >> Cc: radoslaw.biernacki@linaro.org >> Cc: stable@dpdk.org >> >> Signed-off-by: Anatoly Burakov -- Thanks, Anatoly