Commit 2cb8321a authored by Changpeng Liu's avatar Changpeng Liu Committed by Benjamin Walker
Browse files

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: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent c9090bef
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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"
+1 −6
Original line number Diff line number Diff line
@@ -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);