public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Roland Dreier <rolandd@cisco.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: I want scsi_target_block() in interrupt context
Date: Wed, 29 Jun 2005 18:36:29 +0100	[thread overview]
Message-ID: <20050629173629.GA32197@infradead.org> (raw)
In-Reply-To: <52fyv1dqer.fsf@topspin.com>

On Wed, Jun 29, 2005 at 10:27:40AM -0700, Roland Dreier wrote:
> I'm working on an implementation of SCSI RDMA Protocol (SRP) on
> InfiniBand, and I'm running into an issue managing the number of
> commands that get queued.
> 
> The setup is like this: each SRP scsi_host can connect to multiple
> target ports.  Each target port can have multiple LUNs behind it.  To
> support this, for each connection, I create a device, set its parent
> to the scsi_host's shost_gendev, and then call scsi_scan_target to
> discover the LUNs behind the target port.
> 
> This mostly works fine, except the number of outstanding commands is
> limited per connection.  This doesn't fit that well with the Linux
> SCSI stack -- can_queue for the scsi_host doesn't work, since a single
> scsi_host can have multiple connections, and cmd_per_lun doesn't work
> since a single connection can have many LUNs.
> 
> What seems like it _would_ be exactly what I need would be calling
> scsi_target_block() on the device representing the connection.
> Unfortunately, scsi_target_block() uses all sorts of device model
> stuff that takes semaphores and hence potentially sleeps.  This means
> that I can't block a connection while holding a lock to prevent races.
> 
> So I don't see a race-free way I can ensure that I never queue up too
> many commands on a given connection.

Just allocate one scsi_host per connection.


  reply	other threads:[~2005-06-29 17:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-29 17:27 I want scsi_target_block() in interrupt context Roland Dreier
2005-06-29 17:36 ` Christoph Hellwig [this message]
2005-06-29 17:52   ` Roland Dreier
2005-06-29 20:20     ` Mike Christie
2005-06-29 20:41       ` Roland Dreier
2005-06-29 20:48         ` Mike Christie
2005-06-30  0:01           ` Roland Dreier
2005-07-01  0:24             ` 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=20050629173629.GA32197@infradead.org \
    --to=hch@infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=rolandd@cisco.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox