Commit 9be487cf authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Tomasz Zawadzki
Browse files

nvme/tcp: check PDU's data len before executing a sequence



If a CapsuleCmd is sent without in-capsule data, we should wait before
executing accel sequence until sending the first H2CData PDU to allow the
data digest calculation to be executes as part of the existing sequence.
Otherwise, it would be calculated separately, which can be inefficient
if it was possible to chain it with previous operations in the sequence.

Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ic5b791736bef1f8a937be918e99c6babd8ce00aa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19547


Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@gmail.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 9d1f340f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -506,7 +506,8 @@ tcp_write_pdu(struct nvme_tcp_pdu *pdu)
	if (spdk_likely(treq != NULL)) {
		req = treq->req;
		if (req->accel_sequence != NULL &&
		    spdk_nvme_opc_get_data_transfer(req->cmd.opc) == SPDK_NVME_DATA_HOST_TO_CONTROLLER) {
		    spdk_nvme_opc_get_data_transfer(req->cmd.opc) == SPDK_NVME_DATA_HOST_TO_CONTROLLER &&
		    pdu->data_len > 0) {
			assert(tqpair->qpair.poll_group != NULL);
			tgroup = nvme_tcp_poll_group(tqpair->qpair.poll_group);
			nvme_tcp_accel_finish_sequence(tgroup, req->accel_sequence,