From owner-dev-commits-src-branches@freebsd.org Thu Mar 4 14:40:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8829854CD66; Thu, 4 Mar 2021 14:40:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Drtp53MmQz3rrH; Thu, 4 Mar 2021 14:40:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5827C1F010; Thu, 4 Mar 2021 14:40:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 124EejMw014995; Thu, 4 Mar 2021 14:40:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124EejwT014994; Thu, 4 Mar 2021 14:40:45 GMT (envelope-from git) Date: Thu, 4 Mar 2021 14:40:45 GMT Message-Id: <202103041440.124EejwT014994@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 3e1da9a9f85b - stable/12 - Make DataSN counter of solicited Data-Out local. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 3e1da9a9f85bbfbb216829b5de528b86d16c888f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 14:40:45 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=3e1da9a9f85bbfbb216829b5de528b86d16c888f commit 3e1da9a9f85bbfbb216829b5de528b86d16c888f Author: Alexander Motin AuthorDate: 2021-02-02 18:37:13 +0000 Commit: Alexander Motin CommitDate: 2021-03-04 14:40:37 +0000 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 (cherry picked from commit 3dd2a7a5ea2f1641c7525f692eed416fa02c28e6) --- sys/dev/iscsi/iscsi.c | 9 ++++----- sys/dev/iscsi/iscsi.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index 0c891a32feea..685b635a4411 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; diff --git a/sys/dev/iscsi/iscsi.h b/sys/dev/iscsi/iscsi.h index 607d0a7386f6..33c892a00d50 100644 --- a/sys/dev/iscsi/iscsi.h +++ b/sys/dev/iscsi/iscsi.h @@ -46,7 +46,7 @@ struct iscsi_outstanding { union ccb *io_ccb; size_t io_received; uint32_t io_initiator_task_tag; - uint32_t io_datasn; + uint32_t io_referenced_task_tag; void *io_icl_prv; };