From 2cb8321a35c1f55b18d271721228fbed58a24994 Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Tue, 12 Jul 2016 14:03:12 +0800 Subject: [PATCH] nvmf: make admin queue has the same size of bounce buffer as IO queues The NVMf target set the maximum data transfer size(MDTS) to the default value of 128KB now, and the initiator driver will read the value and set it to the block layer, so each command sent from initiator will not runoff 128KB. Change-Id: I1d4f259e887b2fc70c7f1c5406c07c58f7fc9b8d Signed-off-by: Changpeng Liu --- lib/nvmf/nvmf_internal.h | 5 ++--- lib/nvmf/rdma.c | 7 +------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/nvmf/nvmf_internal.h b/lib/nvmf/nvmf_internal.h index 7fbe0acc3..1d7e22881 100644 --- a/lib/nvmf/nvmf_internal.h +++ b/lib/nvmf/nvmf_internal.h @@ -46,14 +46,13 @@ #define nvmf_min(a,b) (((a)<(b))?(a):(b)) -#define SMALL_BB_MAX_SIZE 4096 -#define LARGE_BB_MAX_SIZE (128 * 1024) +#define DEFAULT_BB_SIZE (128 * 1024) /* * NVMf target supports a maximum transfer size that is equal to * a single allocated bounce buffer per request. */ -#define SPDK_NVMF_MAX_RECV_DATA_TRANSFER_SIZE LARGE_BB_MAX_SIZE +#define SPDK_NVMF_MAX_RECV_DATA_TRANSFER_SIZE DEFAULT_BB_SIZE #define SPDK_NVMF_DEFAULT_NUM_SESSIONS_PER_LCORE 1 #define SPDK_NVMF_DEFAULT_NODEBASE "nqn.2016-06.io.spdk" diff --git a/lib/nvmf/rdma.c b/lib/nvmf/rdma.c index 4929b8830..cf7fba7d2 100644 --- a/lib/nvmf/rdma.c +++ b/lib/nvmf/rdma.c @@ -197,12 +197,7 @@ alloc_rdma_req(struct spdk_nvmf_conn *conn) rdma_req->recv_sgl[0].length = sizeof(rdma_req->cmd); rdma_req->recv_sgl[0].lkey = rdma_req->cmd_mr->lkey; - if (conn->type == CONN_TYPE_AQ) { - /* Admin commands can only send 4k of data maximum */ - rdma_req->bb_len = SMALL_BB_MAX_SIZE; - } else { - rdma_req->bb_len = LARGE_BB_MAX_SIZE; - } + rdma_req->bb_len = DEFAULT_BB_SIZE; rdma_req->bb = rte_zmalloc("nvmf_bb", rdma_req->bb_len, 0); if (!rdma_req->bb) { SPDK_ERRLOG("Unable to get %u byte bounce buffer\n", rdma_req->bb_len);