[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
Re: [Qemu-block] [PATCH v4 7/8] nbd: Implement NBD_INFO_BLOCK_SIZE on server
Wed, 22 Feb 2017 18:26:57 +0100
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 = 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
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.
Description: OpenPGP digital signature
[Qemu-block] [PATCH v4 6/8] nbd: Implement NBD_OPT_GO on client, Eric Blake, 2017/02/20
[Qemu-block] [PATCH v4 4/8] nbd: Expose and debug more NBD constants, Eric Blake, 2017/02/20
[Qemu-block] [PATCH v4 5/8] nbd: Implement NBD_OPT_GO on server, Eric Blake, 2017/02/20
[Qemu-block] [PATCH v4 8/8] nbd: Implement NBD_INFO_BLOCK_SIZE on client, Eric Blake, 2017/02/20