Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Feb 2021 00:33:25 GMT
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 0004227346d0 - stable/12 - Exclude reserved iSCSI Initiator Task Tag.
Message-ID:  <202102230033.11N0XPjC062875@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by mav:

URL: https://cgit.FreeBSD.org/src/commit/?id=0004227346d0ceea713b456300794d55e787a5e6

commit 0004227346d0ceea713b456300794d55e787a5e6
Author:     Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2021-01-24 19:23:04 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2021-02-23 00:33:20 +0000

    Exclude reserved iSCSI Initiator Task Tag.
    
    RFC 7143 (11.2.1.8):
       An ITT value of 0xffffffff is reserved and MUST NOT be assigned for a
       task by the initiator.  The only instance in which it may be seen on
       the wire is in a target-initiated NOP-In PDU (Section 11.19) and in
       the initiator response to that PDU, if necessary.
    
    MFC after:      1 month
---
 sys/dev/iscsi/iscsi.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c
index f0ba48fa7a67..0c891a32feea 100644
--- a/sys/dev/iscsi/iscsi.c
+++ b/sys/dev/iscsi/iscsi.c
@@ -2194,6 +2194,8 @@ iscsi_action_abort(struct iscsi_session *is, union ccb *ccb)
 	}
 
 	initiator_task_tag = is->is_initiator_task_tag++;
+	if (initiator_task_tag == 0xffffffff)
+		initiator_task_tag = is->is_initiator_task_tag++;
 
 	io = iscsi_outstanding_add(is, request, NULL, &initiator_task_tag);
 	if (io == NULL) {
@@ -2254,6 +2256,9 @@ iscsi_action_scsiio(struct iscsi_session *is, union ccb *ccb)
 	}
 
 	initiator_task_tag = is->is_initiator_task_tag++;
+	if (initiator_task_tag == 0xffffffff)
+		initiator_task_tag = is->is_initiator_task_tag++;
+
 	io = iscsi_outstanding_add(is, request, ccb, &initiator_task_tag);
 	if (io == NULL) {
 		icl_pdu_free(request);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102230033.11N0XPjC062875>