mirror of
https://github.com/ipxe/ipxe
synced 2026-02-08 13:52:13 +03:00
[iscsi] Limit maximum transfer size to MaxBurstLength
We currently specify only the iSCSI default value for MaxBurstLength and ignore any negotiated value, since our internal block device API allows only for receiving directly into caller-allocated buffers and so we have no intrinsic limit on burst length. A conscientious target may however refuse to attempt a transfer that we request for a number of blocks that would exceed the negotiated maximum burst length. Fix by recording the negotiated maximum burst length and using it to limit the maximum number of blocks per transfer as reported by the SCSI layer. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -22,6 +22,15 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
/** Default iSCSI port */
|
||||
#define ISCSI_PORT 3260
|
||||
|
||||
/** Default iSCSI first burst length */
|
||||
#define ISCSI_FIRST_BURST_LEN 65536
|
||||
|
||||
/** Default iSCSI maximum burst length */
|
||||
#define ISCSI_MAX_BURST_LEN 262144
|
||||
|
||||
/** Default iSCSI maximum receive data segment length */
|
||||
#define ISCSI_MAX_RECV_DATA_SEG_LEN 8192
|
||||
|
||||
/**
|
||||
* iSCSI segment lengths
|
||||
*
|
||||
@@ -577,6 +586,9 @@ struct iscsi_session {
|
||||
/** CHAP response (used for both initiator and target auth) */
|
||||
struct chap_response chap;
|
||||
|
||||
/** Maximum burst length */
|
||||
size_t max_burst_len;
|
||||
|
||||
/** Initiator session ID (IANA format) qualifier
|
||||
*
|
||||
* This is part of the ISID. It is generated randomly
|
||||
|
||||
Reference in New Issue
Block a user