Changeset 32225 in vbox for trunk/src/VBox
- Timestamp:
- Sep 2, 2010 8:07:53 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/ISCSIHDDCore.cpp
r32132 r32225 475 475 /** The BHS. */ 476 476 uint32_t aBHS[12]; 477 /** Assigned CmdSN for this PDU. */ 478 uint32_t CmdSN; 477 479 /** The S/G buffer used for sending. */ 478 480 RTSGBUF SgBuf; … … 690 692 /* Serial number arithmetic comparison. */ 691 693 static bool serial_number_less(uint32_t sn1, uint32_t sn2); 694 static bool serial_number_greater(uint32_t sn1, uint32_t sn2); 692 695 693 696 /* CHAP-MD5 functions. */ … … 2295 2298 do 2296 2299 { 2297 /* If there is no PDU active, get the first one from the list. */ 2300 /* 2301 * If there is no PDU active, get the first one from the list. 2302 * Check that we are allowed to transfer the PDU by comparing the 2303 * command sequence number and the maximum sequence number allowed by the target. 2304 */ 2298 2305 if (!pImage->pIScsiPDUTxCur) 2299 2306 { 2300 if (!pImage->pIScsiPDUTxHead) 2307 if ( !pImage->pIScsiPDUTxHead 2308 || serial_number_greater(pImage->pIScsiPDUTxHead->CmdSN, pImage->MaxCmdSN)) 2301 2309 break; 2302 2310 … … 2417 2425 */ 2418 2426 rc = iscsiRecvPDUUpdateRequest(pImage, paRes, cnRes); 2427 /* Try to send more PDUs now that we updated the MaxCmdSN field */ 2428 if ( RT_SUCCESS(rc) 2429 && !pImage->pIScsiPDUTxCur) 2430 rc = iscsiSendPDUAsync(pImage); 2419 2431 } 2420 2432 else … … 2619 2631 paReqBHS[7] = RT_H2N_U32(pImage->ExpStatSN); 2620 2632 memcpy(paReqBHS + 8, pScsiReq->pvCmd, pScsiReq->cbCmd); 2633 2634 pIScsiPDU->CmdSN = pImage->CmdSN; 2621 2635 pImage->CmdSN++; 2622 2636 … … 3035 3049 { 3036 3050 return (s1 < s2 && s2 - s1 < 0x80000000) || (s1 > s2 && s1 - s2 > 0x80000000); 3051 } 3052 3053 static bool serial_number_greater(uint32_t s1, uint32_t s2) 3054 { 3055 return (s1 < s2 && s2 - s1 > 0x80000000) || (s1 > s2 && s1 - s2 < 0x80000000); 3037 3056 } 3038 3057
Note:
See TracChangeset
for help on using the changeset viewer.