Hi,
I am looking for help in understanding how LIO processes/handles NopOUT.
The problem which I noticed is that LIO Ignores NopOut->flags field
while processing nop out.
Looking at RFC Section 10.18 the NopOUT->flags LMB (Left most bit)
Must be set which LIO is ignoring.
10.18. NOP-Out
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| 0x00 |1| Reserved |
+---------------+---------------+---------------+---------------+
I understand it is the onus of the Initiator to set set proper flags for
NopOUT,
However if the initiator fails to set it correctly. This flag is
ignored, by LIO
and I understand is a RFC error.
I made changes to the LIO source to confirm my findings. Hope you will find
my experiments useful.
Thanks
Arshad
--- ./iscsi_target.c 2014-03-06 02:26:26.830460677 -0500
+++ ./drivers/target/iscsi/iscsi_target.c 2014-03-06
04:04:07.074341573 -0500
@@ -1568,10 +1568,22 @@
{
struct iscsi_cmd *cmd_p = NULL;
int cmdsn_ret = 0;
+ pr_err("#D1 - Testing if hitting the correct function.\n");
+ pr_err("#D2 - opcode = [%x]\n",hdr->opcode);
+ pr_err("#D3 - flags = [%x]\n",hdr->flags);
+ pr_err("#D3 - TTT = [%x]\n",hdr->ttt);
/*
* Initiator is expecting a NopIN ping reply..
*/
+ /*
+ * RFC Section 10.18 Mandates NopOUT Flag's LMB to be set
+ */
+ if ( !(hdr->flags & 0x80) ) {
+ pr_err("#D4 - NopOUT Flag LMB not set.\n");
+ return -1;
+ }
+
if (hdr->itt != RESERVED_ITT) {
BUG_ON(!cmd);
Dmesg output: Bad Flag Set Still passes. _Without changes_
[ 719.357572] #D1 - Testing if hitting the correct function.
[ 719.358130] #D2 - opcode = [0] // Non Immediate.
[ 719.359838] #D3 - flags = [0]
[ 719.360394] #D3 - TTT = [ffffffff]
Dmesg output: Bad Flag Fail. _With changes_
[ 166.969059] #D1 - Testing if hitting the correct function.
[ 166.969558] #D2 - opcode = [0]
[ 166.970004] #D3 - flags = [0]
[ 166.970484] #D3 - TTT = [ffffffff]
[ 166.970953] #D4 - NopIN Flag LMB not set.
Dmesg output: Bad Flag Fail. _With changes_
[ 131.334179] #D1 - Testing if hitting the correct function.
[ 131.335864] #D2 - opcode = [40] //Immediate.
[ 131.336566] #D3 - flags = [0]
[ 131.337187] #D3 - TTT = [ffffffff]
[ 131.337802] #D4 - NopIN Flag LMB not set.
[root@wfs scst-2.2.0]# uname -a
Linux wfs 3.12.6 #1 SMP Sat Dec 21 06:13:09 EST 2013 x86_64 x86_64
x86_64 GNU/Linux
[root@wfs scst-2.2.0]#
[root@wfs linux-3.12.6]# modinfo drivers/target/iscsi/iscsi_target_mod.ko
filename:
/root/arshad/linux-source/linux-3.12.6/drivers/target/iscsi/iscsi_target_mod.ko
license: GPL
author: nab@xxxxxxxxxxxxxxx
version: 4.1.x
description: iSCSI-Target Driver for mainline target infrastructure
srcversion: E37F13EB43C19E31F3A6433
depends: target_core_mod
intree: Y
vermagic: 3.12.6 SMP mod_unload
[root@wfs linux-3.12.6]#
--
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