For reads FirstBurstLength does not come into play. It is just for
writes and immediate data and initial r2t handling.
> MaxRecvDataSegmentLength = 8K
> SCSI (read) command PDU specifies total data length = 25K
>
> Which scenario out of following two should be considered is correct
> operation? Is scenario-1 possible?
> What are the main factors taken into account before chopping SCSI data
> into iSCSI PDU?
>
> Scenario-1:
>
> iSCSI Data-In PDUs:
>
> PDU1 with data length=4K
> PDU2 with data length=4K
> PDU3 with data length=4K
> PDU4 with data length=4K
> PDU5 with data length=4K
> PDU6 with data length=4K
> PDU7 with data length=1K
I think the iscsi RFC just says that the target cannot send more than
MaxRecvDataSegmentLength bytes, so it is valid for it to send PDUs with
only 4K.
>
> Scenario-2:
>
> iSCSI Data-In PDUs:
>
> PDU1 with data length=8K
> PDU2 with data length=8K
> PDU3 with data length=8K
> PDU4 with data length=1K
I think this is more common.
>
> Can you point me to the code where this decision is made about
> chopping SCSI data into iSCSI PDU.
>
The initiator does not do the chopping for READs. The target does this.
We just read in whatever the target sends us.
For WRITEs there is iscsi_prep_scsi_cmd_pdu and
iscsi_prep_data_out_pdu/iscsi_tcp_r2t_rsp.