qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Paolo Bonzini <pbonzini@redhat.com>, Lin Ma <lma@suse.com>,
	Stefan Hajnoczi <stefanha@gmail.com>
Cc: Zhiqiang Zhou <ZZhou@suse.com>, Fam Zheng <famz@redhat.com>,
	mst@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] 答复: Re: [RFC] virtio-fc: draft idea of virtual fibre channel HBA
Date: Thu, 16 Feb 2017 10:56:42 +0100	[thread overview]
Message-ID: <154b3902-d891-f77a-3d59-09d80596ddff@suse.de> (raw)
In-Reply-To: <b50ed69e-ce2f-36d9-797b-5f6a5cf7850d@redhat.com>

On 02/16/2017 09:39 AM, Paolo Bonzini wrote:
> 
> 
> On 16/02/2017 08:16, Lin Ma wrote:
>>> What are the benefits of having FC access from the guest?
>>
>> Actually, I havn't dug it too much, Just thought that from virtualization's
>> perspective, when interact with FC storage, having complete FC access
>> from the guest is the way it should use.
> 
> How much of this requires a completely new spec?  Could we get enough of
> the benefit (e.g. the ability to issue rescans or LIPs on the host) by
> extending virtio-scsi?
> 
I guess I'd need to chime in with my favourite topic :-)

Initially I really would go with extending the virtio-scsi spec, as
'real' virtio-fc suffers from some issues:
While it's of course possible to implement a full fc stack in qemu
itself, it's not easily possible assign 'real' FC devices to the guest.
Problem here is that any virtio-fc would basically have to use the
standard FC frame format for virtio itself, but all 'real' FC HBAs
(excluding FCoE drivers) do _not_ allow access to the actual FC frames,
but rather present you with a 'cooked' version of them.
So if you were attempting to pass FC devices to the guest you would have
to implement yet-another conversion between raw FC frames and the
version the HBA would like.
And that doesn't even deal with the real complexity like generating
correct OXID/RXIDs etc.

So initially I would propose to update the virtio spec to include:
- Full 64bit LUNs
- A 64bit target port ID (well, _actually_ it should be a SCSI-compliant
  target port ID, but as this essentially is a free text field I'd
  restrict it to something sensible)
For full compability we'd also need a (64-bit) initiator ID, but that is
essentially a property of the virtio queue, so we don't need to transmit
it with every command; once during queue setup is enough.
And if we restrict virtio-scsi to point-to-point topology we can even
associate the target port ID with the virtio queue, making
implementation even easier.
I'm not sure if that is a good idea long-term, as one might want to
identify an NPIV host with a virtio device, in which case we're having a
1-M topology and that model won't work anymore.

To be precise:

I'd propose to update

struct virtio_scsi_config
with a field 'u8 initiator_id[8]'

and

struct virtio_scsi_req_cmd
with a field 'u8 target_id[8]'

and do away with the weird LUN remapping qemu has nowadays.

That should be enough to get proper NPIV passthrough working.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

  parent reply	other threads:[~2017-02-16  9:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15  7:15 [Qemu-devel] [RFC] virtio-fc: draft idea of virtual fibre channel HBA Lin Ma
2017-02-15 15:33 ` Stefan Hajnoczi
2017-02-16  7:16   ` [Qemu-devel] 答复: " Lin Ma
2017-02-16  8:39     ` Paolo Bonzini
2017-02-16  9:02       ` Lin Ma
2017-02-16  9:56       ` Hannes Reinecke [this message]
2017-02-22  8:19         ` Lin Ma
2017-02-22  9:20           ` Hannes Reinecke
2017-05-15 17:21             ` Paolo Bonzini
2017-05-16  6:34               ` Hannes Reinecke
2017-05-16  8:19                 ` Paolo Bonzini
2017-05-16 15:22                   ` Hannes Reinecke
2017-05-16 16:22                     ` Paolo Bonzini
2017-05-17  6:01                       ` Hannes Reinecke
2017-05-17  7:33                         ` 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=154b3902-d891-f77a-3d59-09d80596ddff@suse.de \
    --to=hare@suse.de \
    --cc=ZZhou@suse.com \
    --cc=famz@redhat.com \
    --cc=lma@suse.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=stefanha@redhat.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;
as well as URLs for NNTP newsgroup(s).