Browse Source

[iscsi] Always send FirstBurstLength parameter

As of kernel 4.11, the LIO target will propose a value for
FirstBurstLength if the initiator did not do so.  This is entirely
redundant in our case, since FirstBurstLength is defined by RFC 3720
to be

  "Irrelevant when: ( InitialR2T=Yes and ImmediateData=No )"

and we already enforce both InitialR2T=Yes and ImmediateData=No in our
initial proposal.  However, LIO (arguably correctly) complains when we
do not respond to its redundant proposal of an already-irrelevant
value.

Fix by always proposing the default value for FirstBurstLength.

Debugged-by: Patrick Seeburger <info@8bit.de>
Tested-by: Patrick Seeburger <info@8bit.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 7 years ago
parent
commit
785389c2ba
1 changed files with 10 additions and 4 deletions
  1. 10
    4
      src/net/tcp/iscsi.c

+ 10
- 4
src/net/tcp/iscsi.c View File

644
  *
644
  *
645
  *     HeaderDigest=None
645
  *     HeaderDigest=None
646
  *     DataDigest=None
646
  *     DataDigest=None
647
- *     MaxConnections is irrelevant; we make only one connection anyway [4]
647
+ *     MaxConnections=1 (irrelevant; we make only one connection anyway) [4]
648
  *     InitialR2T=Yes [1]
648
  *     InitialR2T=Yes [1]
649
- *     ImmediateData is irrelevant; we never send immediate data [4]
649
+ *     ImmediateData=No (irrelevant; we never send immediate data) [4]
650
  *     MaxRecvDataSegmentLength=8192 (default; we don't care) [3]
650
  *     MaxRecvDataSegmentLength=8192 (default; we don't care) [3]
651
  *     MaxBurstLength=262144 (default; we don't care) [3]
651
  *     MaxBurstLength=262144 (default; we don't care) [3]
652
- *     FirstBurstLength=262144 (default; we don't care)
652
+ *     FirstBurstLength=65536 (irrelevant due to other settings) [5]
653
  *     DefaultTime2Wait=0 [2]
653
  *     DefaultTime2Wait=0 [2]
654
  *     DefaultTime2Retain=0 [2]
654
  *     DefaultTime2Retain=0 [2]
655
  *     MaxOutstandingR2T=1
655
  *     MaxOutstandingR2T=1
674
  * these parameters, but some targets (notably a QNAP TS-639Pro) fail
674
  * these parameters, but some targets (notably a QNAP TS-639Pro) fail
675
  * unless they are supplied, so we explicitly specify the default
675
  * unless they are supplied, so we explicitly specify the default
676
  * values.
676
  * values.
677
+ *
678
+ * [5] FirstBurstLength is defined to be irrelevant since we already
679
+ * force InitialR2T=Yes and ImmediateData=No, but some targets
680
+ * (notably LIO as of kernel 4.11) fail unless it is specified, so we
681
+ * explicitly specify the default value.
677
  */
682
  */
678
 static int iscsi_build_login_request_strings ( struct iscsi_session *iscsi,
683
 static int iscsi_build_login_request_strings ( struct iscsi_session *iscsi,
679
 					       void *data, size_t len ) {
684
 					       void *data, size_t len ) {
732
 				    "ImmediateData=No%c"
737
 				    "ImmediateData=No%c"
733
 				    "MaxRecvDataSegmentLength=8192%c"
738
 				    "MaxRecvDataSegmentLength=8192%c"
734
 				    "MaxBurstLength=262144%c"
739
 				    "MaxBurstLength=262144%c"
740
+				    "FirstBurstLength=65536%c"
735
 				    "DefaultTime2Wait=0%c"
741
 				    "DefaultTime2Wait=0%c"
736
 				    "DefaultTime2Retain=0%c"
742
 				    "DefaultTime2Retain=0%c"
737
 				    "MaxOutstandingR2T=1%c"
743
 				    "MaxOutstandingR2T=1%c"
738
 				    "DataPDUInOrder=Yes%c"
744
 				    "DataPDUInOrder=Yes%c"
739
 				    "DataSequenceInOrder=Yes%c"
745
 				    "DataSequenceInOrder=Yes%c"
740
 				    "ErrorRecoveryLevel=0%c",
746
 				    "ErrorRecoveryLevel=0%c",
741
-				    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );
747
+				    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );
742
 	}
748
 	}
743
 
749
 
744
 	return used;
750
 	return used;

Loading…
Cancel
Save