public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: Hannes Reinecke <hare@suse.de>
Cc: lsf10-pc@lists.linuxfoundation.org,
	SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: [LSF/VM TOPIC] Handling of invalid requests in virtual HBAs
Date: Thu, 01 Apr 2010 22:33:12 -0700	[thread overview]
Message-ID: <1270186392.28897.76.camel@haakon2.linux-iscsi.org> (raw)
In-Reply-To: <4BB45632.5020700@suse.de>

On Thu, 2010-04-01 at 10:15 +0200, Hannes Reinecke wrote:
> Hi all,
> 

Greetings Hannes,

Just a few comments on your proposal..

> [Topic]
> Handling of invalid requests in virtual HBAs
> 
> [Abstract]
> This discussion will focus on the problem of correct request handling with virtual HBAs.
> For KVM I have implemented a 'megasas' HBA emulation which serves as a backend for the
> megaraid_sas linux driver.
> It is now possible to connect several disks from different (physical) HBAs to that
> HBA emulation, each having different logical capabilities wrt transfersize,
> sgl size, sgl length etc.
> 
> The goal of this discussion is how to determine the 'best' capability setting for the
> virtual HBA and how to handle hotplug scenarios, where a disk might be plugged in
> which has incompatible settings from the one the virtual HBA is using currently.
> 

Most of what you are describing here in terms of having a kernel target
enforce underlying LLD limitiations for LUNs is already available in TCM
v3.x.  Current TCM code will automatically handle the processing of a
single DATA_SG_IO CDB generated by KVM Guest + megasas emulation that
exceeds the underlying LLD max_sectors, and generate the multiple
internal se_task_t's in order to complete the original I/O generated by
KVM Guest + megasas.

This is one example but the main underlying question wrt to TCM and
interaction with Linux subsystems has historically been:

What values should be enforced by TCM based on metadata presented by TCM
subsystem plugins (pSCSI, IBLOCK, FILEIO) for struct block_device, and
what is expected to be enforced by underlying Linux subsystems
presenting struct block_device..?

For the virtual TCM subsystem plugin cases (IBLOCK, FILEIO, RAMDISK) the
can_queue is a competely arbitary value and is enforced by the
underyling Linux subsystem.  There are a couple of special cases:

*) For TCM/pSCSI, can_queue is enforced from struct scsi_device->queue_depth
   and max_sectors from the smaller of the two values from struct Scsi_Host->max_sectors
   and struct scsi_device->request_queue->limits.max_sectors.

*) For TCM/IBLOCK, max_sectors is enforced based on struct request_queue->limits.max_sectors.

*) For TCM/FILEIO and TCM/RAMDISK, both can_queue and max_sectors are
   set to arbitrarly high values.

Also I should mention that TCM_Loop code currently uses a hardcoded
struct scsi_host_template->can_queue=1 and ->max_sectors=128, but will
work fine with larger values.   Being able to change the Linux/SCSI
queue depth on the fly for TCM_Loop virtual SAS ports being used in KVM
guest could be quite useful for managing KVM Guest megasas emulation I/O
traffic on a larger scale..

The other big advantage of using TCM_Loop with your megasas guest
emulation means that existing TCM logic for >= SPC-3 T10 NAA naming, PR,
and ALUA emulation is immediately available to KVM guest, and does not
have to be reproduced in QEMU code.

Who knows, it might be interesting to be able to control KVM Guest disks
using ALUA primary and sectors access states, or even share a single
TCM_Loop virtual SAS Port using across multiple KVM Guests for cluster
purposes using persistent reservations..!

Best,

--nab


  reply	other threads:[~2010-04-02  5:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-01  8:15 [LSF/VM TOPIC] Handling of invalid requests in virtual HBAs Hannes Reinecke
2010-04-02  5:33 ` Nicholas A. Bellinger [this message]
2010-04-08 13:44   ` Hannes Reinecke
2010-04-10 23:50     ` Nicholas A. Bellinger
2010-04-10 15:31 ` Vladislav Bolkhovitin
2010-04-13  8:56   ` Hannes Reinecke
2010-04-13 17:09     ` Vladislav Bolkhovitin
2010-04-13 18:37       ` Nicholas A. Bellinger
2010-04-13 19:23         ` Vladislav Bolkhovitin
2010-04-13 20:45           ` Nicholas A. Bellinger
2010-04-14 12:59             ` Vladislav Bolkhovitin
2010-04-14 13:49               ` Nicholas A. Bellinger
2010-05-10  3:16 ` FUJITA Tomonori

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=1270186392.28897.76.camel@haakon2.linux-iscsi.org \
    --to=nab@linux-iscsi.org \
    --cc=hare@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=lsf10-pc@lists.linuxfoundation.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