From dd2e6164c96f231b6a3315df84f8f1d9b960697d Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Wed, 10 Aug 2016 16:12:59 -0700 Subject: [PATCH] nvme: replace rte_zmalloc() with rte_malloc() + memset rte_zmalloc() is broken and does not actually return zeroed memory on at least DPDK 16.07 on FreeBSD, so do it ourselves. Change-Id: If8da93ead0b3911c8bca24aa27ed90dc00b8a9a4 Signed-off-by: Daniel Verkamp --- lib/nvme/nvme_impl.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/nvme/nvme_impl.h b/lib/nvme/nvme_impl.h index c49bc4ccf..a2d122e64 100644 --- a/lib/nvme/nvme_impl.h +++ b/lib/nvme/nvme_impl.h @@ -49,6 +49,7 @@ #include "spdk/pci.h" #include "spdk/nvme_spec.h" #include +#include #include #include #include @@ -85,8 +86,11 @@ static inline void * nvme_malloc(const char *tag, size_t size, unsigned align, uint64_t *phys_addr) { - void *buf = rte_zmalloc(tag, size, align); - *phys_addr = rte_malloc_virt2phy(buf); + void *buf = rte_malloc(tag, size, align); + if (buf) { + memset(buf, 0, size); + *phys_addr = rte_malloc_virt2phy(buf); + } return buf; }