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 D98A9A0A02; Wed, 24 Mar 2021 19:35:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 62956140FBC; Wed, 24 Mar 2021 19:35:54 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 1F847140FBB for ; Wed, 24 Mar 2021 19:35:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616610951; 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=FwqpXLYcWdLkjTltJMHGeLC5kzHX+dfbGCSej7ll4ys=; b=XJv2v6Q0Uns/UPfeuAv6X3Lz7Kbuvz0SvHjhCb+JOy0xPbaqniYRDlVuavFkdkeV+i/JhR PYNt3jUJSOtAbgfbEWHZli2Xq8gWnwvQWKdYvI2/ZwOo25zEPJQ0UkIdsCCtkKLiOtrEtS zkRxN7qbNe7jN7/bM6KVYmzrqNc+S6g= Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-347-0uVE6BI1M8uvGYtkJpm8GA-1; Wed, 24 Mar 2021 14:35:49 -0400 X-MC-Unique: 0uVE6BI1M8uvGYtkJpm8GA-1 Received: by mail-vk1-f198.google.com with SMTP id x23so383254vkd.0 for ; Wed, 24 Mar 2021 11:35:49 -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=FwqpXLYcWdLkjTltJMHGeLC5kzHX+dfbGCSej7ll4ys=; b=pScAo9GoNQnnHPkVZCJKJAv/Q+t/bld8IJjzTeWO8qDz4+CQNyCNv/eeR6LNc/GFUA HHGt6ffOsqhdKynsRJba5owXhKKdw3tqNMe6sIVRXWMflSVqCs3OJMy3G4KSpokCUTJk ElQwif5yAn9EiavFIdptxsPOPCiUAtxwlxFWSjDlGe1Yu46xivJHXRmYrnYTtVQcpcI6 J0ruLsSc+FTrFUwNHMcxgUv+TCtr+Zex7LshtzaAQppZBQw9o64A1TLI7jsNWL7xDybc jMmFoRWfd+qBb/wZA/oJv1DxLs+faU8/GiCII0N4eWqiUZ9Cbdmi50IHpK0m1pZ+WHlz 472Q== X-Gm-Message-State: AOAM531QfaGemoNmDOOtPZ4cmPA3YXbP3LVZ2RAYecp+Mtj42UGVhG6Z HnVuLY+u06TpZWlHv651V31J6ve9MOQ3DonuUPtD2ESskpR3lB3Ut/FE85ET7hfhKZDvDKzFSqq f+pQH7EpCyOofNzmLEFY= X-Received: by 2002:a67:be15:: with SMTP id x21mr3038743vsq.5.1616610948872; Wed, 24 Mar 2021 11:35:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1oUTzS0mu2iu7nG7te74szHgtRZl688a6Bl7K/RbuHO/El2uIA+3Oc/3tzFZNPHR49ZlHdIOpHDsEl15U450= X-Received: by 2002:a67:be15:: with SMTP id x21mr3038727vsq.5.1616610948587; Wed, 24 Mar 2021 11:35:48 -0700 (PDT) MIME-Version: 1.0 References: <20210324180128.32752-1-dmitry.kozliuk@gmail.com> In-Reply-To: <20210324180128.32752-1-dmitry.kozliuk@gmail.com> From: David Marchand Date: Wed, 24 Mar 2021 19:35:37 +0100 Message-ID: To: Dmitry Kozlyuk , Anatoly Burakov Cc: dev , Jie Zhou 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-dev] [PATCH] mem: fix cleanup on Windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Mar 24, 2021 at 7:01 PM Dmitry Kozlyuk wrote: > > rte_mem_unmap() called from rte_eal_memory_detach() fails on Windows > with message "EAL: Could not unmap memory: No error". This is because > on Windows memory is not allocated using mapping. Confusing "No error" > is caused by using errno instead of rte_errno set by rte_mem_unmap(). > > Multi-process is not supported on Windows and --in-memory is forced, > so detaching memory is not needed on cleanup. Bypass the function > in this case. Fix error handling to produce proper log message. > > Fixes: dfbc61a2f9a6 ("mem: detach memsegs on cleanup") > Cc: Anatoly Burakov > > Reported-by: Jie Zhou > Suggested-by: David Marchand > Signed-off-by: Dmitry Kozlyuk > --- > lib/librte_eal/common/eal_common_memory.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c > index 0e99986d3d..9ef9c65ac8 100644 > --- a/lib/librte_eal/common/eal_common_memory.c > +++ b/lib/librte_eal/common/eal_common_memory.c > @@ -1010,6 +1010,13 @@ rte_eal_memory_detach(void) > size_t page_sz = rte_mem_page_size(); > unsigned int i; > > +#ifdef RTE_EXEC_ENV_WINDOWS > + /* Multi-process is not supported, detaching is not needed. > + * mcfg->mp_status can't be used: it's always "unknown" on Windows. > + */ > + return 0; > +#endif > + My suggestion was more like: if (eal_get_internal_configuration()->in_memory == 1) return 0; -- David Marchand