All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Hai Dong,Li" <haidongl@linux.vnet.ibm.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Hannes Reinecke <hare@suse.de>,
	Stefan Hajnoczi <stefanha@gmail.com>,
	Christoph Hellwig <chellwig@redhat.com>,
	Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
	kvm@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Virtualization <virtualization@lists.linux-foundation.org>,
	"Nicholas A. Bellinger" <nab@linux-iscsi.org>
Subject: Re: virtio scsi host draft specification, v3
Date: Mon, 04 Jul 2011 21:38:43 +0800	[thread overview]
Message-ID: <4E11C263.3010003@linux.vnet.ibm.com> (raw)
In-Reply-To: <4E0D86E0.1020406@redhat.com>

On 07/01/2011 09:14 AM, Hannes Reinecke wrote:
>> Actually, the kernel does _not_ do a LUN remapping.
>
> Not the kernel, the in-kernel target.  The in-kernel target can and will
> map hardware LUNs (target_lun in drivers/target/*) to arbitrary LUNs
> (mapped_lun).
>
>>> Put in another way: the virtio-scsi device is itself a SCSI
>>> target,
>>
>> Argl. No way. The virtio-scsi device has to map to a single LUN.
>
> I think we are talking about different things. By "virtio-scsi device"
> I meant the "virtio-scsi HBA".  When I referred to a LUN as seen by the
> guest, I was calling it a "virtual SCSI device".  So yes, we were
> calling things with different names.  Perhaps from now on
> we can call them virtio-scsi {initiator,target,LUN} and have no
> ambiguity?  I'll also modify the spec in this sense.
>
>> The SCSI spec itself only deals with LUNs, so anything you'll read in
>> there obviously will only handle the interaction between the
>> initiator (read: host) and the LUN itself. However, the actual
>> command is send via an intermediat target, hence you'll always see
>> the reference to the ITL (initiator-target-lun) nexus.
>
> Yes, this I understand.
>
>> The SCSI spec details discovery of the individual LUNs presented by a
>> given target, it does _NOT_ detail the discovery of the targets
>> themselves.  That is being delegated to the underlying transport
>
> And in fact I have this in virtio-scsi too, since virtio-scsi _is_ a
> transport:
Oh, here I catch up. I was wondering why there're ordering issues when 
talking
about virtio-scsi, since in SAM3, the third and the last paragraph of 
section
4.6.3 Request/Response ordering clearly describe it:

The manner in which ordering constraints are established is vendor 
specific. An
implementation may delegate this responsibility to the application client
(e.g., the device driver). In-order delivery may be an intrinsic property of
the service delivery subsystem or a requirement established by the SCSI
transport protocol standard.

To simplify the description of behavior, the SCSI architecture model assumes
in-order delivery of requests or responses to be a property of the service
delivery subsystem. This assumption does not constitute a requirement.  The
SCSI architecture model makes no assumption about and places no 
requirement on
the ordering of requests or responses for different I_T nexuses.

So if I understand correctly, virtio-scsi looks like an SCSI tranport 
protocol,
such as iSCSI, FCP and SRP which use tcp/ip, FC and Infiniband RDMA
respectively as the transfer media while virtio-scsi uses virtio, an 
virtual IO
channel, as the transfer media?

>
>     When VIRTIO_SCSI_EVT_RESET_REMOVED or VIRTIO_SCSI_EVT_RESET_RESCAN
>     is sent for LUN 0, the driver should ask the initiator to rescan
>     the target, in order to detect the case when an entire target has
>     appeared or disappeared.
>
>     [If the device fails] to report an event due to missing buffers,
>     [...] the driver should poll the logical units for unit attention
>     conditions, and/or do whatever form of bus scan is appropriate for
>     the guest operating system.
>
>> In the case of NPIV it would make sense to map the virtual SCSI host
>>  to the backend, so that all devices presented to the virtual SCSI
>> host will be presented to the backend, too. However, when doing so
>> these devices will normally be referenced by their original LUN, as
>> these will be presented to the guest via eg 'REPORT LUNS'.
>
> Right.
>
>> The above thread now tries to figure out if we should remap those LUN
>> numbers or just expose them as they are. If we decide on remapping,
>> we have to emulate _all_ commands referring explicitely to those LUN
>> numbers (persistent reservations, anyone?).
>
> But it seems to me that commands referring explicitly to LUN numbers
> most likely have to be reimplemented anyway for virtualization.  I'm
> thinking exactly of persistent reservations.  If two guests on the same
> host try a persistent reservation, they should conflict with each other.
> If reservation commands were just passed through, they would be seen
> as coming from the same initiator (the HBA driver or iSCSI initiator in
> the host OS).
>
> etc.
>
>> If we don't, we would expose some hardware detail to the guest, but
>> would save us _a lot_ of processing.
>
> But can we afford it?  And would the architecture allow that at all?
>
> Paolo
> -- 
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



WARNING: multiple messages have this Message-ID (diff)
From: "Hai Dong,Li" <haidongl@linux.vnet.ibm.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Christoph Hellwig <chellwig@redhat.com>,
	Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
	kvm@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>,
	Stefan Hajnoczi <stefanha@gmail.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	"Nicholas A. Bellinger" <nab@linux-iscsi.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Hannes Reinecke <hare@suse.de>,
	Linux Virtualization <virtualization@lists.linux-foundation.org>
Subject: Re: [Qemu-devel] virtio scsi host draft specification, v3
Date: Mon, 04 Jul 2011 21:38:43 +0800	[thread overview]
Message-ID: <4E11C263.3010003@linux.vnet.ibm.com> (raw)
In-Reply-To: <4E0D86E0.1020406@redhat.com>

On 07/01/2011 09:14 AM, Hannes Reinecke wrote:
>> Actually, the kernel does _not_ do a LUN remapping.
>
> Not the kernel, the in-kernel target.  The in-kernel target can and will
> map hardware LUNs (target_lun in drivers/target/*) to arbitrary LUNs
> (mapped_lun).
>
>>> Put in another way: the virtio-scsi device is itself a SCSI
>>> target,
>>
>> Argl. No way. The virtio-scsi device has to map to a single LUN.
>
> I think we are talking about different things. By "virtio-scsi device"
> I meant the "virtio-scsi HBA".  When I referred to a LUN as seen by the
> guest, I was calling it a "virtual SCSI device".  So yes, we were
> calling things with different names.  Perhaps from now on
> we can call them virtio-scsi {initiator,target,LUN} and have no
> ambiguity?  I'll also modify the spec in this sense.
>
>> The SCSI spec itself only deals with LUNs, so anything you'll read in
>> there obviously will only handle the interaction between the
>> initiator (read: host) and the LUN itself. However, the actual
>> command is send via an intermediat target, hence you'll always see
>> the reference to the ITL (initiator-target-lun) nexus.
>
> Yes, this I understand.
>
>> The SCSI spec details discovery of the individual LUNs presented by a
>> given target, it does _NOT_ detail the discovery of the targets
>> themselves.  That is being delegated to the underlying transport
>
> And in fact I have this in virtio-scsi too, since virtio-scsi _is_ a
> transport:
Oh, here I catch up. I was wondering why there're ordering issues when 
talking
about virtio-scsi, since in SAM3, the third and the last paragraph of 
section
4.6.3 Request/Response ordering clearly describe it:

The manner in which ordering constraints are established is vendor 
specific. An
implementation may delegate this responsibility to the application client
(e.g., the device driver). In-order delivery may be an intrinsic property of
the service delivery subsystem or a requirement established by the SCSI
transport protocol standard.

To simplify the description of behavior, the SCSI architecture model assumes
in-order delivery of requests or responses to be a property of the service
delivery subsystem. This assumption does not constitute a requirement.  The
SCSI architecture model makes no assumption about and places no 
requirement on
the ordering of requests or responses for different I_T nexuses.

So if I understand correctly, virtio-scsi looks like an SCSI tranport 
protocol,
such as iSCSI, FCP and SRP which use tcp/ip, FC and Infiniband RDMA
respectively as the transfer media while virtio-scsi uses virtio, an 
virtual IO
channel, as the transfer media?

>
>     When VIRTIO_SCSI_EVT_RESET_REMOVED or VIRTIO_SCSI_EVT_RESET_RESCAN
>     is sent for LUN 0, the driver should ask the initiator to rescan
>     the target, in order to detect the case when an entire target has
>     appeared or disappeared.
>
>     [If the device fails] to report an event due to missing buffers,
>     [...] the driver should poll the logical units for unit attention
>     conditions, and/or do whatever form of bus scan is appropriate for
>     the guest operating system.
>
>> In the case of NPIV it would make sense to map the virtual SCSI host
>>  to the backend, so that all devices presented to the virtual SCSI
>> host will be presented to the backend, too. However, when doing so
>> these devices will normally be referenced by their original LUN, as
>> these will be presented to the guest via eg 'REPORT LUNS'.
>
> Right.
>
>> The above thread now tries to figure out if we should remap those LUN
>> numbers or just expose them as they are. If we decide on remapping,
>> we have to emulate _all_ commands referring explicitely to those LUN
>> numbers (persistent reservations, anyone?).
>
> But it seems to me that commands referring explicitly to LUN numbers
> most likely have to be reimplemented anyway for virtualization.  I'm
> thinking exactly of persistent reservations.  If two guests on the same
> host try a persistent reservation, they should conflict with each other.
> If reservation commands were just passed through, they would be seen
> as coming from the same initiator (the HBA driver or iSCSI initiator in
> the host OS).
>
> etc.
>
>> If we don't, we would expose some hardware detail to the guest, but
>> would save us _a lot_ of processing.
>
> But can we afford it?  And would the architecture allow that at all?
>
> Paolo
> -- 
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2011-07-04 13:38 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-07 13:43 virtio scsi host draft specification, v3 Paolo Bonzini
2011-06-07 13:43 ` [Qemu-devel] " Paolo Bonzini
2011-06-08 23:28 ` Rusty Russell
2011-06-08 23:28   ` [Qemu-devel] " Rusty Russell
2011-06-08 23:28   ` Rusty Russell
2011-06-09  6:59   ` Paolo Bonzini
2011-06-09  6:59     ` [Qemu-devel] " Paolo Bonzini
2011-06-10 11:33     ` Rusty Russell
2011-06-10 11:33     ` Rusty Russell
2011-06-10 11:33       ` [Qemu-devel] " Rusty Russell
2011-06-10 12:14       ` Stefan Hajnoczi
2011-06-10 12:14       ` Stefan Hajnoczi
2011-06-10 12:14         ` [Qemu-devel] " Stefan Hajnoczi
2011-06-10 12:22         ` Paolo Bonzini
2011-06-10 12:22         ` Paolo Bonzini
2011-06-10 12:22           ` [Qemu-devel] " Paolo Bonzini
2011-06-09  6:59   ` Paolo Bonzini
2011-06-08 23:28 ` Rusty Russell
2011-06-10 12:55 ` Hannes Reinecke
2011-06-10 12:55   ` [Qemu-devel] " Hannes Reinecke
2011-06-10 14:35   ` Paolo Bonzini
2011-06-10 14:35     ` [Qemu-devel] " Paolo Bonzini
2011-06-14  8:39     ` Hannes Reinecke
2011-06-14  8:39     ` Hannes Reinecke
2011-06-14  8:39       ` [Qemu-devel] " Hannes Reinecke
2011-06-14 15:53       ` Stefan Hajnoczi
2011-06-14 15:53         ` [Qemu-devel] " Stefan Hajnoczi
2011-06-14 15:53       ` Stefan Hajnoczi
2011-06-29  8:33       ` Paolo Bonzini
2011-06-29  8:33         ` [Qemu-devel] " Paolo Bonzini
2011-06-29  9:39         ` Stefan Hajnoczi
2011-06-29  9:39           ` [Qemu-devel] " Stefan Hajnoczi
2011-06-29 10:07           ` Christoph Hellwig
2011-06-29 10:07           ` Christoph Hellwig
2011-06-29 10:07             ` [Qemu-devel] " Christoph Hellwig
2011-06-29 10:23             ` Hannes Reinecke
2011-06-29 10:23               ` [Qemu-devel] " Hannes Reinecke
2011-06-29 10:27               ` Christoph Hellwig
2011-06-29 10:27               ` Christoph Hellwig
2011-06-29 10:27                 ` [Qemu-devel] " Christoph Hellwig
2011-06-29 10:23             ` Hannes Reinecke
2011-07-01  6:41           ` Paolo Bonzini
2011-07-01  6:41             ` [Qemu-devel] " Paolo Bonzini
2011-07-01  7:14             ` Hannes Reinecke
2011-07-01  7:14             ` Hannes Reinecke
2011-07-01  7:14               ` [Qemu-devel] " Hannes Reinecke
2011-07-01  8:35               ` Paolo Bonzini
2011-07-01  8:35               ` Paolo Bonzini
2011-07-01  8:35                 ` [Qemu-devel] " Paolo Bonzini
2011-07-04 13:38                 ` Hai Dong,Li [this message]
2011-07-04 13:38                   ` Hai Dong,Li
2011-07-04 14:22                   ` Stefan Hajnoczi
2011-07-04 14:22                     ` [Qemu-devel] " Stefan Hajnoczi
2011-07-04 14:22                   ` Stefan Hajnoczi
2011-07-04 13:38                 ` Hai Dong,Li
2011-07-01  6:41           ` Paolo Bonzini
2011-06-29  9:39         ` Stefan Hajnoczi
2011-06-29  8:33       ` Paolo Bonzini
2011-06-10 14:35   ` Paolo Bonzini
2011-06-12  7:51   ` Michael S. Tsirkin
2011-06-12  7:51     ` [Qemu-devel] " Michael S. Tsirkin
2011-06-14 15:30     ` Hannes Reinecke
2011-06-14 15:30     ` Hannes Reinecke
2011-06-14 15:30       ` [Qemu-devel] " Hannes Reinecke
2011-06-29 10:00       ` Christoph Hellwig
2011-06-29 10:00       ` Christoph Hellwig
2011-06-29 10:00         ` [Qemu-devel] " Christoph Hellwig
2011-06-29  8:23     ` Paolo Bonzini
2011-06-29  8:23     ` Paolo Bonzini
2011-06-29  8:23       ` [Qemu-devel] " Paolo Bonzini
2011-06-29  8:46       ` Michael S. Tsirkin
2011-06-29  8:46       ` Michael S. Tsirkin
2011-06-29  8:46         ` [Qemu-devel] " Michael S. Tsirkin
2011-06-29 10:03       ` Christoph Hellwig
2011-06-29 10:03         ` [Qemu-devel] " Christoph Hellwig
2011-06-29 10:06         ` Paolo Bonzini
2011-06-29 10:06           ` [Qemu-devel] " Paolo Bonzini
2011-06-29 10:31           ` Michael S. Tsirkin
2011-06-29 10:31             ` [Qemu-devel] " Michael S. Tsirkin
2011-06-29 10:35             ` Paolo Bonzini
2011-06-29 10:35             ` Paolo Bonzini
2011-06-29 10:35               ` [Qemu-devel] " Paolo Bonzini
2011-06-29 10:31           ` Michael S. Tsirkin
2011-06-29 10:06         ` Paolo Bonzini
2011-06-29 10:03       ` Christoph Hellwig
2011-06-29 10:01     ` Christoph Hellwig
2011-06-29 10:01       ` [Qemu-devel] " Christoph Hellwig
2011-06-29 10:01     ` Christoph Hellwig
2011-06-12  7:51   ` Michael S. Tsirkin
2011-06-10 12:55 ` Hannes Reinecke
  -- strict thread matches above, loose matches on Subject: below --
2011-06-07 13:43 Paolo Bonzini

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=4E11C263.3010003@linux.vnet.ibm.com \
    --to=haidongl@linux.vnet.ibm.com \
    --cc=chellwig@redhat.com \
    --cc=hare@suse.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=nab@linux-iscsi.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=stefanha@linux.vnet.ibm.com \
    --cc=virtualization@lists.linux-foundation.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 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.