@@ -653,26 +653,6 @@ static int cxgbit_set_iso_npdu(struct cxgbit_sock *csk)
653
653
u32 max_npdu , max_iso_npdu ;
654
654
655
655
if (conn -> login -> leading_connection ) {
656
- param = iscsi_find_param_from_key (DATASEQUENCEINORDER ,
657
- conn -> param_list );
658
- if (!param ) {
659
- pr_err ("param not found key %s\n" , DATASEQUENCEINORDER );
660
- return -1 ;
661
- }
662
-
663
- if (strcmp (param -> value , YES ))
664
- return 0 ;
665
-
666
- param = iscsi_find_param_from_key (DATAPDUINORDER ,
667
- conn -> param_list );
668
- if (!param ) {
669
- pr_err ("param not found key %s\n" , DATAPDUINORDER );
670
- return -1 ;
671
- }
672
-
673
- if (strcmp (param -> value , YES ))
674
- return 0 ;
675
-
676
656
param = iscsi_find_param_from_key (MAXBURSTLENGTH ,
677
657
conn -> param_list );
678
658
if (!param ) {
@@ -683,11 +663,6 @@ static int cxgbit_set_iso_npdu(struct cxgbit_sock *csk)
683
663
if (kstrtou32 (param -> value , 0 , & mbl ) < 0 )
684
664
return -1 ;
685
665
} else {
686
- if (!conn -> sess -> sess_ops -> DataSequenceInOrder )
687
- return 0 ;
688
- if (!conn -> sess -> sess_ops -> DataPDUInOrder )
689
- return 0 ;
690
-
691
666
mbl = conn -> sess -> sess_ops -> MaxBurstLength ;
692
667
}
693
668
@@ -706,6 +681,53 @@ static int cxgbit_set_iso_npdu(struct cxgbit_sock *csk)
706
681
return 0 ;
707
682
}
708
683
684
+ /*
685
+ * cxgbit_seq_pdu_inorder()
686
+ * @csk: pointer to cxgbit socket structure
687
+ *
688
+ * This function checks whether data sequence and data
689
+ * pdu are in order.
690
+ *
691
+ * Return: returns -1 on error, 0 if data sequence and
692
+ * data pdu are in order, 1 if data sequence or data pdu
693
+ * is not in order.
694
+ */
695
+ static int cxgbit_seq_pdu_inorder (struct cxgbit_sock * csk )
696
+ {
697
+ struct iscsi_conn * conn = csk -> conn ;
698
+ struct iscsi_param * param ;
699
+
700
+ if (conn -> login -> leading_connection ) {
701
+ param = iscsi_find_param_from_key (DATASEQUENCEINORDER ,
702
+ conn -> param_list );
703
+ if (!param ) {
704
+ pr_err ("param not found key %s\n" , DATASEQUENCEINORDER );
705
+ return -1 ;
706
+ }
707
+
708
+ if (strcmp (param -> value , YES ))
709
+ return 1 ;
710
+
711
+ param = iscsi_find_param_from_key (DATAPDUINORDER ,
712
+ conn -> param_list );
713
+ if (!param ) {
714
+ pr_err ("param not found key %s\n" , DATAPDUINORDER );
715
+ return -1 ;
716
+ }
717
+
718
+ if (strcmp (param -> value , YES ))
719
+ return 1 ;
720
+
721
+ } else {
722
+ if (!conn -> sess -> sess_ops -> DataSequenceInOrder )
723
+ return 1 ;
724
+ if (!conn -> sess -> sess_ops -> DataPDUInOrder )
725
+ return 1 ;
726
+ }
727
+
728
+ return 0 ;
729
+ }
730
+
709
731
static int cxgbit_set_params (struct iscsi_conn * conn )
710
732
{
711
733
struct cxgbit_sock * csk = conn -> context ;
@@ -732,11 +754,24 @@ static int cxgbit_set_params(struct iscsi_conn *conn)
732
754
}
733
755
734
756
if (!erl ) {
757
+ int ret ;
758
+
759
+ ret = cxgbit_seq_pdu_inorder (csk );
760
+ if (ret < 0 ) {
761
+ return -1 ;
762
+ } else if (ret > 0 ) {
763
+ if (is_t5 (cdev -> lldi .adapter_type ))
764
+ goto enable_ddp ;
765
+ else
766
+ goto enable_digest ;
767
+ }
768
+
735
769
if (test_bit (CDEV_ISO_ENABLE , & cdev -> flags )) {
736
770
if (cxgbit_set_iso_npdu (csk ))
737
771
return -1 ;
738
772
}
739
773
774
+ enable_ddp :
740
775
if (test_bit (CDEV_DDP_ENABLE , & cdev -> flags )) {
741
776
if (cxgbit_setup_conn_pgidx (csk ,
742
777
ppm -> tformat .pgsz_idx_dflt ))
@@ -745,6 +780,7 @@ static int cxgbit_set_params(struct iscsi_conn *conn)
745
780
}
746
781
}
747
782
783
+ enable_digest :
748
784
if (cxgbit_set_digest (csk ))
749
785
return -1 ;
750
786
0 commit comments