diff --git a/lib/nvmf/rdma.c b/lib/nvmf/rdma.c index 646afd82d..cd8e7206f 100644 --- a/lib/nvmf/rdma.c +++ b/lib/nvmf/rdma.c @@ -1278,6 +1278,8 @@ spdk_nvmf_rdma_request_fill_iovs(struct spdk_nvmf_rdma_transport *rtransport, i++; } + assert(rdma_req->req.iovcnt <= rqpair->max_send_sge); + rdma_req->data_from_pool = true; return rc; diff --git a/lib/nvmf/tcp.c b/lib/nvmf/tcp.c index 1a22e896f..d34c980df 100644 --- a/lib/nvmf/tcp.c +++ b/lib/nvmf/tcp.c @@ -2116,6 +2116,7 @@ spdk_nvmf_tcp_req_fill_iovs(struct spdk_nvmf_tcp_transport *ttransport, i++; } + assert(tcp_req->req.iovcnt < SPDK_NVMF_MAX_SGL_ENTRIES); tcp_req->data_from_pool = true; return 0; diff --git a/test/unit/lib/nvmf/rdma.c/rdma_ut.c b/test/unit/lib/nvmf/rdma.c/rdma_ut.c index 369c77ffd..7bd79b5c6 100644 --- a/test/unit/lib/nvmf/rdma.c/rdma_ut.c +++ b/test/unit/lib/nvmf/rdma.c/rdma_ut.c @@ -128,6 +128,7 @@ test_spdk_nvmf_rdma_request_parse_sgl(void) group.group.buf_cache_count = 0; poller.group = &group; rqpair.poller = &poller; + rqpair.max_send_sge = SPDK_NVMF_MAX_SGL_ENTRIES; sgl = &cmd.nvme_cmd.dptr.sgl1; rdma_req.recv = &recv;