Re: SNACK TYPE 1 usage (Status resend)

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

 



Hi Nab,

On Tuesday 04 February 2014 02:20 AM, Nicholas A. Bellinger wrote:
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..?
Tested the below LIO patch. Results are below.

1) With patch.
Only last Response PDU is being sent. *Not the whole run.*.(Probably 'cause the last response is never explicitly acknowledged by the next WRITE ) But SNACK type 1 begrun=0x0 and runlength=0x0 expects the entire response Run to be resent.
However, we are not getting dmesg error.


2) Without the patch.
[root@wfs ~]# dmesg
[ 232.300786] Got Status SNACK Begrun: 0x00000000, RunLength: 0x00000000 but already got ExpStatSN: 0x4179e971 on CID: 0.



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





Regards
Santosh

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