From: Keith Busch Date: Wed, 7 Apr 2021 21:24:33 +0000 (-0700) Subject: fix integration breakage X-Git-Tag: v1.0-rc0~130 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c68535a1cbf51b801f230f97cce8861b4fd455a0;p=users%2Fsagi%2Flibnvme.git fix integration breakage Signed-off-by: Keith Busch --- diff --git a/src/nvme/ioctl.h b/src/nvme/ioctl.h index 6804b775..c9494ba8 100644 --- a/src/nvme/ioctl.h +++ b/src/nvme/ioctl.h @@ -10,6 +10,7 @@ #ifndef _LIBNVME_IOCTL_H #define _LIBNVME_IOCTL_H +#include #include #include "types.h" @@ -1112,7 +1113,7 @@ int nvme_get_log(int fd, enum nvme_cmd_get_log_lid lid, __u32 nsid, __u64 lpo, static inline int nvme_get_nsid_log(int fd, enum nvme_cmd_get_log_lid lid, __u32 nsid, __u32 len, void *log) { - return nvme_get_log(fd, lid, nsid, 0, 0, 0, false, 0, 0, len, + return nvme_get_log(fd, lid, nsid, 0, 0, 0, false, 0, NVME_CSI_NVM, len, log); } @@ -1862,7 +1863,8 @@ int nvme_get_features(int fd, enum nvme_features_id fid, __u32 nsid, static inline int nvme_get_features_data(int fd, enum nvme_features_id fid, __u32 nsid, __u32 data_len, void *data, __u32 *result) { - return nvme_get_features(fd, fid, nsid, 0, 0, 0, data_len, data, result); + return nvme_get_features(fd, fid, nsid, NVME_GET_FEATURES_SEL_CURRENT, + 0, 0, data_len, data, result); } static inline int nvme_get_features_simple(int fd, enum nvme_features_id fid, __u32 nsid, __u32 *result) diff --git a/src/nvme/tree.c b/src/nvme/tree.c index d0309938..f1bd2405 100644 --- a/src/nvme/tree.c +++ b/src/nvme/tree.c @@ -650,7 +650,9 @@ static nvme_ctrl_t __nvme_ctrl_alloc(const char *path, const char *name) host_traddr = a + 12; a = strtok_r(NULL, ",", &e); } - c->traddr = strdup(traddr); + + if (traddr) + c->traddr = strdup(traddr); if (trsvcid) c->trsvcid = strdup(trsvcid); if (host_traddr) diff --git a/test/register.c b/test/register.c index b405eafa..06244dfd 100644 --- a/test/register.c +++ b/test/register.c @@ -45,7 +45,8 @@ void nvme_print_registers(void *regs) __u32 pmrsts = nvme_mmio_read32(regs + NVME_REG_PMRSTS); __u32 pmrebs = nvme_mmio_read32(regs + NVME_REG_PMREBS); __u32 pmrswtp = nvme_mmio_read32(regs + NVME_REG_PMRSWTP); - __u64 pmrmsc = nvme_mmio_read64(regs + NVME_REG_PMRMSC); + __u64 pmrmsc = nvme_mmio_read32(regs + NVME_REG_PMRMSCL) | + (__u64)nvme_mmio_read64(regs + NVME_REG_PMRMSCU) << 32; printf("%-10s : %llx\n", "CAP", cap); printf(" %-8s : %llx\n", "MQES", NVME_CAP_MQES(cap)); diff --git a/test/test.c b/test/test.c index a2229876..851ccb3b 100644 --- a/test/test.c +++ b/test/test.c @@ -18,6 +18,7 @@ #include #include #include +#include #include static char *nqn_match; diff --git a/test/zns.c b/test/zns.c index fd186f19..e54c7aba 100644 --- a/test/zns.c +++ b/test/zns.c @@ -40,7 +40,7 @@ static void show_zns_properties(nvme_ns_t n) return; } - printf("zamds:%u\n", zns_ctrl.zamds); + printf("zasl:%u\n", zns_ctrl.zasl); if (nvme_zns_mgmt_recv(nvme_ns_get_fd(n), nvme_ns_get_nsid(n), 0, NVME_ZNS_ZRA_REPORT_ZONES, NVME_ZNS_ZRAS_REPORT_ALL,