openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Andrew Jeffery" <andrew@aj.id.au>
To: "sainath grandhi" <saiallforums@gmail.com>, openbmc@lists.ozlabs.org
Subject: Re: Using VFIO vs. developing a kernel module
Date: Fri, 28 May 2021 08:46:06 +0930	[thread overview]
Message-ID: <95b58f69-d706-4388-8056-7d8b058ace06@www.fastmail.com> (raw)
In-Reply-To: <CABqzqi4kV_zd1Wkm8vn_qdf5VGrnedvec3FtfE3GModQH5TuaA@mail.gmail.com>



On Thu, 27 May 2021, at 22:53, sainath grandhi wrote:
> Hello,
> Our project has an FPGA connected to BMC as a PCIe endpoint. This
> endpoint provides a set of registers via MMIO and an interrupt for
> notifying completion of work. This endpoint also implements AER
> capability.
> 
> We have two options to enable this endpoint.
> 1) Write a new kernel module with a character device interface for
> user-space interaction.
> 2) Use VFIO infrastructure provided by Linux and write an user-space
> application.
> 
> I am reaching out to the community to check if there is any
> recommended option, using VFIO vs. implementing a new kernel module,
> or any previous experiences weighing in one option over the other.

I don't have any experience with VFIO, so take this with a grain of salt.

Generally you should write an in-kernel driver for it. The reason you 
might not want to do so is if the device's register interface changes 
frequently, as it's more pain to update the kernel than some userspace 
application, which slows iteration. But handling DMAs and interrupts 
make userspace more painful, so unless VFIO helps there (I assume it 
does), then that would push the implementation back towards the kernel.

Andrew

  reply	other threads:[~2021-05-27 23:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27 13:23 Using VFIO vs. developing a kernel module sainath grandhi
2021-05-27 23:16 ` Andrew Jeffery [this message]
2021-05-28 23:12   ` Dhananjay Phadke
2021-05-29 15:16     ` sainath grandhi

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=95b58f69-d706-4388-8056-7d8b058ace06@www.fastmail.com \
    --to=andrew@aj.id.au \
    --cc=openbmc@lists.ozlabs.org \
    --cc=saiallforums@gmail.com \
    /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).