diff --git a/lib/nvme/nvme_rdma.c b/lib/nvme/nvme_rdma.c index 80f7c2a40..c7123231b 100644 --- a/lib/nvme/nvme_rdma.c +++ b/lib/nvme/nvme_rdma.c @@ -680,6 +680,13 @@ nvme_rdma_mr_map_notify(void *cb_ctx, struct spdk_mem_map *map, return rc; } +static int +nvme_rdma_check_contiguous_entries(uint64_t addr_1, uint64_t addr_2) +{ + /* Two contiguous mappings will point to the same address which is the start of the RDMA MR. */ + return addr_1 == addr_2; +} + static int nvme_rdma_register_mem(struct nvme_rdma_qpair *rqpair) { @@ -687,7 +694,7 @@ nvme_rdma_register_mem(struct nvme_rdma_qpair *rqpair) struct spdk_nvme_rdma_mr_map *mr_map; const struct spdk_mem_map_ops nvme_rdma_map_ops = { .notify_cb = nvme_rdma_mr_map_notify, - .are_contiguous = NULL + .are_contiguous = nvme_rdma_check_contiguous_entries }; pthread_mutex_lock(&g_rdma_mr_maps_mutex); diff --git a/lib/nvmf/rdma.c b/lib/nvmf/rdma.c index 0e2edcbda..47d421c15 100644 --- a/lib/nvmf/rdma.c +++ b/lib/nvmf/rdma.c @@ -1071,6 +1071,13 @@ spdk_nvmf_rdma_mem_notify(void *cb_ctx, struct spdk_mem_map *map, return 0; } +static int +spdk_nvmf_rdma_check_contiguous_entries(uint64_t addr_1, uint64_t addr_2) +{ + /* Two contiguous mappings will point to the same address which is the start of the RDMA MR. */ + return addr_1 == addr_2; +} + typedef enum spdk_nvme_data_transfer spdk_nvme_data_transfer_t; static spdk_nvme_data_transfer_t @@ -1537,7 +1544,7 @@ spdk_nvmf_rdma_create(struct spdk_nvmf_transport_opts *opts) const struct spdk_mem_map_ops nvmf_rdma_map_ops = { .notify_cb = spdk_nvmf_rdma_mem_notify, - .are_contiguous = NULL + .are_contiguous = spdk_nvmf_rdma_check_contiguous_entries }; rtransport = calloc(1, sizeof(*rtransport));