From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1BBA1A0C4C for ; Fri, 20 Aug 2021 10:52:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0617A41255; Fri, 20 Aug 2021 10:52:58 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 6236341139 for ; Fri, 20 Aug 2021 10:52:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629449574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=07p7tSV9lZWZFeLZ/xiDLw8GKLOnC16ghu7Wl/jQYIQ=; b=cA83MQR+8OqvtkMlY5xb3Rb6DAZQE1nZWL9FN/24DKd10iA4MrcX13aKI7pTRYEqJDDQMz ek5pALzE320mfxo4XX9fyzE0lcAOD4/58oVHP1bUQ3gGcQo9+OiU4CveHIsVcNA94BfsEf qpG39diFzbhRCJtoLZ/zE3/gWkiQnOg= Received: from mail-vs1-f69.google.com (mail-vs1-f69.google.com [209.85.217.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-494-4XEdav_gMJC_mf01jGvs6A-1; Fri, 20 Aug 2021 04:52:53 -0400 X-MC-Unique: 4XEdav_gMJC_mf01jGvs6A-1 Received: by mail-vs1-f69.google.com with SMTP id i186-20020a6722c30000b02902bc73413510so1519822vsi.10 for ; Fri, 20 Aug 2021 01:52:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=07p7tSV9lZWZFeLZ/xiDLw8GKLOnC16ghu7Wl/jQYIQ=; b=pjhNdlj1ms2vjtU9tFitesR9Oqt/rpha75BryOAYAYsI4w2Kmymc2NUq5PnxwkdwN9 u36H2P9SejUtkl3Ny6m0bbEXVQ7klVb7HnevxhmMZcjerdv38hmOari7JuTwICF05HOB 4phblRZy0WJa2S2WFliwkLrYbAq5e5GUfl5PHAepXM+7HsiSupv6F3A2GXs9EFV+wnoj r2JifPORrWx7UAn76+LVx2kS4Iz1AE/F5wWK6VsCmgIUM6CmGtkxMINm1SQs8ei6BkNn zEPSwvWhfsFEsc3/6KS8G6vFfcpHCqSu8HZg9EaPrpRlonQpAb4wIq+VWYHC2yb1MMSM g4hg== X-Gm-Message-State: AOAM532IAJmYljtOjIEDJAL8oFddFKLG+33Z5W2tAUHjei9v9Zt/S0yW /bg76ReFNKc+9BzzkYl/1LLRxONXBRLdaEa8Bd8h6vASQ7Ok2o1rd394r4RNBmMVVQkE3cXPt9t K2PARFygnsKQBVBapxjfyiaM= X-Received: by 2002:a67:ec98:: with SMTP id h24mr16193678vsp.10.1629449573153; Fri, 20 Aug 2021 01:52:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhIGrxUZNonBmiKNLTBJIEX1KRM0FQOq1N6u+o5E5asQMc6Dzwy0a8B+ubQCo08OB8oShpvYG6J9O3GDbTNMk= X-Received: by 2002:a67:ec98:: with SMTP id h24mr16193660vsp.10.1629449572870; Fri, 20 Aug 2021 01:52:52 -0700 (PDT) MIME-Version: 1.0 References: <20210728073322.27011-1-joyce.kong@arm.com> <20210731120336.30886-1-joyce.kong@arm.com> In-Reply-To: From: David Marchand Date: Fri, 20 Aug 2021 10:52:41 +0200 Message-ID: To: Joyce Kong Cc: "Burakov, Anatoly" , Olivier Matz , Andrew Rybchenko , "Wang, Yipeng1" , "Gobriel, Sameh" , Bruce Richardson , Vladimir Medvedkin , "Ananyev, Konstantin" , Honnappa Nagarahalli , Ruifeng Wang , dev , nd , dpdk stable , Aaron Conole Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2] test/func_reentrancy: free memzones after creating test case X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On Fri, Aug 20, 2021 at 9:57 AM Joyce Kong wrote: > > > -----Original Message----- > > From: David Marchand > > Sent: Tuesday, August 17, 2021 4:17 PM > > To: Joyce Kong > > Cc: Burakov, Anatoly ; Olivier Matz > > ; Andrew Rybchenko > > ; Wang, Yipeng1 > > ; Gobriel, Sameh ; > > Bruce Richardson ; Vladimir Medvedkin > > ; Ananyev, Konstantin > > ; Honnappa Nagarahalli > > ; Ruifeng Wang > > ; dev ; nd ; dpdk > > stable ; Aaron Conole > > Subject: Re: [dpdk-dev] [PATCH v2] test/func_reentrancy: free memzones > > after creating test case > > > > On Sat, Jul 31, 2021 at 2:04 PM Joyce Kong wrote: > > > > > > Function reentrancy test limits maximum number of iterations > > > simultaneously, however it doesn't free the 'fr_test_once' > > > memzones after the fact, so introduce freeing 'fr_test_once' > > > in ring/mempool/hash/fbk/lpm_clean. > > > > > > Meanwhile, add the missing free for test case on main thread. > > > > > > Fixes: 104a92bd026f ("app: add reentrancy tests") > > > Fixes: 995eec619024 ("test: clean up memory for function reentrancy > > > test") > > > Cc: stable@dpdk.org > > > > > > Signed-off-by: Joyce Kong > > > Reviewed-by: Ruifeng Wang > > > Reviewed-by: Feifei Wang > > > > This patch actually breaks the test (we are lucky, the failure happens often ;)). > > > > 28/94 DPDK:fast-tests / func_reentrancy_autotest FAIL > > 0.22s (exit status 255 or signal 127 SIGinvalid) > > > > --- command --- > > 16:13:45 DPDK_TEST='func_reentrancy_autotest' > > /home-local/jenkins-local/jenkins-agent/workspace/Generic-Unit-Test- > > DPDK/dpdk/build/app/test/dpdk-test > > -l 0-15 --file-prefix=func_reentrancy_autotest > > --- stdout --- > > RTE>>func_reentrancy_autotest > > Func-ReEnt CASE 0: eal init once PASS > > ring create/lookup: common object allocated 2 times (should be 1) Func- > > ReEnt CASE 1: ring create/lookup FAIL Test Failed > > RTE>> > > --- stderr --- > > > > > > I guess, this is what happens: > > > > main lcore worker lcore 1 ... > > worker lcore X > > enters ring_create_lookup() > > > > enters ring_create_lookup() > > rte_eal_wait_lcore(worker lcore 1); > > leaves ring_create_lookup() ring_clean(worker lcore 1); > > > > leaves ring_create_lookup() > > > > There is no synchronisation point for the main lcore to know the worker > > lcores are finished invoking the func callback. > > With this patch, the "common" object is freed by the main lcore > > *potentially* before some workers start trying to create it. > > And we end up with multiple workers successfully creating this object, hence > > the obj_count being incremented. > > > > > > -- > > David Marchand > > I think add rte_eal_mp_wait_lcore() like below can ensure the lcores to free objects > after all func callback finished. > Shall do the change in next version. > > RTE_LCORE_FOREACH_WORKER(lcore_id) { > if (cores == 1) > break; > cores--; > rte_eal_remote_launch(pt_case->func, pt_case->arg, lcore_id); > } > rte_atomic32_set(&synchro, 1); > if (pt_case->func(pt_case->arg) < 0) > ret = -1; > > + rte_eal_mp_wait_lcore(); > > cores = cores_save; > RTE_LCORE_FOREACH_WORKER(lcore_id) { > if (cores == 1) > break; > cores--; > - if (rte_eal_wait_lcore(lcore_id) < 0) > - ret = -1; > if (pt_case->clean != NULL) > pt_case->clean(lcore_id); > } Using mp_wait_lcore, the test can't tell if a lcore returned an error after executing the passed callback. An alternative is to split the current loop to first have the per lcore rte_eal_wait_lcore() calls + ret code check, and then a second loop calls the clean() callback. -- David Marchand