[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/4] scsi-disk: introduce dma_readv and dma_writ
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 3/4] scsi-disk: introduce dma_readv and dma_writev |
Date: |
Thu, 19 May 2016 17:13:45 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 |
On 19/05/2016 17:11, Eric Blake wrote:
>> > @@ -339,14 +354,16 @@ static void scsi_do_read(SCSIDiskReq *r, int ret)
>> > if (r->req.sg) {
>> > dma_acct_start(s->qdev.conf.blk, &r->acct, r->req.sg,
>> > BLOCK_ACCT_READ);
>> > r->req.resid -= r->req.sg->size;
>> > - r->req.aiocb = dma_blk_read(s->qdev.conf.blk, r->req.sg,
>> > r->sector,
>> > - scsi_dma_complete, r);
>> > + r->req.aiocb = dma_blk_io(blk_get_aio_context(s->qdev.conf.blk),
>> > + r->req.sg, r->sector,
>> > + sdc->dma_readv, r, scsi_dma_complete, r,
>> > + DMA_DIRECTION_FROM_DEVICE);
>
> Is it worth considering byte-based rather than sector-based interfaces,
> as part of this series?
I think it's a separate change. I'm okay with doing the switch to
byte-based interfaces first. Another related change would be to add a
"mask" argument, so that I could generalize this:
if (dbs->iov.size & ~BDRV_SECTOR_MASK) {
qemu_iovec_discard_back(&dbs->iov,
dbs->iov.size & ~BDRV_SECTOR_MASK);
}
For this series the mask needs to be the logical block size.
Thanks,
Paolo
signature.asc
Description: OpenPGP digital signature