Re: SNACK TYPE 1 usage (Status resend)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Santosh,

On Mon, 2014-02-03 at 17:50 +0530, santosh kulkarni wrote:
> Hi,
> 
> Am currently working on a case where we are sending few WRITE10 PDUs and 
> we are getting R2Ts and responding each of them with a DataOut PDU.Now 
> we are receiving a Positive response for the DataOuts.
> We are sending a SNACK of type1(status) with begrun and runlength set to 
> 0x0.
> Now the target throws in the following dmesg.
> 
> 
> Got Status SNACK Begrun: 0x00000000, RunLength: 0x00000000 but already 
> got ExpStatSN: 0x9a9ccd6b on CID: 0.
> 
> The behavior seems to be different from what RFC states which expects 
> the Response PDU of all DataOuts to be resent.(entire run)
> 
> RFC states
> 
> 
> 10.16.6.  BegRun
> 
>     The DataSN, R2TSN, or StatSN of the first PDU whose retransmission is
>     requested (Data/R2T and Status SNACK), or the next expected DataSN
>     (DataACK SNACK).
> 
>     "BegRun 0 when used in conjunction with RunLength 0 means resend all
>     unacknowledged Data-In, R2T or Response PDUs."
> 
>     BegRun MUST be 0 for a R-Data SNACK.
> 
> 
> Is LIO behaving accordingly?
> 
> 

So the original check that your hitting is to ensure that the initiator
is not sending BegRun for StatSNs that have already been explicitly
acknowledged by ExpStatSN during the normal course of operation.

However as stated in 10.16.6 above, the BegRun = 0 value in the context
of SNACK TYPE 1 is requesting to re-send unacknowledged response PDUs
starting from the connection's current ExpStatSN value.

Care to test the following patch..?

--nab

diff --git a/drivers/target/iscsi/iscsi_target_erl1.c b/drivers/target/iscsi/iscsi_target_erl
index e048d64..cda4d80 100644
--- a/drivers/target/iscsi/iscsi_target_erl1.c
+++ b/drivers/target/iscsi/iscsi_target_erl1.c
@@ -507,7 +507,9 @@ int iscsit_handle_status_snack(
        u32 last_statsn;
        int found_cmd;
 
-       if (conn->exp_statsn > begrun) {
+       if (!begrun) {
+               begrun = conn->exp_statsn;
+       } else if (conn->exp_statsn > begrun) {
                pr_err("Got Status SNACK Begrun: 0x%08x, RunLength:"
                        " 0x%08x but already got ExpStatSN: 0x%08x on CID:"
                        " %hu.\n", begrun, runlength, conn->exp_statsn,


--
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




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux