From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id 63FDB29D6 for ; Sat, 27 Jan 2018 15:46:32 +0100 (CET) Received: by mail-wm0-f67.google.com with SMTP id t74so6352749wme.3 for ; Sat, 27 Jan 2018 06:46:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8fZMWoaMqpaeGKYlNv8Uk7xtPxXof1cClfurbn9y38Y=; b=LOFScUHhMu50c4kY4jzWy3bdxYeMzERpvLJu6vhFiy5l0LTZoZq8yUrpMq3EVEmdXb YfOoY9Uj39xY7xktobfdZ+AsHXyxg00fL5fedeWeyKwDf8WfT9H018bh7GZNCiFB0KOk 9vQH3kHT8+y56tItR8hpfD5OkTOeeyHRk1dH8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8fZMWoaMqpaeGKYlNv8Uk7xtPxXof1cClfurbn9y38Y=; b=dDOmxCq2RrjF7POg6iSCVbM7ee1gFKRlO0rZgYi1vOMIUrF1Mzk3lzzLbmwlEqZUBs w0zLdnThISFSlJAxPEUbKXS5RbO2H3KrE9GpRyRDGGKDgGO9YFKqlCmd15b0lEO3oVm6 rYtml+fyMfe/zkAZF30dO0M9OYwga+nabA0Wsg48yQ6bQmIw5USheNp7i5PAwNxjb5VP Nz5OtmNy7SOiiJPHEbZvC1b6Prhy02FlqAdRAYgRYLchrsN4+f9iibC4jryE5pjHMgb5 4TjY5B1KahszERVtsn3NYURTH67hLOZT2FwAjDTgAxTY2n3pwBFyu693GlmwUBSGyrVV QVxQ== X-Gm-Message-State: AKwxytcwGd5joVjabH5S9+V9VNimtt5+f/kllHn9CTrLuydk8zOTM/1E kPqB2xKaSks9oNDcCf+na4qvfheona/A1Sbm8hv0Kw== X-Google-Smtp-Source: AH8x224Qv+IBBixQkls2UoQAYhJMZ8j5HsFxJi0Hsg3B13Lffnjg4MWEmU5c3Tfq7PC+TcphU8LmQ9fzlvhv3eiIHEI= X-Received: by 10.28.193.196 with SMTP id r187mr14864567wmf.111.1517064392042; Sat, 27 Jan 2018 06:46:32 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.167.10 with HTTP; Sat, 27 Jan 2018 06:46:11 -0800 (PST) In-Reply-To: References: From: Radoslaw Biernacki Date: Sat, 27 Jan 2018 15:46:11 +0100 Message-ID: To: Anatoly Burakov Cc: dev@dpdk.org, stable@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-stable] [PATCH 2/2] test/memzone: handle previously allocated memzones 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: Sat, 27 Jan 2018 14:46:32 -0000 Thanks, looks OK for me. Reviewed-by: Radoslaw Biernacki adoslaw.biernacki@linaro.com> On 26 January 2018 at 18:40, Anatoly Burakov wrote: > 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 > --- > test/test/test_memzone.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/test/test/test_memzone.c b/test/test/test_memzone.c > index 00d340f..5428b35 100644 > --- a/test/test/test_memzone.c > +++ b/test/test/test_memzone.c > @@ -953,16 +953,19 @@ test_memzone_basic(void) > return 0; > } > > -static int memzone_walk_called; > +static int memzone_walk_cnt; > static void memzone_walk_clb(const struct rte_memzone *mz __rte_unused, > void *arg __rte_unused) > { > - memzone_walk_called = 1; > + memzone_walk_cnt++; > } > > static int > test_memzone(void) > { > + /* take note of how many memzones were allocated before running */ > + int memzone_cnt = rte_eal_get_configuration()-> > mem_config->memzone_cnt; > + > printf("test basic memzone API\n"); > if (test_memzone_basic() < 0) > return -1; > @@ -1000,8 +1003,9 @@ test_memzone(void) > return -1; > > printf("check memzone cleanup\n"); > + memzone_walk_cnt = 0; > rte_memzone_walk(memzone_walk_clb, NULL); > - if (memzone_walk_called) { > + if (memzone_walk_cnt != memzone_cnt) { > printf("there are some memzones left after test\n"); > rte_memzone_dump(stdout); > return -1; > -- > 2.7.4 >