Re: [PATCH v3 3/7] block: add max_hw_transfer to BlockLimits

2021-06-17 Thread Paolo Bonzini
On 16/06/21 15:46, Max Reitz wrote: Given that the checkpatch complaint is only a warning, I think it’s OK to keep the comment as it is here, and perhaps optionally fix all comments in block_int.h in a follow-up. I don’t think we need to fix existing comments, but, well, it wouldn’t be wrong.

Re: [PATCH v3 3/7] block: add max_hw_transfer to BlockLimits

2021-06-16 Thread Max Reitz
On 16.06.21 15:18, Paolo Bonzini wrote: On 15/06/21 18:18, Max Reitz wrote:   } +/* Returns the maximum hardware transfer length, in bytes; guaranteed nonzero */ +uint64_t blk_get_max_hw_transfer(BlockBackend *blk) +{ +    BlockDriverState *bs = blk_bs(blk); +    uint64_t max = INT_MAX; + +   

Re: [PATCH v3 3/7] block: add max_hw_transfer to BlockLimits

2021-06-16 Thread Paolo Bonzini
On 15/06/21 18:18, Max Reitz wrote:   } +/* Returns the maximum hardware transfer length, in bytes; guaranteed nonzero */ +uint64_t blk_get_max_hw_transfer(BlockBackend *blk) +{ +    BlockDriverState *bs = blk_bs(blk); +    uint64_t max = INT_MAX; + +    if (bs) { +    max = MIN_NON_ZERO(bs

Re: [PATCH v3 3/7] block: add max_hw_transfer to BlockLimits

2021-06-15 Thread Max Reitz
On 03.06.21 15:37, Paolo Bonzini wrote: For block host devices, I/O can happen through either the kernel file descriptor I/O system calls (preadv/pwritev, io_submit, io_uring) or the SCSI passthrough ioctl SG_IO. In the latter case, the size of each transfer can be limited by the HBA, while for

Re: [PATCH v3 3/7] block: add max_hw_transfer to BlockLimits

2021-06-04 Thread Paolo Bonzini
On 03/06/21 19:33, Eric Blake wrote: +/* Returns the maximum hardware transfer length, in bytes; guaranteed nonzero */ +uint64_t blk_get_max_hw_transfer(BlockBackend *blk) +{ +BlockDriverState *bs = blk_bs(blk); +uint64_t max = INT_MAX; This is an unaligned value; should we instead rou

Re: [PATCH v3 3/7] block: add max_hw_transfer to BlockLimits

2021-06-03 Thread Eric Blake
On Thu, Jun 03, 2021 at 03:37:18PM +0200, Paolo Bonzini wrote: > For block host devices, I/O can happen through either the kernel file > descriptor I/O system calls (preadv/pwritev, io_submit, io_uring) > or the SCSI passthrough ioctl SG_IO. > > In the latter case, the size of each transfer can be

[PATCH v3 3/7] block: add max_hw_transfer to BlockLimits

2021-06-03 Thread Paolo Bonzini
For block host devices, I/O can happen through either the kernel file descriptor I/O system calls (preadv/pwritev, io_submit, io_uring) or the SCSI passthrough ioctl SG_IO. In the latter case, the size of each transfer can be limited by the HBA, while for file descriptor I/O the kernel is able to