All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: Michael Reed <mdr@sgi.com>
Cc: linux-scsi@vger.kernel.org, david.somayajulu@qlogic.com,
	andrew.vasquez@qlogic.com, James.Smart@Emulex.com,
	Eric.Moore@lsil.com
Subject: Re: [PATCH 9/9] mptfc: convert mptfc to use fc queueing helper.
Date: Mon, 17 Mar 2008 13:39:37 -0500	[thread overview]
Message-ID: <47DEBAE9.8090701@cs.wisc.edu> (raw)
In-Reply-To: <47DEB93E.8050909@cs.wisc.edu>

Mike Christie wrote:
> Michael Reed wrote:
>>
>> michaelc@cs.wisc.edu wrote:
>>> From: Mike Christie <michaelc@cs.wisc.edu>
>>>
>>> Convert mptfc to use fc queueing helper.
>>
>> I've been trying to exercise the fusion FC change.
>> I can't seem to force the code into returning either
>> TARGET_BUSY or DID_NO_CONNECT.  Any suggestions on
> 
> Did you mean DID_IMM_RETRY in the original code?
> 
>> how I might get a command down to the driver while
>> the rport is blocked or in DEVLOSS_PENDING?
>>
>> I've been running 32 outstanding commands to 16 targets,
>> disabling/enabling the various FC switch ports, AND
>> I disabled the usage of the scsi_host_lock in
>> fc_remote_port_delete() and I unlock/relock it in the
>> mptfc_qmnd() function.
>>
> 
> For FC it is a small window where the rport is being blocked but the 
> scsi_device is not yet in the blocked state. Instead of lots of targets 
> you want lots of devices on just one target.
> 
> To test it with just one device you can just add a sleep in 
> fc_remote_port_delete after the port_state and flags are set and the 
> host lock is dropped and before the call to scsi_target_block.
> 
>        rport->port_state = FC_PORTSTATE_BLOCKED;
> 
>         rport->flags |= FC_RPORT_DEVLOSS_PENDING;
> 
>         spin_unlock_irqrestore(shost->host_lock, flags);
> 
>         if (rport->roles & FC_PORT_ROLE_FCP_INITIATOR &&
>             shost->active_mode & MODE_TARGET)
>                 fc_tgt_it_nexus_destroy(shost, (unsigned long)rport);
> 
> 
> ssleep(1);
> 
>         scsi_target_block(&rport->dev);

I think we could actually avoid the transition checks if we just held 
the host lock around the code we set the port state and when we call 
scsi_target_block. scsi_target_block would just need to be modified so 
that it did not grab the host lock (the driver model code does not use a 
mutex anymore).

On the scsi_target_unblock side we would grab the host lock and set the 
rport state and unblock the devices at the same time. Again we would 
need to not take the host lock when looping over the devices and we 
could just plug the queue instead of running the request_fn (because 
performance is not an issue in this code path instead of using 
blk_start_queue we could call somehing that cleared the stop flag and 
always plugged the queue).

  reply	other threads:[~2008-03-17 18:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-02  9:03 [PATCH 1/9] scsi: Add helper code so transport classes/driver can control queueing michaelc
2008-03-02  9:03 ` [PATCH 2/9] iscsi: user per target can_queue and return SCSI_MLQUEUE_TARGET_BUSY michaelc
2008-03-02  9:03   ` [PATCH 3/9] iscsi class: add iscsi queueing helper michaelc
2008-03-02  9:03     ` [PATCH 4/9] qla4xxx: use SCSI_ML_TARGET_BUSY and iscsi helper michaelc
2008-03-02  9:03       ` [PATCH 5/9] libiscsi: use iscsi queueing helper michaelc
2008-03-02  9:03         ` [PATCH 6/9] fc class: add fc " michaelc
2008-03-02  9:03           ` [PATCH 7/9] qla2xxx: convert to use fc helper and SCSI_MLQUEUE_TARGET_BUSY michaelc
2008-03-02  9:03             ` [PATCH 8/9] lpfc: " michaelc
2008-03-02  9:03               ` [PATCH 9/9] mptfc: convert mptfc to use fc queueing helper michaelc
2008-03-13 18:53                 ` Michael Reed
2008-03-17 18:32                   ` Mike Christie
2008-03-17 18:39                     ` Mike Christie [this message]
2008-03-13 14:35           ` [PATCH 6/9] fc class: add " Michael Reed
2008-03-13 15:36             ` Mike Christie
2008-03-03 17:34       ` [PATCH 4/9] qla4xxx: use SCSI_ML_TARGET_BUSY and iscsi helper David C Somayajulu
2008-03-02  9:08 ` [PATCH 1/9] scsi: Add helper code so transport classes/driver can control queueing Mike Christie
2008-03-18  4:38 ` Mike Christie

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=47DEBAE9.8090701@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=Eric.Moore@lsil.com \
    --cc=James.Smart@Emulex.com \
    --cc=andrew.vasquez@qlogic.com \
    --cc=david.somayajulu@qlogic.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mdr@sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.