Commit d31eb732 authored by Ben Walker's avatar Ben Walker Committed by Tomasz Zawadzki
Browse files

nvmf/tcp: Allocate pdu pool out of hugepages



It is faster for the kernel to pin memory in hugepages, so allocate
the pdu pool from hugepages. This will help more
with upcoming changes to leverage MSG_ZEROCOPY.

Change-Id: I9ce581acca9c6edb71bd8119258966e3b405db77
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475801


Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarOr Gerlitz <gerlitz.or@gmail.com>
parent 053fa66b
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -482,7 +482,7 @@ spdk_nvmf_tcp_qpair_destroy(struct spdk_nvmf_tcp_qpair *tqpair)
	if (err > 0) {
		nvmf_tcp_dump_qpair_req_contents(tqpair);
	}
	free(tqpair->pdu);
	spdk_dma_free(tqpair->pdu);
	free(tqpair->pdu_pool);
	free(tqpair->req);
	free(tqpair->reqs);
@@ -903,7 +903,8 @@ spdk_nvmf_tcp_qpair_init_mem_resource(struct spdk_nvmf_tcp_qpair *tqpair, uint16
		tcp_req->state = TCP_REQUEST_STATE_FREE;
		TAILQ_INSERT_TAIL(&tqpair->state_queue[tcp_req->state], tcp_req, state_link);

		tqpair->pdu = calloc(NVMF_TCP_QPAIR_MAX_C2H_PDU_NUM + 1, sizeof(*tqpair->pdu));
		tqpair->pdu = spdk_dma_malloc((NVMF_TCP_QPAIR_MAX_C2H_PDU_NUM + 1) * sizeof(*tqpair->pdu), 0x1000,
					      NULL);
		if (!tqpair->pdu) {
			SPDK_ERRLOG("Unable to allocate pdu on tqpair=%p.\n", tqpair);
			return -1;