git: c8169618a730 - stable/13 - Exclude reserved iSCSI Target Transfer Tag.

Alexander Motin mav at FreeBSD.org
Tue Feb 23 00:32:12 UTC 2021


The branch stable/13 has been updated by mav:

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

commit c8169618a7300bf41dad37b0ce107a4be5d9f8b0
Author:     Alexander Motin <mav at FreeBSD.org>
AuthorDate: 2021-01-24 18:58:29 +0000
Commit:     Alexander Motin <mav at FreeBSD.org>
CommitDate: 2021-02-23 00:31:52 +0000

    Exclude reserved iSCSI Target Transfer Tag.
    
    RFC 7143 (11.7.4):
       The Target Transfer Tag values are not specified by this protocol,
       except that the value 0xffffffff is reserved and means that the
       Target Transfer Tag is not supplied.
    
    MFC after:      1 month
---
 sys/cam/ctl/ctl_frontend_iscsi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c
index 996ab4e44fc0..8b0effcaf393 100644
--- a/sys/cam/ctl/ctl_frontend_iscsi.c
+++ b/sys/cam/ctl/ctl_frontend_iscsi.c
@@ -2693,6 +2693,10 @@ cfiscsi_datamove_out(union ctl_io *io)
 
 	target_transfer_tag =
 	    atomic_fetchadd_32(&cs->cs_target_transfer_tag, 1);
+	if (target_transfer_tag == 0xffffffff) {
+		target_transfer_tag =
+		    atomic_fetchadd_32(&cs->cs_target_transfer_tag, 1);
+	}
 	cdw = cfiscsi_data_wait_new(cs, io, bhssc->bhssc_initiator_task_tag,
 	    &target_transfer_tag);
 	if (cdw == NULL) {


More information about the dev-commits-src-all mailing list