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
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)
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)
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;
}
<< " block_size " << block_size << " (" << pretty_si_t(block_size)
<< "B)" << dendl;
- name = pci_device_get_device_name(pci_dev);
return 0;
}