From 4689bd27723b311220354308eb354fd3694883ae Mon Sep 17 00:00:00 2001 From: Haomai Wang Date: Tue, 5 Jan 2016 18:14:04 +0800 Subject: [PATCH] NVMEDevice: Fix static method Signed-off-by: Haomai Wang --- configure.ac | 9 +++++---- src/os/bluestore/NVMEDevice.cc | 15 +++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index 3218f75c36569..751777283e13e 100644 --- a/configure.ac +++ b/configure.ac @@ -732,9 +732,10 @@ AM_CONDITIONAL(WITH_DPDK, [test "x$with_dpdk" != "xno"]) if test "x$with_dpdk" != x"no"; then CPPFLAGS="$CPPFLAGS -I$with_dpdk/include" - LDFLAGS="$LDFLAGS -I$with_dpdk/lib" + LDFLAGS="$LDFLAGS -L$with_dpdk/lib" AC_CHECK_HEADER([rte_config.h], [], AC_MSG_ERROR([Cannot find header 'rte_config.h'.])) - AC_CHECK_LIB([rte_eal], [rte_eal_init], [], AC_MSG_FAILURE([DPDK rte_eal_init not found])) + AC_CHECK_LIB([rte_eal], [rte_eal_init], [], AC_MSG_FAILURE([DPDK rte_eal_init not found]), + [-lrte_mempool -lrte_ring -lpthread -ldl]) AC_DEFINE([HAVE_DPDK], [1], [DPDK conditional compilation]) fi @@ -749,9 +750,9 @@ AM_CONDITIONAL(WITH_SPDK, [test "x$with_spdk" != "xno"]) if test "x$with_spdk" != x"no"; then CPPFLAGS="$CPPFLAGS -I$with_spdk/include" - LDFLAGS="$LDFLAGS -I$with_dpdk/lib" + LDFLAGS="$LDFLAGS -L$with_spdk/lib" AC_CHECK_HEADER([spdk/nvme.h], [], AC_MSG_ERROR([Cannot find header 'spdk/nvme.h'.])) - AC_CHECK_LIB([spdk_nvme], [nvme_attach], [], AC_MSG_FAILURE([SPDK nvme_attach not found])) + #AC_CHECK_LIB([spdk_nvme], [nvme_attach], [], AC_MSG_FAILURE([SPDK nvme_attach not found])) AC_DEFINE([HAVE_SPDK], [1], [SPDK conditional compilation]) AC_SUBST(SPDK_LIBS) diff --git a/src/os/bluestore/NVMEDevice.cc b/src/os/bluestore/NVMEDevice.cc index 82f1ad7acc0c7..fff435bf778e7 100644 --- a/src/os/bluestore/NVMEDevice.cc +++ b/src/os/bluestore/NVMEDevice.cc @@ -90,15 +90,15 @@ static char *ealargs[] = { void NVMEDevice::init() { int r = rte_eal_init(sizeof(ealargs) / sizeof(ealargs[0]), (char **)(void *)(uintptr_t)ealargs); - if (r < 0) { - derr << __func__ << " init dpdk failed" << dendl; + if (r < 0) assert(0); - } - if (request_mempool == NULL) { - derr << __func__ << " could not initialize request mempool" << dendl; + request_mempool = rte_mempool_create("nvme_request", 8192, + nvme_request_size(), 128, 0, + NULL, NULL, NULL, NULL, + SOCKET_ID_ANY, 0); + if (request_mempool == NULL) assert(0); - } } int NVMEDevice::open(string p) @@ -213,7 +213,7 @@ int NVMEDevice::open(string p) break; } if (pci_dev == NULL) { - derr << __func__ << " failed to found nvme serial number " << sn_tag << dend; + derr << __func__ << " failed to found nvme serial number " << sn_tag << dendl; return -ENOENT; } @@ -223,7 +223,6 @@ int NVMEDevice::open(string p) << " block_size " << block_size << " (" << pretty_si_t(block_size) << "B)" << dendl; - name = pci_device_get_device_name(pci_dev); return 0; } -- 2.39.5