From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Christian Hoff <christian.hoff@de.ibm.com>,
linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
rusty@rustcorp.com.au, mst@redhat.com, kvm@vger.kernel.org
Subject: Re: Pe: [PATCH v5 1/3] virtio-scsi: first version
Date: Tue, 07 Feb 2012 12:56:04 +0100 [thread overview]
Message-ID: <4F311154.9080407@de.ibm.com> (raw)
In-Reply-To: <4F30F4EE.4080607@redhat.com>
>> + cmd->req.cmd = (struct virtio_scsi_cmd_req){
>> + .lun[0] = 1,
>> + .lun[1] = sc->device->id,
>> + .lun[2] = (sc->device->lun>> 8) | 0x40,
>> + .lun[3] = sc->device->lun& 0xff,
>> + [...]
>> + };
>>
>> Can't we have seperate fields for the SCSI target ID and the LUN number
>> here? Putting all this into a single field seems confusing. The following
>> line of code (sc->device->lun>> 8) | 0x40 essentially means that LUN
>> numbers will be limited to 8+6 Bits=14 Bits for no obvious reason that I
>> can see. Maybe we could just split the LUN field up into two uint32 fields
>> for target ID and LUN number?
>
> The 14-bit limitation can be lifted. SAM defines a 24-bit LUN format too,
> but I've never seen it used in practice.
Why not lift that limitation before the first version is committed upstream?
As far as I see we have to allocate multiple target ids if we want
to provide multipath (e.g. 8 target ids if there are 8 pathes, thus limiting
ourselves to 64 targets, no?)
As a compromise between space/flexibility, cant we just split the 4 bytes
in a similar fashion as our major/minor numbers (12/20bit)?
In the mainframe area I have seen real-life problems hitting the 64k
device limit for disks (mostly due to multipathing), it was extended
afterwards, but every extension tends to make an interface less
appealing. (look at some virtio drivers and you will find places
were feature bits made the code "less pretty")
>
>> Also, lun[1] = sc->device->id means that only 255 SCSI target IDs will be
>> supported. Think about bigger usage scenarios, such as FCP networks with
>> several hundred HBAs in the net. If you want to have the target ID<->HBA
>> mapping the same as on the guest as on the host, then 255 virtual target
>> IDs could be a limit.
>
> I think you would hit other scalability limitations well before that.
Performance might be fixed later, but the interface is then settled.
[..]
> But in any case, we could still use the fixed "1" byte to go beyond 255 targets.
Again, why not now? Any extension would require a feature bit, no?
Is there a technical reason why a fixed 1 here is better than just using that space
as scsi id? (e.g. hash table sizes, lookup etc)
Regards
Christian
PS: what puzzles me as well, is the fact that struct virtio_scsi_cmd_req has lun[8]
in the structure. That would sum up as 5 bytes wasted of those 8, no?
next prev parent reply other threads:[~2012-02-07 11:56 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-06 9:51 Pe: [PATCH v5 1/3] virtio-scsi: first version Christian Hoff
2012-02-07 9:54 ` Paolo Bonzini
2012-02-07 11:10 ` Michael S. Tsirkin
2012-02-07 11:26 ` Paolo Bonzini
2012-02-07 11:56 ` Christian Borntraeger [this message]
2012-02-07 12:31 ` Paolo Bonzini
2012-02-07 13:18 ` Christian Borntraeger
2012-02-07 13:59 ` Christian Hoff
2012-02-07 14:28 ` Paolo Bonzini
2012-02-08 13:37 ` Christian Hoff
2012-02-09 9:25 ` Paolo Bonzini
2012-02-09 12:18 ` Christian Hoff
2012-02-12 20:16 ` James Bottomley
2012-02-12 23:41 ` Rusty Russell
2012-02-13 7:05 ` Christian Borntraeger
2012-02-13 7:57 ` Dor Laor
2012-02-13 12:40 ` Nicholas A. Bellinger
2012-02-13 12:54 ` Dor Laor
2012-02-13 13:00 ` Michael S. Tsirkin
2012-02-13 13:13 ` ronnie sahlberg
2012-02-13 13:17 ` Paolo Bonzini
2012-02-13 13:18 ` Michael S. Tsirkin
2012-02-13 15:12 ` Hannes Reinecke
2012-02-13 20:42 ` ronnie sahlberg
2012-02-13 20:53 ` ronnie sahlberg
2012-02-13 22:59 ` Michael S. Tsirkin
2012-02-13 23:30 ` ronnie sahlberg
2012-02-13 23:33 ` Michael S. Tsirkin
2012-02-14 0:49 ` ronnie sahlberg
2012-02-14 1:11 ` Michael S. Tsirkin
2012-02-14 9:57 ` Paolo Bonzini
2012-02-13 11:08 ` Bart Van Assche
2012-02-13 9:19 ` Paolo Bonzini
2012-02-14 0:07 ` Rusty Russell
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=4F311154.9080407@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=christian.hoff@de.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=rusty@rustcorp.com.au \
/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