Parcourir la 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 il y a 7 ans
Parent
révision
785389c2ba
1 fichiers modifiés avec 10 ajouts et 4 suppressions
  1. 10
    4
      src/net/tcp/iscsi.c

+ 10
- 4
src/net/tcp/iscsi.c Voir le fichier

@@ -644,12 +644,12 @@ static int iscsi_rx_nop_in ( struct iscsi_session *iscsi,
644 644
  *
645 645
  *     HeaderDigest=None
646 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 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 650
  *     MaxRecvDataSegmentLength=8192 (default; we don't care) [3]
651 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 653
  *     DefaultTime2Wait=0 [2]
654 654
  *     DefaultTime2Retain=0 [2]
655 655
  *     MaxOutstandingR2T=1
@@ -674,6 +674,11 @@ static int iscsi_rx_nop_in ( struct iscsi_session *iscsi,
674 674
  * these parameters, but some targets (notably a QNAP TS-639Pro) fail
675 675
  * unless they are supplied, so we explicitly specify the default
676 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 683
 static int iscsi_build_login_request_strings ( struct iscsi_session *iscsi,
679 684
 					       void *data, size_t len ) {
@@ -732,13 +737,14 @@ static int iscsi_build_login_request_strings ( struct iscsi_session *iscsi,
732 737
 				    "ImmediateData=No%c"
733 738
 				    "MaxRecvDataSegmentLength=8192%c"
734 739
 				    "MaxBurstLength=262144%c"
740
+				    "FirstBurstLength=65536%c"
735 741
 				    "DefaultTime2Wait=0%c"
736 742
 				    "DefaultTime2Retain=0%c"
737 743
 				    "MaxOutstandingR2T=1%c"
738 744
 				    "DataPDUInOrder=Yes%c"
739 745
 				    "DataSequenceInOrder=Yes%c"
740 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 750
 	return used;

Chargement…
Annuler
Enregistrer