dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,
	Anatoly Burakov <anatoly.burakov@intel.com>
Cc: dev <dev@dpdk.org>, Jie Zhou <jizh@microsoft.com>
Subject: Re: [dpdk-dev] [PATCH] mem: fix cleanup on Windows
Date: Wed, 24 Mar 2021 19:35:37 +0100	[thread overview]
Message-ID: <CAJFAV8waKTh+GZZjN2__9wWjM84_dWBcCgcZPZaOX2ih0VzDig@mail.gmail.com> (raw)
In-Reply-To: <20210324180128.32752-1-dmitry.kozliuk@gmail.com>

On Wed, Mar 24, 2021 at 7:01 PM Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> 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 <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>
> ---
>  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


  reply	other threads:[~2021-03-24 18:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24 18:01 [dpdk-dev] [PATCH] mem: fix cleanup on Windows Dmitry Kozlyuk
2021-03-24 18:35 ` David Marchand [this message]
2021-03-24 19:32 ` [dpdk-dev] [PATCH v2] mem: fix cleanup when multi-process is disabled Dmitry Kozlyuk
2021-03-25 15:39   ` Ranjit Menon
2021-03-26 12:34   ` Burakov, Anatoly
2021-03-26 16:15   ` David Marchand
2021-04-09 12:00   ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJFAV8waKTh+GZZjN2__9wWjM84_dWBcCgcZPZaOX2ih0VzDig@mail.gmail.com \
    --to=david.marchand@redhat.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=jizh@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).