public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: Jayamohan Kallickal <Jayamohan.Kallickal@Emulex.Com>
Cc: Jayamohan Kallickal <jayamohank@gmail.com>,
	"jbottomley@parallels.com" <jbottomley@parallels.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	Sony John-N <Sony.John-N@Emulex.Com>
Subject: Re: [PATCH 04/22] be2iscsi: Fix negotiated parameters upload to FW
Date: Wed, 18 Sep 2013 02:34:45 -0500	[thread overview]
Message-ID: <52395795.6000100@cs.wisc.edu> (raw)
In-Reply-To: <c04fb960-4c3d-448a-8902-e5a89ed424d5@CMEXHTCAS2.ad.emulex.com>

On 09/18/2013 12:37 AM, Jayamohan Kallickal wrote:
> -----Original Message-----
> From: Mike Christie [mailto:michaelc@cs.wisc.edu] 
> Sent: Tuesday, September 17, 2013 2:16 PM
> To: Jayamohan Kallickal
> Cc: Jayamohan Kallickal; jbottomley@parallels.com; linux-scsi@vger.kernel.org; Sony John-N
> Subject: Re: [PATCH 04/22] be2iscsi: Fix negotiated parameters upload to FW
> 
> On 09/16/2013 11:28 PM, Jayamohan Kallickal wrote:
>>
>>
>> -----Original Message-----
>> From: Mike Christie [mailto:michaelc@cs.wisc.edu]
>> Sent: Monday, September 16, 2013 7:59 PM
>> To: Jayamohan Kallickal
>> Cc: jbottomley@parallels.com; linux-scsi@vger.kernel.org; Jayamohan 
>> Kallickal; Sony John-N
>> Subject: Re: [PATCH 04/22] be2iscsi: Fix negotiated parameters upload 
>> to FW
>>
>> On 09/13/2013 12:09 AM, Jayamohan Kallickal wrote:
>>>  - If target does not send MaxRecvDSL in login repsonse, then
>>>    initiator should consider the MaxRecvDSL for target is 8K.
>>>    In this scenario driver was setting the value to 64K and this
>>>    caused target to close cxn as data xfer was more than the
>>>    MaxRecvDSL
>>>  - Update connection offload data structure for SKH-R adapters.
>>>
>>> Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
>>> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
>>> ---
>>>  drivers/scsi/be2iscsi/be_iscsi.c |    9 +++++++--
>>>  drivers/scsi/be2iscsi/be_main.h  |   29 ++++++++++++++++-------------
>>>  drivers/scsi/be2iscsi/be_mgmt.c  |    8 +++-----
>>>  3 files changed, 26 insertions(+), 20 deletions(-)
>>>
>>> diff --git a/drivers/scsi/be2iscsi/be_iscsi.c
>>> b/drivers/scsi/be2iscsi/be_iscsi.c
>>> index 2496ea7..60c1dff 100644
>>> --- a/drivers/scsi/be2iscsi/be_iscsi.c
>>> +++ b/drivers/scsi/be2iscsi/be_iscsi.c
>>> @@ -672,9 +672,10 @@ int beiscsi_set_param(struct iscsi_cls_conn *cls_conn,
>>>  			session->max_burst = 262144;
>>>  		break;
>>>  	case ISCSI_PARAM_MAX_XMIT_DLENGTH:
>>> -		if ((conn->max_xmit_dlength > 65536) ||
>>> -		    (conn->max_xmit_dlength == 0))
>>> +		if (conn->max_xmit_dlength > 65536)
>>>  			conn->max_xmit_dlength = 65536;
>>> +		else if (conn->max_xmit_dlength == 0)
>>> +			conn->max_xmit_dlength = 8192;
>>
>>> Was the target sending 0 or not sending anything at all? Userspace should not be sending 0 if the target did not send >MaxRecvDSL. It looks like it should be sending 8k for that case. It looks like there is a bug in the tools where it will pass 0 >if the target sent 0.
>>
>>> It seems other drivers would be hitting this bug too and we should fix everyone.
>>
>> This was an IET target that  did not send any value and we were 
>> defaulting to 64K
>>
>> Here is a small  userspace fix  that should  go along
>>
>> diff --git a/usr/be2iscsi.c b/usr/be2iscsi.c index ce8b719..ba4c29f 
>> 100644
>> --- a/usr/be2iscsi.c
>> +++ b/usr/be2iscsi.c
>> @@ -33,10 +33,6 @@ void be2iscsi_create_conn(struct iscsi_conn *conn)
>>  	if (conn->max_xmit_dlength > 65536)
>>  		conn->max_xmit_dlength = 65536;
>>  
>> -	if (!conn_rec->iscsi.MaxXmitDataSegmentLength ||
>> -	    conn_rec->iscsi.MaxXmitDataSegmentLength > 65536)
>> -		conn_rec->iscsi.MaxXmitDataSegmentLength = 65536;
>> -
>>  	session->erl = 0;
>>  	session->initial_r2t_en = 1;
>>  }
> 
>> For the case you are trying to fix are you getting 0 or 64K from userspace?  In the kernel code you changed to set the <value to 8K it looks like you got 0 from userspace. Is that right?
> 
> Before this fix, in the usespace we will  hit (!conn_rec->iscsi.MaxXmitDataSegmentLength)   and will set conn_rec->iscsi.MaxXmitDataSegmentLength = 65536.  The userspace patch would prevent that from happening.
> 
> So, in the Kernel space we would get 0 and which  would be set to 8K.
> 
>> Are you setting node.conn[0].iscsi.MaxXmitDataSegmentLength in iscsif.conf to 64K or did you leave it as the default? >Just to make sure we are on the same page I really mean did you set it in iscsid.conf or with iscsiadm. I am not talking >about setting above in the be2iscsi create_conn callout.
> 
> No changes were made. It was default values.
> 
>> If it is the default of 0, then I think when the code above is called iscsi_copy_operational_params will have set conn->>max_xmit_dlength to ISCSI_DEF_MAX_RECV_SEG_LEN (8k). The conn->max_xmit_dlength value is the one we use for >final negotiated value so that is what gets passed to the kernel.
> 
>> If the target does not negotiate for MRDSL then it should stay 8k.
>> iscsi_session_set_params will then pass down conn->max_xmit_dlength when login is done.
> 
>> If I am looking at the code right, the only way we can get 0 in the kernel is if the target sends 0 for MRDSL. iscsid was not >expecting that and will just set conn->max_xmit_dlength to 0 and that will get passed down to all drivers incorrectly. If I >am right then we need to do a fix for all drivers.
> 
> As an experiment, we tried applying just the userspace patch I sent earlier and we got the max_xmit_dlength as 8K.
>  So, the basic issue was that the user space code in usr/be2iscsi was setting the conn->max_xmit_dlength to 64K when we hit (!conn_rec->iscsi.MaxXmitDataSegmentLength)   
> 

