mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Sudeep Dutt <sudeep.dutt@intel.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Arnd Bergmann <arnd@arndb.de>, Rob Landley <rob@landley.net>,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-doc@vger.kernel.org, Nikhil Rao <nikhil.rao@intel.com>,
	Ashutosh Dixit <ashutosh.dixit@intel.com>,
	Caz Yokoyama <Caz.Yokoyama@intel.com>,
	Dasaratharaman Chandramouli 
	<dasaratharaman.chandramouli@intel.com>,
	Harshavardhan R Kharche <harshavardhan.r.kharche@intel.com>,
	"Yaozu \(Eddie\) Dong" <eddie.dong@intel.com>,
	Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>,
	Sudeep Dutt <sudeep.dutt@intel.com>
Subject: Re: [PATCH 3/5] Intel MIC Host Driver Changes for Virtio Devices.
Date: Tue, 06 Aug 2013 13:17:46 +0930	[thread overview]
Message-ID: <87li4fqy3h.fsf@rustcorp.com.au> (raw)
In-Reply-To: <1375404051.61060.75.camel@blbiskey-desk1.amr.corp.intel.com>

Sudeep Dutt <sudeep.dutt@intel.com> writes:
> On Mon, 2013-07-29 at 10:05 +0300, Michael S. Tsirkin wrote: 
>> On Wed, Jul 24, 2013 at 08:31:34PM -0700, Sudeep Dutt wrote:
>> > From: Ashutosh Dixit <ashutosh.dixit@intel.com>
>> > 
>> > This patch introduces the host "Virtio over PCIe" interface for
>> > Intel MIC. It allows creating user space backends on the host and
>> > instantiating virtio devices for them on the Intel MIC card. A character
>> > device per MIC is exposed with IOCTL, mmap and poll callbacks. This allows
>> > the user space backend to:
>> > (a) add/remove a virtio device via a device page.
>> > (b) map (R/O) virtio rings and device page to user space.
>> > (c) poll for availability of data.
>> > (d) copy a descriptor or entire descriptor chain to/from the card.
>> > (e) modify virtio configuration.
>> > (f) handle virtio device reset.
>> > The buffers are copied over using CPU copies for this initial patch
>> > and host initiated MIC DMA support is planned for future patches.
>> > The avail and desc virtio rings are in host memory and the used ring
>> > is in card memory to maximize writes across PCIe for performance.
>> > 
>> > Co-author: Sudeep Dutt <sudeep.dutt@intel.com>
>> > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
>> > Signed-off-by: Caz Yokoyama <Caz.Yokoyama@intel.com>
>> > Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com>
>> > Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
>> > Signed-off-by: Harshavardhan R Kharche <harshavardhan.r.kharche@intel.com>
>> > Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com>
>> > Acked-by: Yaozu (Eddie) Dong <eddie.dong@intel.com>
>> > Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
>> 
>> I decided to look at the security and ordering of ring accesses.
>> Doing a quick look, I think I found some issues, see comments below.
>> If it were possible to reuse existing ring handling code,
>> such issues would go away automatically.
>> Which brings me to the next question: have you looked at reusing
>> some code under drivers/vhost for host side processing?
>> If not, you probably should.
>> Is code in vringh.c generic enough to support your use-case,
>> and if not what exactly are the issues preventing this?
>> 
>> Thanks,
>> 
> We had implemented our custom MIC vring host access logic before the
> VRINGH infrastructure was merged to mainline in v3.10. Based on your
> feedback, we have a proof of concept implemented this week, by reusing
> the VRINGH infrastructure and it works nicely for us!

Nice!  Good suggestion MST, thanks for the plug :)

> One of our goals is to issue the  buffer transfers using DMA with future
> patches. The CPU copy in our current patches is also slightly different
> compared to VRINGH since we are copying from card buffers to user space
> and vice versa. In order to do meet these goals, we are obtaining the
> next available descriptor via vringh_getdesc_kern(..), then triggering
> the copy (CPU or eventually DMA) via a custom MIC API and then
> publishing the descriptor via vringh_complete_kern(..). Are there any
> plans of enhancing VRINGH to allow overriding the xfer mechanism in
> vringh_iov_xfer(..)? This will allow drivers with custom xfer routines
> to reuse APIs like vringh_iov_push_kern(..) and vringh_iov_pull_kern(..)
> as well. That said, the existing VRINGH infrastructure is generic enough
> for our use case as is today.

We'll have to look at exposing the internals.  vringh_iov_xfer() works
well because it's internal and inlined.  It'll be much easier to
evaluate when we're dealing with specific patches.

Cheers,
Rusty.

  reply	other threads:[~2013-08-06  3:55 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-25  3:31 [PATCH 0/5] Enable Drivers for Intel MIC X100 Coprocessors Sudeep Dutt
2013-07-25  3:31 ` [PATCH 1/5] Intel MIC Host Driver for X100 family Sudeep Dutt
2013-08-01  1:44   ` Greg Kroah-Hartman
2013-08-01  1:45   ` Greg Kroah-Hartman
2013-08-02  0:38     ` Sudeep Dutt
2013-08-01  1:51   ` Greg Kroah-Hartman
2013-08-02  0:36     ` Sudeep Dutt
2013-08-02  0:46       ` Greg Kroah-Hartman
2013-07-25  3:31 ` [PATCH 2/5] Intel MIC Card " Sudeep Dutt
2013-07-25  3:31 ` [PATCH 3/5] Intel MIC Host Driver Changes for Virtio Devices Sudeep Dutt
2013-07-29  7:05   ` Michael S. Tsirkin
2013-08-02  0:40     ` Sudeep Dutt
2013-08-06  3:47       ` Rusty Russell [this message]
2013-07-25  3:31 ` [PATCH 4/5] Intel MIC Card " Sudeep Dutt
2013-07-25  4:41   ` Greg Kroah-Hartman
2013-07-25 18:00     ` Sudeep Dutt
2013-07-29  1:58   ` Rusty Russell
2013-07-25  3:31 ` [PATCH 5/5] Sample Implementation of Intel MIC User Space Daemon Sudeep Dutt
2013-08-01  1:46 ` [PATCH 0/5] Enable Drivers for Intel MIC X100 Coprocessors Greg Kroah-Hartman
2013-08-01  7:45   ` Asias He
2013-08-02  0:37     ` Sudeep Dutt
2013-08-02  0:34   ` Sudeep Dutt
2013-08-13 12:43 ` Pavel Machek
2013-08-14 20:24   ` Sudeep Dutt
2013-08-15 10:14     ` Pavel Machek
2013-08-16 16:59       ` Sudeep Dutt
2013-08-16 17:08         ` Waskiewicz Jr, Peter P

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=87li4fqy3h.fsf@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=Caz.Yokoyama@intel.com \
    --cc=arnd@arndb.de \
    --cc=ashutosh.dixit@intel.com \
    --cc=dasaratharaman.chandramouli@intel.com \
    --cc=eddie.dong@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=harshavardhan.r.kharche@intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=nikhil.rao@intel.com \
    --cc=peter.p.waskiewicz.jr@intel.com \
    --cc=rob@landley.net \
    --cc=sudeep.dutt@intel.com \
    --cc=virtualization@lists.linux-foundation.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

Powered by JetHome