Commit dd2e6164 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

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: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent fcc97846
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@
#include "spdk/pci.h"
#include "spdk/nvme_spec.h"
#include <assert.h>
#include <string.h>
#include <unistd.h>
#include <rte_config.h>
#include <rte_cycles.h>
@@ -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);
	void *buf = rte_malloc(tag, size, align);
	if (buf) {
		memset(buf, 0, size);
		*phys_addr = rte_malloc_virt2phy(buf);
	}
	return buf;
}