nvme/rdma: use common Get Log page function for discovery

Change-Id: Ic635dabd039c56dfebdd0da64c4efe672b240013
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-12-06 13:19:30 -07:00
parent da92639400
commit 307d1320d8

View File

@ -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;
}