<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body smarttemplateinserted="true" text="#000000" bgcolor="#FFFFFF">
    <div id="smartTemplate4-template">
      <p>Problem solved: To enable MSI -> eventfd signalling we had
        to set the bus master enable bit in PCI config space (bit 2 at
        offset 4).<br>
        Thanks!<br>
      </p>
    </div>
    <div id="smartTemplate4-quoteHeader"><br>
      <hr style="color:#62B3FF"><br>
      <div style="background-color: #DDDDDD; font-size:10pt"><b>From:</b>
        <a title="alex.williamson@redhat.com"
          href="mailto:alex.williamson@redhat.com">Alex Williamson</a><br>
        <b>Sent:</b> Thursday, February 22, 2018 10:03PM<br>
        <b>To:</b> <a title="Oliver.Heid@h-next.de"
          href="mailto:Oliver.Heid@h-next.de">Heid, Oliver</a><br>
        <b>Subject:</b> Re: [vfio-users] VFIO for PCIe streaming from/to
        user space</div>
      <br>
      <br>
    </div>
    <span type="cite" cite="mid:20180222140348.5bf2df7a@w520.home"
      style="display: block; word-break: break-all; margin: 8px 0 0 0;
      padding: 0; line-height:0"></span>
    <pre wrap="">On Thu, 22 Feb 2018 21:44:44 +0100
Oliver Heid <a class="moz-txt-link-rfc2396E" href="mailto:Oliver.Heid@h-next.de"><Oliver.Heid@h-next.de></a> wrote:

</pre>
    <blockquote type="cite">
      <pre wrap="">After registering e.g. MSI 0 with

__s32 msifd = eventfd(0, 0);

     struct vfio_irq_set *irq_set;

     irq_set=(struct vfio_irq_set *)malloc(sizeof(struct vfio_irq_set) + 
sizeof(__s32));

     irq_set->argsz = sizeof(struct vfio_irq_set) + sizeof(__s32);
     irq_set->index = VFIO_PCI_MSI_IRQ_INDEX;
     irq_set->flags = VFIO_IRQ_SET_DATA_EVENTFD | 
VFIO_IRQ_SET_ACTION_TRIGGER;
     irq_set->start = 0;
     irq_set->count = 1;
     *(__s32*)&irq_set->data = msifd;
     ioctl(device, VFIO_DEVICE_SET_IRQS, irq_set);

any read by

     __u64 value = 0;
     int ret = read(msifd,&value,sizeof(value));

should acknowledge the MSI, right? Or did I miss something?
</pre>
    </blockquote>
    <pre wrap="">
What do you mean by "acknowledge"?  This effectively acknowledges the
eventfd, but it's up to your driver to service the hardware upon
receiving the eventfd notification.  The eventfd is only the signaling
mechanism.  Thanks,

Alex
</pre>
    <br>
  </body>
</html>