Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 815379
Collapse All | Expand All

(-)a/block/block-backend.c (+6 lines)
Lines 1986-1991 uint32_t blk_get_max_transfer(BlockBackend *blk) Link Here
1986
    return ROUND_DOWN(max, blk_get_request_alignment(blk));
1986
    return ROUND_DOWN(max, blk_get_request_alignment(blk));
1987
}
1987
}
1988
1988
1989
int blk_get_max_hw_iov(BlockBackend *blk)
1990
{
1991
    return MIN_NON_ZERO(blk->root->bs->bl.max_hw_iov,
1992
                        blk->root->bs->bl.max_iov);
1993
}
1994
1989
int blk_get_max_iov(BlockBackend *blk)
1995
int blk_get_max_iov(BlockBackend *blk)
1990
{
1996
{
1991
    return blk->root->bs->bl.max_iov;
1997
    return blk->root->bs->bl.max_iov;
(-)a/block/file-posix.c (-1 / +1 lines)
Lines 1273-1279 static void raw_refresh_limits(BlockDriverState *bs, Error **errp) Link Here
1273
1273
1274
        ret = hdev_get_max_segments(s->fd, &st);
1274
        ret = hdev_get_max_segments(s->fd, &st);
1275
        if (ret > 0) {
1275
        if (ret > 0) {
1276
            bs->bl.max_iov = ret;
1276
            bs->bl.max_hw_iov = ret;
1277
        }
1277
        }
1278
    }
1278
    }
1279
}
1279
}
(-)a/block/io.c (+1 lines)
Lines 136-141 static void bdrv_merge_limits(BlockLimits *dst, const BlockLimits *src) Link Here
136
    dst->min_mem_alignment = MAX(dst->min_mem_alignment,
136
    dst->min_mem_alignment = MAX(dst->min_mem_alignment,
137
                                 src->min_mem_alignment);
137
                                 src->min_mem_alignment);
138
    dst->max_iov = MIN_NON_ZERO(dst->max_iov, src->max_iov);
138
    dst->max_iov = MIN_NON_ZERO(dst->max_iov, src->max_iov);
139
    dst->max_hw_iov = MIN_NON_ZERO(dst->max_hw_iov, src->max_hw_iov);
139
}
140
}
140
141
141
typedef struct BdrvRefreshLimitsState {
142
typedef struct BdrvRefreshLimitsState {
(-)a/hw/scsi/scsi-generic.c (-1 / +1 lines)
Lines 180-186 static int scsi_handle_inquiry_reply(SCSIGenericReq *r, SCSIDevice *s, int len) Link Here
180
        page = r->req.cmd.buf[2];
180
        page = r->req.cmd.buf[2];
181
        if (page == 0xb0) {
181
        if (page == 0xb0) {
182
            uint64_t max_transfer = blk_get_max_hw_transfer(s->conf.blk);
182
            uint64_t max_transfer = blk_get_max_hw_transfer(s->conf.blk);
183
            uint32_t max_iov = blk_get_max_iov(s->conf.blk);
183
            uint32_t max_iov = blk_get_max_hw_iov(s->conf.blk);
184
184
185
            assert(max_transfer);
185
            assert(max_transfer);
186
            max_transfer = MIN_NON_ZERO(max_transfer, max_iov * qemu_real_host_page_size)
186
            max_transfer = MIN_NON_ZERO(max_transfer, max_iov * qemu_real_host_page_size)
(-)a/include/block/block_int.h (+7 lines)
Lines 718-723 typedef struct BlockLimits { Link Here
718
     */
718
     */
719
    uint64_t max_hw_transfer;
719
    uint64_t max_hw_transfer;
720
720
721
    /* Maximal number of scatter/gather elements allowed by the hardware.
722
     * Applies whenever transfers to the device bypass the kernel I/O
723
     * scheduler, for example with SG_IO.  If larger than max_iov
724
     * or if zero, blk_get_max_hw_iov will fall back to max_iov.
725
     */
726
    int max_hw_iov;
727
721
    /* memory alignment, in bytes so that no bounce buffer is needed */
728
    /* memory alignment, in bytes so that no bounce buffer is needed */
722
    size_t min_mem_alignment;
729
    size_t min_mem_alignment;
723
730
(-)a/include/sysemu/block-backend.h (+1 lines)
Lines 211-216 uint32_t blk_get_request_alignment(BlockBackend *blk); Link Here
211
uint32_t blk_get_max_transfer(BlockBackend *blk);
211
uint32_t blk_get_max_transfer(BlockBackend *blk);
212
uint64_t blk_get_max_hw_transfer(BlockBackend *blk);
212
uint64_t blk_get_max_hw_transfer(BlockBackend *blk);
213
int blk_get_max_iov(BlockBackend *blk);
213
int blk_get_max_iov(BlockBackend *blk);
214
int blk_get_max_hw_iov(BlockBackend *blk);
214
void blk_set_guest_block_size(BlockBackend *blk, int align);
215
void blk_set_guest_block_size(BlockBackend *blk, int align);
215
void *blk_try_blockalign(BlockBackend *blk, size_t size);
216
void *blk_try_blockalign(BlockBackend *blk, size_t size);
216
void *blk_blockalign(BlockBackend *blk, size_t size);
217
void *blk_blockalign(BlockBackend *blk, size_t size);

Return to bug 815379