Ok. It now makes sense.

> I will send out a separate patch for the userspace code, but feel we can still keep the driver changes since the current code in Kernel sets conn->max_xmit_dlength=64K if it cam down to driver as zero. I would like to keep the check in driver as the user may apply different version of the userspace code (Distro version, Top of your Tree).
> 

It is not a question of it is needed. It is more where the zero check
should go. I was saying that no driver can support a zero
max_xmit_dlength and we should have some code in
scsi_transport_iscsi:iscsi_set_param() to make sure all iscsi rfc
settings are within the RFC defined limits.

The driver set_param would then only have to check if the value passed
in is within its fw/driver limits.

  reply	other threads:[~2013-09-18  7:34 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-13  5:09 [PATCH 01/22] be2iscsi: Fix Template HDR IOCTL Jayamohan Kallickal
2013-09-13  5:09 ` [PATCH 02/22] be2iscsi: Fix the MCCQ count leakage Jayamohan Kallickal
2013-09-13  5:09 ` [PATCH 03/22] be2iscsi: Fix repeated issue of MAC ADDR get IOCTL Jayamohan Kallickal
2013-09-13  5:09 ` [PATCH 04/22] be2iscsi: Fix negotiated parameters upload to FW Jayamohan Kallickal
2013-09-17  2:58   ` Mike Christie
2013-09-17  4:28     ` Jayamohan Kallickal
2013-09-17 21:15       ` Mike Christie
2013-09-18  5:37         ` Jayamohan Kallickal
2013-09-18  7:34           ` Mike Christie [this message]
2013-09-17 21:23       ` Mike Christie
2013-09-13  5:09 ` [PATCH 05/22] be2iscsi: Fix locking mechanism in Unsol Path Jayamohan Kallickal
2013-09-13  5:09 ` [PATCH 06/22] be2iscsi: Fix soft lock up issue during UE or if FW taking time to respond Jayamohan Kallickal
2013-09-17  3:18   ` Mike Christie
2013-09-13  5:09 ` [PATCH 07/22] be2iscsi: Config parameters update for Dual Chute Support Jayamohan Kallickal
2013-09-13  5:09 ` [PATCH 08/22] be2iscsi: Fix changes in ASYNC Path for SKH-R adapter Jayamohan Kallickal
2013-09-13  5:09 ` [PATCH 09/22] be2iscsi: Fix Template HDR support for Dual Chute mode Jayamohan Kallickal
2013-09-13  5:10 ` [PATCH 10/22] be2iscsi: Fix SGL Initilization and posting Pages for Dual Chute Jayamohan Kallickal
2013-09-13  5:10 ` [PATCH 11/22] be2iscsi: Fix WRB_Q posting to support Dual Chute mode Jayamohan Kallickal
2013-09-13  5:10 ` [PATCH 12/22] be2iscsi: Fix CID allocation/freeing to support Dual Chute Mode Jayamohan Kallickal
2013-09-13  5:10 ` [PATCH 13/22] be2iscsi: Fix connection offload to support Dual Chute Jayamohan Kallickal
2013-09-13  5:10 ` [PATCH 14/22] be2iscsi: Fix chute cleanup during drivers unload Jayamohan Kallickal
2013-09-13  5:10 ` [PATCH 15/22] be2iscsi: Dispaly CID available for connection offload Jayamohan Kallickal
2013-09-13  5:10 ` [PATCH 16/22] be2iscsi: Display Port Identifier for each iSCSI function Jayamohan Kallickal
2013-09-13  5:10 ` [PATCH 17/22] be2iscsi: Fix MSIx creation for SKH-R adapter Jayamohan Kallickal
2013-09-13  5:10 ` [PATCH 18/22] be2iscsi: Fix log level for protocol specific logs Jayamohan Kallickal
2013-09-13  5:10 ` [PATCH 19/22] be2iscsi: Fix Insufficient Buffer Error returned in MBX Completion Jayamohan Kallickal
2013-09-13  5:10 ` [PATCH 20/22] be2iscsi: Invalidate WRB in Abort/Reset Path Jayamohan Kallickal
2013-09-13  5:10 ` [PATCH 21/22] be2iscsi: Fix AER handling in driver Jayamohan Kallickal
2013-09-13  5:10 ` [PATCH 22/22] be2iscsi: Bump driver version Jayamohan Kallickal
2013-09-13  5:10 ` [PATCH 00/22] be2iscsi: Update to 10.0.635.0 Jayamohan Kallickal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52395795.6000100@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=Jayamohan.Kallickal@Emulex.Com \
    --cc=Sony.John-N@Emulex.Com \
    --cc=jayamohank@gmail.com \
    --cc=jbottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox