All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Auger Eric <eric.auger@redhat.com>
Cc: qemu-devel@nongnu.org, peterx@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCH v2 3/4] vfio/quirks: ioeventfd quirk acceleration
Date: Thu, 3 May 2018 08:48:16 -0600	[thread overview]
Message-ID: <20180503084816.072d59a9@w520.home> (raw)
In-Reply-To: <dbe7f81f-4301-62fe-34e6-0a1f2094da57@redhat.com>

On Thu, 3 May 2018 16:33:25 +0200
Auger Eric <eric.auger@redhat.com> wrote:
> > +    if (!vdev->no_kvm_ioeventfd &&
> > +        addr > PCI_STD_HEADER_SIZEOF && last->added < MAX_DYN_IOEVENTFD + 1) {  
> nit: <= MAX_DYN_IOEVENTFD?

Done, also the addr test should be >=, it doesn't make sense to exclude
the first byte after the standard capabilities, though for this quirk
we know we're looking well above this.

> > +        if (addr != last->addr || data != last->data || size != last->size) {
> > +            last->addr = addr;
> > +            last->data = data;
> > +            last->size = size;
> > +            last->hits = 1;
> > +        } else if (++last->hits >= HITS_FOR_IOEVENTFD) {
> > +            if (last->added < MAX_DYN_IOEVENTFD) {
> > +                VFIOIOEventFD *ioeventfd;
> > +                ioeventfd = vfio_ioeventfd_init(vdev, mirror->mem, addr, size,
> > +                                        data, &vdev->bars[mirror->bar].region,
> > +                                        mirror->offset + addr, true);
> > +                if (ioeventfd) {
> > +                    VFIOQuirk *quirk;
> > +
> > +                    QLIST_FOREACH(quirk,
> > +                                  &vdev->bars[mirror->bar].quirks, next) {
> > +                        if (quirk->data == mirror) {
> > +                            QLIST_INSERT_HEAD(&quirk->ioeventfds,
> > +                                              ioeventfd, next);
> > +                            break;
> > +                        }
> > +                    }
> > +
> > +                    assert(quirk != NULL); /* Check not found */
> > +
> > +                    last->added++;
> > +                }
> > +            } else {
> > +                last->added++;
> > +
> > +                error_report("NVIDIA ioeventfd queue full for %s, unable to "
> > +                             "accelerate 0x%"HWADDR_PRIx", data 0x%"PRIx64", "
> > +                             "size %u", vdev->vbasedev.name, addr, data, size);  
> nit: warn_report?

Done

... 
> > +typedef struct VFIOIOEventFD {
> > +    QLIST_ENTRY(VFIOIOEventFD) next;
> > +    MemoryRegion *mr;
> > +    hwaddr addr;
> > +    unsigned size;
> > +    uint64_t data;
> > +    EventNotifier e;
> > +    VFIORegion *region;
> > +    hwaddr region_addr;
> > +    bool match_data;
> > +    bool dynamic;  
> maybe the "dynamic" semantics may be docuemnted in the code and not only
> in the commit message.

Done, added

/* Added runtime, removed on device reset */

Thanks!

Alex

WARNING: multiple messages have this Message-ID (diff)
From: Alex Williamson <alex.williamson@redhat.com>
To: Auger Eric <eric.auger@redhat.com>
Cc: qemu-devel@nongnu.org, peterx@redhat.com, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH v2 3/4] vfio/quirks: ioeventfd quirk acceleration
Date: Thu, 3 May 2018 08:48:16 -0600	[thread overview]
Message-ID: <20180503084816.072d59a9@w520.home> (raw)
In-Reply-To: <dbe7f81f-4301-62fe-34e6-0a1f2094da57@redhat.com>

On Thu, 3 May 2018 16:33:25 +0200
Auger Eric <eric.auger@redhat.com> wrote:
> > +    if (!vdev->no_kvm_ioeventfd &&
> > +        addr > PCI_STD_HEADER_SIZEOF && last->added < MAX_DYN_IOEVENTFD + 1) {  
> nit: <= MAX_DYN_IOEVENTFD?

Done, also the addr test should be >=, it doesn't make sense to exclude
the first byte after the standard capabilities, though for this quirk
we know we're looking well above this.

> > +        if (addr != last->addr || data != last->data || size != last->size) {
> > +            last->addr = addr;
> > +            last->data = data;
> > +            last->size = size;
> > +            last->hits = 1;
> > +        } else if (++last->hits >= HITS_FOR_IOEVENTFD) {
> > +            if (last->added < MAX_DYN_IOEVENTFD) {
> > +                VFIOIOEventFD *ioeventfd;
> > +                ioeventfd = vfio_ioeventfd_init(vdev, mirror->mem, addr, size,
> > +                                        data, &vdev->bars[mirror->bar].region,
> > +                                        mirror->offset + addr, true);
> > +                if (ioeventfd) {
> > +                    VFIOQuirk *quirk;
> > +
> > +                    QLIST_FOREACH(quirk,
> > +                                  &vdev->bars[mirror->bar].quirks, next) {
> > +                        if (quirk->data == mirror) {
> > +                            QLIST_INSERT_HEAD(&quirk->ioeventfds,
> > +                                              ioeventfd, next);
> > +                            break;
> > +                        }
> > +                    }
> > +
> > +                    assert(quirk != NULL); /* Check not found */
> > +
> > +                    last->added++;
> > +                }
> > +            } else {
> > +                last->added++;
> > +
> > +                error_report("NVIDIA ioeventfd queue full for %s, unable to "
> > +                             "accelerate 0x%"HWADDR_PRIx", data 0x%"PRIx64", "
> > +                             "size %u", vdev->vbasedev.name, addr, data, size);  
> nit: warn_report?

Done

... 
> > +typedef struct VFIOIOEventFD {
> > +    QLIST_ENTRY(VFIOIOEventFD) next;
> > +    MemoryRegion *mr;
> > +    hwaddr addr;
> > +    unsigned size;
> > +    uint64_t data;
> > +    EventNotifier e;
> > +    VFIORegion *region;
> > +    hwaddr region_addr;
> > +    bool match_data;
> > +    bool dynamic;  
> maybe the "dynamic" semantics may be docuemnted in the code and not only
> in the commit message.

Done, added

/* Added runtime, removed on device reset */

Thanks!

Alex

  reply	other threads:[~2018-05-03 14:48 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-01 16:42 [PATCH v2 0/4] vfio/quirks: ioeventfd support Alex Williamson
2018-05-01 16:42 ` [Qemu-devel] " Alex Williamson
2018-05-01 16:43 ` [PATCH v2 1/4] vfio/quirks: Add common quirk alloc helper Alex Williamson
2018-05-01 16:43   ` [Qemu-devel] " Alex Williamson
2018-05-01 16:43 ` [PATCH v2 2/4] vfio/quirks: Add quirk reset callback Alex Williamson
2018-05-01 16:43   ` [Qemu-devel] " Alex Williamson
2018-05-01 16:43 ` [PATCH v2 3/4] vfio/quirks: ioeventfd quirk acceleration Alex Williamson
2018-05-01 16:43   ` [Qemu-devel] " Alex Williamson
2018-05-03  3:36   ` Peter Xu
2018-05-03  3:36     ` [Qemu-devel] " Peter Xu
2018-05-03  4:20     ` Alex Williamson
2018-05-03  4:20       ` [Qemu-devel] " Alex Williamson
2018-05-03 14:33   ` Auger Eric
2018-05-03 14:33     ` [Qemu-devel] " Auger Eric
2018-05-03 14:48     ` Alex Williamson [this message]
2018-05-03 14:48       ` Alex Williamson
2018-05-01 16:43 ` [PATCH v2 4/4] vfio/quirks: Enable ioeventfd quirks to be handled by vfio directly Alex Williamson
2018-05-01 16:43   ` [Qemu-devel] " Alex Williamson
2018-05-03  4:56   ` Peter Xu
2018-05-03  4:56     ` [Qemu-devel] " Peter Xu
2018-05-03 16:29     ` Alex Williamson
2018-05-03 16:29       ` [Qemu-devel] " Alex Williamson
2018-05-04  2:16       ` Peter Xu
2018-05-04  2:16         ` [Qemu-devel] " Peter Xu
2018-05-04  7:38       ` Auger Eric
2018-05-04  7:38         ` [Qemu-devel] " Auger Eric
2018-05-03 15:20   ` Auger Eric
2018-05-03 15:20     ` [Qemu-devel] " Auger Eric
2018-05-03 16:30     ` Alex Williamson
2018-05-03 16:30       ` [Qemu-devel] " Alex Williamson
2018-05-01 16:56 ` [PATCH v2 0/4] vfio/quirks: ioeventfd support no-reply
2018-05-01 16:56   ` [Qemu-devel] " no-reply
2018-05-01 17:05   ` Alex Williamson
2018-05-01 17:05     ` [Qemu-devel] " Alex Williamson
2018-05-01 16:56 ` no-reply
2018-05-01 16:56   ` [Qemu-devel] " no-reply

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=20180503084816.072d59a9@w520.home \
    --to=alex.williamson@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=peterx@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.