From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id B90C7A0A0F;
	Fri, 26 Mar 2021 17:15:43 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 5331E40686;
	Fri, 26 Mar 2021 17:15:43 +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 9E5EF40685
 for <dev@dpdk.org>; Fri, 26 Mar 2021 17:15:41 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1616775340;
 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=/073RSJxaqZyCl9yBo3lqEXq9EIQoCTIBF3mbBau5N8=;
 b=CgZXfWN6twvOgiBna1zNm7qeA+WO8Pj64ra+5dx9a26vUXLyVhiVtEhxqk4vkgIlsPECJl
 QzSz501y6gmzhQMaU+GMIpCtIQU2Nmfij8hW+CAApPIR7FCymQFG0ctYakUoPeg7iualwt
 8wtWNq5ck48TgN5HL1YzPPS6XPix4Wk=
Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com
 [209.85.221.197]) (Using TLS) by relay.mimecast.com with ESMTP id
 us-mta-401-luyYHUAMOrSJRF4heB3puw-1; Fri, 26 Mar 2021 12:15:38 -0400
X-MC-Unique: luyYHUAMOrSJRF4heB3puw-1
Received: by mail-vk1-f197.google.com with SMTP id x23so2083925vkd.0
 for <dev@dpdk.org>; Fri, 26 Mar 2021 09:15:38 -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=/073RSJxaqZyCl9yBo3lqEXq9EIQoCTIBF3mbBau5N8=;
 b=AwJ+dy6V3tpo2UDY7t125ByJb4GdDou2egbVr94BPbflvqzDxls29yyLbThLMYE0wR
 xZkyyci1ZfQaMrXXNDacX4pj9+6rBYNoviYYPD3gd6WH9wR2yILx5VF8ocYb98w0hM8N
 DJg73Hq4TfHr0iNaNzEEOCCDr8CejXRASjy8xT+Ul3mpvjG+y+Qt6rzUFM1uFz44zM0t
 BEl1RoBKVptw7o12XBxPentAJTkf39iDuxp5UbHmNmw4/2tT1enRV2uzO5Br5c+Fx9YR
 MuLFciRdqqz0ryu/crbs3UTMaNzc1yxNGuikjqWkhJggfWN4+8gUmVBYBuyJ+F60BjyA
 50VQ==
X-Gm-Message-State: AOAM531iixHyWpUtQRbOOGfNhXsgwG4CiE5K7MhwRfdprLtScp5GI2mP
 M+9iAOEo1Yv1XbZoowsS02N/xQZ0VqqPHsO/7aF4LEOqBDB9riGaT7v0MeYku47APLEQ8CB7T+i
 sC1IBaLaNQT2A2QukjYA=
X-Received: by 2002:ab0:3a97:: with SMTP id r23mr8239547uaw.87.1616775338422; 
 Fri, 26 Mar 2021 09:15:38 -0700 (PDT)
X-Google-Smtp-Source: ABdhPJyPvTDqhv4KYmhlwSRVI1bpTlUUwMOmYaZxLJslWaEHXUgacGWtzNQnLKLfF/VYQfXHB//+DGIsYW154oL43Is=
X-Received: by 2002:ab0:3a97:: with SMTP id r23mr8239527uaw.87.1616775338203; 
 Fri, 26 Mar 2021 09:15:38 -0700 (PDT)
MIME-Version: 1.0
References: <20210324180128.32752-1-dmitry.kozliuk@gmail.com>
 <20210324193227.15497-1-dmitry.kozliuk@gmail.com>
In-Reply-To: <20210324193227.15497-1-dmitry.kozliuk@gmail.com>
From: David Marchand <david.marchand@redhat.com>
Date: Fri, 26 Mar 2021 17:15:27 +0100
Message-ID: <CAJFAV8yPGUweB7jNo=nyb=Eqd+yFxcdWmK7fEPaqjgKj-7Efgg@mail.gmail.com>
To: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Cc: dev <dev@dpdk.org>, Anatoly Burakov <anatoly.burakov@intel.com>, 
 Jie Zhou <jizh@microsoft.com>
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 v2] mem: fix cleanup when multi-process is
 disabled
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Wed, Mar 24, 2021 at 8:32 PM Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> wrote:
>
> rte_eal_memory_detach() did not account for cases where multi-process
> mode is disabled: --in-memory and --no-shconf. This resulted
> in unmapping memory that had not been mapped, which caused errors:
>
>     EAL: Could not unmap memory: No error   (Windows)
>     EAL: Cannot munmap(0x1d47f40, 0x7000): Invalid argument  (Linux)
>
> Confusing "No error" was caused by using errno instead of rte_errno
> set by rte_mem_unmap().
>
> Skip detaching memory altogether when --in-memory is specified.
> Skip unmapping configuration when it's not shared.
> Fix and add error handling to produce proper log messages.
>
> Fixes: dfbc61a2f9a6 ("mem: detach memsegs on cleanup")
> Cc: Anatoly Burakov <anatoly.burakov@intel.com>
>
> Reported-by: Jie Zhou <jizh@microsoft.com>
> Suggested-by: David Marchand <david.marchand@redhat.com>
> Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied, thanks Dmitry.


-- 
David Marchand