From bfcfdb79037afb896ed61ac66322c2652d996300 Mon Sep 17 00:00:00 2001 From: Or Gerlitz Date: Wed, 23 Mar 2022 17:05:21 +0200 Subject: [PATCH] nvmf/rdma: Use spdk allocation scheme for RDMA requests and receives In a similar manner for what we do for other per IO data-structures of cmds, cpls and bufs, use the conventional huge-pages based spdk allocation scheme for RDMA requests and receives. Change-Id: I4c2e86e928106e78c053f24915e2a9ce1a200c78 Signed-off-by: Or Gerlitz Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12273 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris Reviewed-by: Aleksey Marchuk --- lib/nvmf/rdma.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/nvmf/rdma.c b/lib/nvmf/rdma.c index 0a3c7e721..08af82881 100644 --- a/lib/nvmf/rdma.c +++ b/lib/nvmf/rdma.c @@ -694,8 +694,8 @@ nvmf_rdma_resources_destroy(struct spdk_nvmf_rdma_resources *resources) spdk_free(resources->cmds); spdk_free(resources->cpls); spdk_free(resources->bufs); - free(resources->reqs); - free(resources->recvs); + spdk_free(resources->reqs); + spdk_free(resources->recvs); free(resources); } @@ -718,8 +718,10 @@ nvmf_rdma_resources_create(struct spdk_nvmf_rdma_resource_opts *opts) return NULL; } - resources->reqs = calloc(opts->max_queue_depth, sizeof(*resources->reqs)); - resources->recvs = calloc(opts->max_queue_depth, sizeof(*resources->recvs)); + resources->reqs = spdk_zmalloc(opts->max_queue_depth * sizeof(*resources->reqs), + 0x1000, NULL, SPDK_ENV_LCORE_ID_ANY, SPDK_MALLOC_DMA); + resources->recvs = spdk_zmalloc(opts->max_queue_depth * sizeof(*resources->recvs), + 0x1000, NULL, SPDK_ENV_LCORE_ID_ANY, SPDK_MALLOC_DMA); resources->cmds = spdk_zmalloc(opts->max_queue_depth * sizeof(*resources->cmds), 0x1000, NULL, SPDK_ENV_LCORE_ID_ANY, SPDK_MALLOC_DMA); resources->cpls = spdk_zmalloc(opts->max_queue_depth * sizeof(*resources->cpls),