Hi Santosh, On Thu, 2014-03-06 at 17:48 +0530, santosh kulkarni wrote: > Hi Nab, > > Had a query regarding Read10 with Immediate bit set.The LIO target seems > to reject Read10 with immediate flag set.It would be great if you could > tell me why is it doing so. > > I am basically trying to recover dropped PDUs(with immediate bit set) > within a session.What i am observing is for every retransmitted Read10 > PDU with immediate set the target is rejecting it. > > > 10.3. SCSI Command > > The format of the SCSI Command PDU is: > > Byte/ 0 | 1 | 2 | 3 | > / | | | | > |0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7| > +---------------+---------------+---------------+---------------+ > 0|.|I| 0x01 |F|R|W|. .|ATTR | Reserved | > +---------------+---------------+---------------+---------------+ > > > > ./drivers/target/iscsi/iscsi_target.c: iscsit_setup_scsi_cmd() > > pr_err("opcode=[%x],flags=[%x]\n",hdr->opcode,hdr->flags); > > if (hdr->opcode & ISCSI_OP_IMMEDIATE) { > pr_err("Illegally set Immediate Bit in iSCSI Initiator" > " Scsi Command PDU.\n"); > return iscsit_add_reject_cmd(cmd, > ISCSI_REASON_BOOKMARK_INVALID, buf); > } > > > dmesg output: > > [ 269.314155] opcode=[41],flags=[c1] > [ 269.315774] Illegally set Immediate Bit in iSCSI Initiator Scsi > Command PDU. > The target prevents SCSI command PDUs with the immediate bit from being executed because they ignore per session CmdSN ordering, and the target effectively has no control over their execution. Wrt to ERL=1 within connection recovery case, re-sending a SCSI command PDU with I_BIT=1 set that was not acknowledged explicitly through CmdSN is wrong. It's the initiators responsibility to re-send the original SCSI command PDU with the same CmdSN in order to 'fill the ExpCmdSN hole' left on the target due to a Immediate data payload CRC failure, etc. Re-sending the same SCSI command PDU with I_BIT doesn't cause the target side ExpCmdSN to be incremented, leaving a hole that continues to prevent execution of new commands until session recovery kicks in. --nab -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html