patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Hunt, David" <david.hunt@intel.com>
To: Anatoly Burakov <anatoly.burakov@intel.com>, dev@dpdk.org
Cc: thomas@monjalon.net, stable@dpdk.org
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] mem: fix division by zero in no-NUMA mode
Date: Mon, 26 Nov 2018 11:14:49 +0000	[thread overview]
Message-ID: <73443011-2b32-ce73-ef0d-896858f7503d@intel.com> (raw)
In-Reply-To: <294f089848bf803ff134979c612bbf28e0e2e6b9.1543229588.git.anatoly.burakov@intel.com>

Hi Anatoly,

On 26/11/2018 10:57 AM, Anatoly Burakov wrote:
> When RTE_EAL_NUMA_AWARE_HUGEPAGES is set to "n", not all memtypes
> will be valid, because we skip some due to not supporting other
> NUMA nodes, leading to a division by zero error down the line
> because the necessary memtype fields weren't populated.
>
> Fix it by limiting number of memtypes to number of memtypes we
> have actually created.
>
> Fixes: 1dd342d0fdc4 ("mem: improve segment list preallocation")
> Cc: stable@dpdk.org
>
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
>   lib/librte_eal/linuxapp/eal/eal_memory.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
> index 6f94621d4..32feb415d 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_memory.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
> @@ -2230,6 +2230,8 @@ memseg_primary_init(void)
>   				socket_id, hugepage_sz);
>   		}
>   	}
> +	/* number of memtypes could have been lower due to no NUMA support */
> +	n_memtypes = cur_type;
>   
>   	/* set up limits for types */
>   	max_mem = (uint64_t)RTE_MAX_MEM_MB << 20;

Fixes the issue on my machine. vm_power_manager crashes with floating point
exception without patch, starts successfully with patch.

Tested-by: David Hunt <david.hunt@intel.com>

  reply	other threads:[~2018-11-26 11:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-26 10:57 [dpdk-stable] " Anatoly Burakov
2018-11-26 11:14 ` Hunt, David [this message]
2018-11-26 14:37   ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon

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=73443011-2b32-ce73-ef0d-896858f7503d@intel.com \
    --to=david.hunt@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /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).