qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v4 7/8] nbd: Implement NBD_INFO_BLOCK_SIZE on se


From: Paolo Bonzini
Subject: Re: [Qemu-block] [PATCH v4 7/8] nbd: Implement NBD_INFO_BLOCK_SIZE on server
Date: Wed, 22 Feb 2017 18:26:57 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0


On 22/02/2017 18:11, Eric Blake wrote:
>>> +    /* preferred - At least 4096, but larger as appropriate. */
>>> +    sizes[1] = MAX(blk_get_opt_transfer(exp->blk), 4096);
>
> The NBD specification requires a non-zero power-of-2 number if the
> server transmits the block size at all; 1 is the ideal number, followed
> by whatever actual size we learn from the request_align of the device.

Oh, so it's the smallest "good" transfer size, or the preferred
alignment.  That's not the same as the SCSI definition, which is:

   If a device server receives one of these commands with a transfer
   size greater than this value, then the device server may incur
   delays in processing the command. An OPTIMAL TRANSFER LENGTH field
   set to 0000_0000h indicates that the device server does not report
   an optimal transfer size.

It's more similar to the physical block size:

   When using logical block access commands (see 4.2.2), application
   clients should:
   a) specify an LBA that is aligned to a physical block boundary; and
   b) access an integral number of physical blocks, provided that the
   access does not go beyond the last LBA on the medium.

So I'd rather ignore it in the client, and send 4096 in the server.

Paolo

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]