From 307d1320d897e654d95e00a8bc6de3f318b180be Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Tue, 6 Dec 2016 13:19:30 -0700 Subject: [PATCH] nvme/rdma: use common Get Log page function for discovery Change-Id: Ic635dabd039c56dfebdd0da64c4efe672b240013 Signed-off-by: Daniel Verkamp --- lib/nvme/nvme_rdma.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/lib/nvme/nvme_rdma.c b/lib/nvme/nvme_rdma.c index 617805bc24..aee2db15d5 100644 --- a/lib/nvme/nvme_rdma.c +++ b/lib/nvme/nvme_rdma.c @@ -1019,23 +1019,14 @@ nvme_rdma_ctrlr_enable(struct spdk_nvme_ctrlr *ctrlr) static int nvme_fabrics_get_log_discovery_page(struct spdk_nvme_ctrlr *ctrlr, - char *log_page, uint32_t size) + void *log_page, uint32_t size) { - struct spdk_nvme_cmd cmd = {}; - struct nvme_completion_poll_status status = {}; + struct nvme_completion_poll_status status; int rc; - uint32_t zero_based_value = ((size / sizeof(uint32_t)) - 1); - uint16_t numdl = zero_based_value & 0xFFFF; - uint16_t numdu = (zero_based_value >> 16) & 0xFFFF; - - cmd.opc = SPDK_NVME_OPC_GET_LOG_PAGE; - cmd.cdw10 = SPDK_NVME_LOG_DISCOVERY; - cmd.cdw10 |= (numdl << 16); - cmd.cdw11 = numdu; - rc = spdk_nvme_ctrlr_cmd_admin_raw(ctrlr, (struct spdk_nvme_cmd *)&cmd, - (void *)log_page, 4096, - nvme_completion_poll_cb, &status); + status.done = false; + rc = spdk_nvme_ctrlr_cmd_get_log_page(ctrlr, SPDK_NVME_LOG_DISCOVERY, 0, log_page, size, + nvme_completion_poll_cb, &status); if (rc < 0) { return -1; }