iscsi: reserve value 0xffffffff for TTT in R2T

According to RFC3720 10.8.5, value 0xffffffff is reserved
for Target Transfer Tag when sending an R2T to initiator.

Change-Id: I0d92539d7640d3a4ffc5f8452cfe16f34269e7d0
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/425369
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Changpeng Liu 2018-09-12 04:20:08 -04:00
parent 6c391ec277
commit 9637e17d2d

View File

@ -3398,7 +3398,13 @@ spdk_add_transfer_task(struct spdk_iscsi_conn *conn,
task->next_expected_r2t_offset = data_len;
task->current_r2t_length = 0;
task->R2TSN = 0;
task->ttt = ++conn->ttt;
/* According to RFC3720 10.8.5, 0xffffffff is
* reserved for TTT in R2T.
*/
if (++conn->ttt == 0xffffffffu) {
conn->ttt = 0;
}
task->ttt = conn->ttt;
while (data_len != transfer_len) {
len = DMIN32(max_burst_len, (transfer_len - data_len));