aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/iscsi/iscsi.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2021-02-02 18:37:13 +0000
committerAlexander Motin <mav@FreeBSD.org>2021-02-02 18:56:47 +0000
commit3dd2a7a5ea2f1641c7525f692eed416fa02c28e6 (patch)
tree856608ddf621b96edc8d351e308eb03dc48dd285 /sys/dev/iscsi/iscsi.c
parent9d0f1092cf90c8bf161cb946584f703a9998f8cd (diff)
downloadsrc-3dd2a7a5ea2f1641c7525f692eed416fa02c28e6.tar.gz
src-3dd2a7a5ea2f1641c7525f692eed416fa02c28e6.zip
Make DataSN counter of solicited Data-Out local.
DataSN for solicited Data-Out is per-R2T. Since we handle whole R2T in one go, we don't need to store it anywhere, especially in global per-command structure. This may allow us to handle multiple R2T per command at once, if we decide, or may be relax locking. Rename the second use of that field to io_referenced_task_tag. MFC after: 1 month
Diffstat (limited to 'sys/dev/iscsi/iscsi.c')
-rw-r--r--sys/dev/iscsi/iscsi.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c
index 5e6c80255bff..c4123d9f4aa7 100644
--- a/sys/dev/iscsi/iscsi.c
+++ b/sys/dev/iscsi/iscsi.c
@@ -1018,7 +1018,7 @@ iscsi_pdu_handle_task_response(struct icl_pdu *response)
ISCSI_SESSION_WARN(is, "task response 0x%x",
bhstmr->bhstmr_response);
} else {
- aio = iscsi_outstanding_find(is, io->io_datasn);
+ aio = iscsi_outstanding_find(is, io->io_referenced_task_tag);
if (aio != NULL && aio->io_ccb != NULL)
iscsi_session_terminate_task(is, aio, CAM_REQ_ABORTED);
}
@@ -1157,6 +1157,7 @@ iscsi_pdu_handle_r2t(struct icl_pdu *response)
struct ccb_scsiio *csio;
size_t off, len, total_len;
int error;
+ uint32_t datasn = 0;
is = PDU_SESSION(response);
@@ -1183,8 +1184,6 @@ iscsi_pdu_handle_r2t(struct icl_pdu *response)
* XXX: Verify R2TSN.
*/
- io->io_datasn = 0;
-
off = ntohl(bhsr2t->bhsr2t_buffer_offset);
if (off > csio->dxfer_len) {
ISCSI_SESSION_WARN(is, "target requested invalid offset "
@@ -1234,7 +1233,7 @@ iscsi_pdu_handle_r2t(struct icl_pdu *response)
bhsr2t->bhsr2t_initiator_task_tag;
bhsdo->bhsdo_target_transfer_tag =
bhsr2t->bhsr2t_target_transfer_tag;
- bhsdo->bhsdo_datasn = htonl(io->io_datasn++);
+ bhsdo->bhsdo_datasn = htonl(datasn++);
bhsdo->bhsdo_buffer_offset = htonl(off);
error = icl_pdu_append_data(request, csio->data_ptr + off, len,
M_NOWAIT);
@@ -2204,7 +2203,7 @@ iscsi_action_abort(struct iscsi_session *is, union ccb *ccb)
xpt_done(ccb);
return;
}
- io->io_datasn = aio->io_initiator_task_tag;
+ io->io_referenced_task_tag = aio->io_initiator_task_tag;
bhstmr = (struct iscsi_bhs_task_management_request *)request->ip_bhs;
bhstmr->bhstmr_opcode = ISCSI_BHS_OPCODE_TASK_REQUEST;