From 7e52eb740aa6efba1e986a78c010361624725697 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Wed, 5 May 2021 21:22:55 +0000 Subject: [PATCH] iscsi: fix ISCSI_READ_PDU spdk_trace_record This was accidentally moved to the wrong place as part of some earlier iSCSI refactoring. This trace record should be executed when we have finished reading all of the data for any PDU, not just those with immediate data. Signed-off-by: Jim Harris Change-Id: Ib1d17e5e79ff220e9e9b3dd55e247e745bd58019 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7756 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Reviewed-by: Changpeng Liu Reviewed-by: Shuhei Matsumoto Reviewed-by: Paul Luse --- lib/iscsi/iscsi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/iscsi/iscsi.c b/lib/iscsi/iscsi.c index 7e54004bc..dcd2aa395 100644 --- a/lib/iscsi/iscsi.c +++ b/lib/iscsi/iscsi.c @@ -4703,10 +4703,6 @@ iscsi_pdu_payload_read(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu) } } - /* All data for this PDU has now been read from the socket. */ - spdk_trace_record(TRACE_ISCSI_READ_PDU, conn->id, pdu->data_valid_bytes, - (uintptr_t)pdu, pdu->bhs.opcode); - /* check data digest */ if (conn->data_digest) { _iscsi_pdu_calc_data_digest(pdu); @@ -4843,6 +4839,10 @@ iscsi_read_pdu(struct spdk_iscsi_conn *conn) } } + /* All data for this PDU has now been read from the socket. */ + spdk_trace_record(TRACE_ISCSI_READ_PDU, conn->id, pdu->data_valid_bytes, + (uintptr_t)pdu, pdu->bhs.opcode); + if (!pdu->is_rejected) { rc = iscsi_pdu_payload_handle(conn, pdu); } else {