Commit 24eb7a84 authored by Ziye Yang's avatar Ziye Yang Committed by Changpeng Liu
Browse files

nvme/tcp: fix the iov vector count.



Since we use pdu->data_iovcnt to
build the iov in nvme_tcp_build_iovs, so
send out pdu has the maximal iov number
equals to: 2 + pdu->data_iovcnt,
so we change the comparison.

This makes sure that we can handle all the data
owned by one pdu.

Signed-off-by: default avatarZiye Yang <ziye.yang@intel.com>
Change-Id: I2b9258cc5716d706c0fa38af609726c439708768
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467207


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarBroadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
parent 2a65e28e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -402,7 +402,7 @@ nvme_tcp_qpair_process_send_queue(struct nvme_tcp_qpair *tqpair)
	 * Build up a list of iovecs for the first few PDUs in the
	 *  tqpair 's send_queue.
	 */
	while (pdu != NULL && ((array_size - iovcnt) >= 3)) {
	while (pdu != NULL && ((array_size - iovcnt) >= (2 + (int)pdu->data_iovcnt))) {
		iovcnt += nvme_tcp_build_iovs(&iovs[iovcnt], array_size - iovcnt,
					      pdu, tqpair->host_hdgst_enable,
					      tqpair->host_ddgst_enable, &mapped_length);
+2 −2
Original line number Diff line number Diff line
@@ -782,7 +782,7 @@ spdk_nvmf_tcp_qpair_flush_pdus_internal(struct spdk_nvmf_tcp_qpair *tqpair)
	int iovcnt = 0;
	int bytes = 0;
	int total_length = 0;
	uint32_t mapped_length;
	uint32_t mapped_length = 0;
	struct nvme_tcp_pdu *pdu;
	int pdu_length;
	TAILQ_HEAD(, nvme_tcp_pdu) completed_pdus_list;
@@ -797,7 +797,7 @@ spdk_nvmf_tcp_qpair_flush_pdus_internal(struct spdk_nvmf_tcp_qpair *tqpair)
	 * Build up a list of iovecs for the first few PDUs in the
	 *  tqpair 's send_queue.
	 */
	while (pdu != NULL && ((array_size - iovcnt) >= 3)) {
	while (pdu != NULL && ((array_size - iovcnt) >= (2 + (int)pdu->data_iovcnt))) {
		iovcnt += nvme_tcp_build_iovs(&iovs[iovcnt],
					      array_size - iovcnt,
					      pdu,