]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
NVMEDevice: Fix static method
authorHaomai Wang <haomai@xsky.com>
Tue, 5 Jan 2016 10:14:04 +0000 (18:14 +0800)
committerHaomai Wang <haomai@xsky.com>
Mon, 1 Feb 2016 14:00:44 +0000 (22:00 +0800)
Signed-off-by: Haomai Wang <haomai@xsky.com>
configure.ac
src/os/bluestore/NVMEDevice.cc

index 3218f75c365693809cbd87e17525356f23c91e14..751777283e13e4ff1181d0f5a28d5477426526f1 100644 (file)
@@ -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)
index 82f1ad7acc0c70ec13a0c15adfec7fea793bd149..fff435bf778e7392b73bc2c64e066f92f7eb199c 100644 (file)
@@ -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;
 }