VirtualBox

Changeset 21839 in vbox


Ignore:
Timestamp:
Jul 28, 2009 1:27:38 PM (15 years ago)
Author:
vboxsync
Message:

Storage/iSCSI: fix parameter negotiation inconsistency

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/ISCSIHDDCore.cpp

    r21807 r21839  
    108108
    109109
     110/** Maximum PDU payload size we can handle in one piece. */
     111#define ISCSI_PDU_SIZE_MAX _256K
     112
    110113/** Maximum PDU size we can handle in one piece. */
    111 #define ISCSI_RECV_PDU_BUFFER_SIZE (65536 + ISCSI_BHS_SIZE)
     114#define ISCSI_RECV_PDU_BUFFER_SIZE (ISCSI_PDU_SIZE_MAX + ISCSI_BHS_SIZE)
    112115
    113116
     
    888891                break;
    889892            case 0x0100:    /* login operational negotiation, step 0: set parameters. */
     893                char szMaxPDU[16];
     894                RTStrPrintf(szMaxPDU, sizeof(szMaxPDU), "%u", ISCSI_PDU_SIZE_MAX);
    890895                rc = iscsiTextAddKeyValue(bBuf, sizeof(bBuf), &cbBuf, "HeaderDigest", "None", 0);
    891896                if (RT_FAILURE(rc))
     
    903908                if (RT_FAILURE(rc))
    904909                    goto out;
    905                 rc = iscsiTextAddKeyValue(bBuf, sizeof(bBuf), &cbBuf, "MaxRecvDataSegmentLength", "65536", 0);
     910                rc = iscsiTextAddKeyValue(bBuf, sizeof(bBuf), &cbBuf, "MaxRecvDataSegmentLength", szMaxPDU, 0);
    906911                if (RT_FAILURE(rc))
    907912                    goto out;
    908                 rc = iscsiTextAddKeyValue(bBuf, sizeof(bBuf), &cbBuf, "MaxBurstLength", "262144", 0);
     913                rc = iscsiTextAddKeyValue(bBuf, sizeof(bBuf), &cbBuf, "MaxBurstLength", szMaxPDU, 0);
    909914                if (RT_FAILURE(rc))
    910915                    goto out;
    911                 rc = iscsiTextAddKeyValue(bBuf, sizeof(bBuf), &cbBuf, "FirstBurstLength", "65536", 0);
     916                rc = iscsiTextAddKeyValue(bBuf, sizeof(bBuf), &cbBuf, "FirstBurstLength", szMaxPDU, 0);
    912917                if (RT_FAILURE(rc))
    913918                    goto out;
     
    27612766     * Clip read size to a value which is supported by many targets.
    27622767     */
    2763     cbToRead = RT_MIN(cbToRead, _256K);
     2768    cbToRead = RT_MIN(cbToRead, ISCSI_PDU_SIZE_MAX);
    27642769
    27652770    lba = uOffset / pImage->cbSector;
     
    28352840     * Clip write size to a value which is supported by many targets.
    28362841     */
    2837     cbToWrite = RT_MIN(cbToWrite, _256K);
     2842    cbToWrite = RT_MIN(cbToWrite, ISCSI_PDU_SIZE_MAX);
    28382843
    28392844    lba = uOffset / pImage->cbSector;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette