From: John Snow <jsnow@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
Eric Blake <eblake@redhat.com>,
keith.busch@intel.com, mreitz@redhat.com, pbonzini@redhat.com,
qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] dma-helpers: explicitly pass alignment into dma-helpers
Date: Wed, 12 Oct 2016 12:04:06 -0400 [thread overview]
Message-ID: <2c7681e5-4b4b-263a-b2e3-6236f951a2d7@redhat.com> (raw)
In-Reply-To: <20161012102207.GF5544@noname.redhat.com>
On 10/12/2016 06:22 AM, Kevin Wolf wrote:
> Am 11.10.2016 um 17:47 hat John Snow geschrieben:
>> On 10/10/2016 03:23 PM, Mark Cave-Ayland wrote:
>>> On 10/10/16 17:34, Eric Blake wrote:
>>>
>>>> On 10/09/2016 11:43 AM, Mark Cave-Ayland wrote:
>>>>> The hard-coded default alignment is BDRV_SECTOR_SIZE, however this is not
>>>>> necessarily the case for all platforms. Use this as the default alignment for
>>>>> all current callers.
>>>>>
>>>>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>>>>> ---
>>>>
>>>>> @@ -160,8 +161,8 @@ static void dma_blk_cb(void *opaque, int ret)
>>>>> return;
>>>>> }
>>>>>
>>>>> - if (dbs->iov.size & ~BDRV_SECTOR_MASK) {
>>>>> - qemu_iovec_discard_back(&dbs->iov, dbs->iov.size & ~BDRV_SECTOR_MASK);
>>>>> + if (dbs->iov.size & (dbs->align - 1)) {
>>>>> + qemu_iovec_discard_back(&dbs->iov, dbs->iov.size & (dbs->align - 1));
>>>>
>>>> Would it be any smarter to use osdep.h's QEMU_IS_ALIGNED(dbs->iov.size,
>>>> dbs->align) and QEMU_ALIGN_DOWN(dbs->iov.size, dbs->align)?
>>>> Semantically it is the same, but the macros make it obvious what the
>>>> bit-twiddling is doing.
>>>>
>>>> Unless you think that needs a tweak,
>>>> Reviewed-by: Eric Blake <eblake@redhat.com>
>>>
>>> I can't say I feel too strongly about it since there are plenty of other
>>> examples of this style in the codebase, so I'm happy to go with whatever
>>> John/Paolo are most happy with.
>>>
>>>
>>> ATB,
>>>
>>> Mark.
>>>
>>
>> I can't pretend I am consistent, but when in doubt use the macro.
>> Not worth a respin IMO, but I think this falls out of my
>> jurisdiction :)
>>
>> Acked-by: John Snow <jsnow@redhat.com>
>
> dma-helpers.c is officially unmaintained, and as the other patch is
> clearly IDE, I think the series should go through your tree.
>
> Kevin
>
Oh! I was under the impression that Paolo had the dma-helpers. My
mistake. I will test and stage this.
--js
next prev parent reply other threads:[~2016-10-12 16:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-09 16:43 [Qemu-devel] [PATCH 0/2] dma-helpers: explicitly pass alignment into dma-helpers Mark Cave-Ayland
2016-10-09 16:43 ` [Qemu-devel] [PATCH 1/2] " Mark Cave-Ayland
2016-10-10 16:34 ` Eric Blake
2016-10-10 19:23 ` Mark Cave-Ayland
2016-10-11 15:47 ` John Snow
2016-10-12 10:22 ` Kevin Wolf
2016-10-12 16:04 ` John Snow [this message]
2016-10-09 16:43 ` [Qemu-devel] [PATCH 2/2] macio: switch over to new byte-aligned DMA helpers Mark Cave-Ayland
2016-10-10 16:50 ` Eric Blake
2016-10-11 16:58 ` John Snow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2c7681e5-4b4b-263a-b2e3-6236f951a2d7@redhat.com \
--to=jsnow@redhat.com \
--cc=eblake@redhat.com \
--cc=keith.busch@intel.com \
--cc=kwolf@redhat.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).