From 0d3cc15a62ea593570a85fddacaa54ae509281ae Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Wed, 19 Aug 2020 21:23:51 +0800 Subject: [PATCH] nvme/tcp: Correct the incapsule data usage According to page35 in recent NVMe-oF spec ( NVMe-over-Fabrics-1.1-2019.10.22-Ratified), ioccsz is used to restrict the incapsule size of I/O command, so do not restrict the NVMe-oF OPC command and also the admin command. We accidently trigger an bug in kernel since we do not send the fabrics command with the incapsule and make the kernel coredump, though the kernel has bugs. Signed-off-by: Ziye Yang Change-Id: I869a2c8ab7b9c2ac1e5cc5b603920662591c2c64 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3837 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto Reviewed-by: Reviewed-by: Aleksey Marchuk --- lib/nvme/nvme_tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nvme/nvme_tcp.c b/lib/nvme/nvme_tcp.c index d2fe10109..7a03a9ab9 100644 --- a/lib/nvme/nvme_tcp.c +++ b/lib/nvme/nvme_tcp.c @@ -491,7 +491,7 @@ nvme_tcp_req_init(struct nvme_tcp_qpair *tqpair, struct nvme_request *req, if (xfer == SPDK_NVME_DATA_HOST_TO_CONTROLLER) { max_incapsule_data_size = ctrlr->ioccsz_bytes; if ((req->cmd.opc == SPDK_NVME_OPC_FABRIC) || nvme_qpair_is_admin_queue(&tqpair->qpair)) { - max_incapsule_data_size = spdk_min(max_incapsule_data_size, NVME_TCP_IN_CAPSULE_DATA_MAX_SIZE); + max_incapsule_data_size = NVME_TCP_IN_CAPSULE_DATA_MAX_SIZE; } if (req->payload_size <= max_incapsule_data_size) {