CINXE.COM
LKML: Sudeep Dutt: Re: [PATCH char-misc-next 3/8] misc: mic: MIC VOP Bus
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>LKML: Sudeep Dutt: Re: [PATCH char-misc-next 3/8] misc: mic: MIC VOP Bus</title><link href="/css/message.css" rel="stylesheet" type="text/css" /><link href="/css/wrap.css" rel="alternate stylesheet" type="text/css" title="wrap" /><link href="/css/nowrap.css" rel="stylesheet" type="text/css" title="nowrap" /><link href="/favicon.ico" rel="shortcut icon" /><script src="/js/simple-calendar.js" type="text/javascript"></script><script src="/js/styleswitcher.js" type="text/javascript"></script><link rel="alternate" type="application/rss+xml" title="lkml.org : last 100 messages" href="/rss.php" /><link rel="alternate" type="application/rss+xml" title="lkml.org : last messages by Sudeep Dutt" href="/groupie.php?aid=49399" /><!--Matomo--><script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(["setDoNotTrack", true]); _paq.push(["disableCookies"]); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//m.lkml.org/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', '1']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); })(); </script><!--End Matomo Code--></head><body onload="es.jasper.simpleCalendar.init();" itemscope="itemscope" itemtype="http://schema.org/BlogPosting"><table border="0" cellpadding="0" cellspacing="0"><tr><td width="180" align="center"><a href="/"><img style="border:0;width:135px;height:32px" src="/images/toprowlk.gif" alt="lkml.org" /></a></td><td width="32">聽</td><td class="nb"><div><a class="nb" href="/lkml"> [lkml]</a> 聽 <a class="nb" href="/lkml/2016"> [2016]</a> 聽 <a class="nb" href="/lkml/2016/2"> [Feb]</a> 聽 <a class="nb" href="/lkml/2016/2/8"> [8]</a> 聽 <a class="nb" href="/lkml/last100"> [last100]</a> 聽 <a href="/rss.php"><img src="/images/rss-or.gif" border="0" alt="RSS Feed" /></a></div><div>Views: <a href="#" class="nowrap" onclick="setActiveStyleSheet('wrap');return false;">[wrap]</a><a href="#" class="wrap" onclick="setActiveStyleSheet('nowrap');return false;">[no wrap]</a> 聽 <a class="nb" href="/lkml/mheaders/2016/2/8/639" onclick="this.href='/lkml/headers'+'/2016/2/8/639';">[headers]</a>聽 <a href="/lkml/bounce/2016/2/8/639">[forward]</a>聽 </div></td><td width="32">聽</td></tr><tr><td valign="top"><div class="es-jasper-simpleCalendar" baseurl="/lkml/"></div><div class="threadlist">Messages in this thread</div><ul class="threadlist"><li class="root"><a href="/lkml/2016/2/1/1015">First message in thread</a></li><li><a href="/lkml/2016/2/1/1021">Sudeep Dutt</a><ul><li><a href="/lkml/2016/2/8/39">Greg Kroah-Hartman</a><ul><li class="origin"><a href="">Sudeep Dutt</a></li></ul></li></ul></li></ul></td><td width="32" rowspan="2" class="c" valign="top"><img src="/images/icornerl.gif" width="32" height="32" alt="/" /></td><td class="c" rowspan="2" valign="top" style="padding-top: 1em"><table><tr><td><table><tr><td class="lp">Subject</td><td class="rp" itemprop="name">Re: [PATCH char-misc-next 3/8] misc: mic: MIC VOP Bus</td></tr><tr><td class="lp">From</td><td class="rp" itemprop="author">Sudeep Dutt <></td></tr><tr><td class="lp">Date</td><td class="rp" itemprop="datePublished">Mon, 08 Feb 2016 09:26:35 -0800</td></tr></table></td><td></td></tr></table><pre itemprop="articleBody">On Sun, 2016-02-07 at 22:57 -0800, Greg Kroah-Hartman wrote:<br />> On Mon, Feb 01, 2016 at 08:23:40PM -0800, Sudeep Dutt wrote:<br />> > The Virtio Over PCIe (VOP) bus abstracts the low level hardware<br />> > details like interrupts and mapping remote memory so that the same VOP<br />> > driver can work without changes with different MIC host or card<br />> > drivers as long as the hardware bus operations are implemented. The<br />> > VOP driver registers itself on the VOP bus. The base PCIe drivers<br />> > implement the bus ops and register VOP devices on the bus, resulting<br />> > in the VOP driver being probed with the VOP devices. This allows the<br />> > VOP functionality to be shared between multiple generations of Intel<br />> > MIC products.<br />> > <br />> > Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com><br />> > Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com><br />> > ---<br />> > drivers/misc/mic/Kconfig | 17 ++++<br />> > drivers/misc/mic/bus/Makefile | 1 +<br />> > drivers/misc/mic/bus/vop_bus.h | 142 ++++++++++++++++++++++++++++<br />> > drivers/misc/mic/bus/vop_bus.c | 204 +++++++++++++++++++++++++++++++++++++++++<br />> > 4 files changed, 364 insertions(+)<br />> > create mode 100644 drivers/misc/mic/bus/vop_bus.h<br />> > create mode 100644 drivers/misc/mic/bus/vop_bus.c<br />> > <br />> > diff --git a/drivers/misc/mic/Kconfig b/drivers/misc/mic/Kconfig<br />> > index 40677df..840f7ef 100644<br />> > --- a/drivers/misc/mic/Kconfig<br />> > +++ b/drivers/misc/mic/Kconfig<br />> > @@ -32,6 +32,23 @@ config SCIF_BUS<br />> > OS and tools for MIC to use with this driver are available from<br />> > <<a href="http://software.intel.com/en-us/mic-developer>.">http://software.intel.com/en-us/mic-developer>.</a><br />> > <br />> > +comment "VOP Bus Driver"<br />> > +<br />> > +config VOP_BUS<br />> > + tristate "VOP Bus Driver"<br />> > + depends on 64BIT && PCI && X86 && X86_DEV_DMA_OPS<br />> > + help<br />> > + This option is selected by any driver which registers a<br />> > + device or driver on the VOP Bus, such as CONFIG_INTEL_MIC_HOST<br />> > + and CONFIG_INTEL_MIC_CARD.<br />> > +<br />> > + If you are building a host/card kernel with an Intel MIC device<br />> > + then say M (recommended) or Y, else say N. If unsure say N.<br />> > +<br />> > + More information about the Intel MIC family as well as the Linux<br />> > + OS and tools for MIC to use with this driver are available from<br />> > + <<a href="http://software.intel.com/en-us/mic-developer>.">http://software.intel.com/en-us/mic-developer>.</a><br />> > +<br />> > comment "Intel MIC Host Driver"<br />> > <br />> > config INTEL_MIC_HOST<br />> > diff --git a/drivers/misc/mic/bus/Makefile b/drivers/misc/mic/bus/Makefile<br />> > index 761842b..8758a7d 100644<br />> > --- a/drivers/misc/mic/bus/Makefile<br />> > +++ b/drivers/misc/mic/bus/Makefile<br />> > @@ -5,3 +5,4 @@<br />> > obj-$(CONFIG_INTEL_MIC_BUS) += mic_bus.o<br />> > obj-$(CONFIG_SCIF_BUS) += scif_bus.o<br />> > obj-$(CONFIG_MIC_COSM) += cosm_bus.o<br />> > +obj-$(CONFIG_VOP_BUS) += vop_bus.o<br />> > diff --git a/drivers/misc/mic/bus/vop_bus.h b/drivers/misc/mic/bus/vop_bus.h<br />> > new file mode 100644<br />> > index 0000000..97fa5d6<br />> > --- /dev/null<br />> > +++ b/drivers/misc/mic/bus/vop_bus.h<br />> > @@ -0,0 +1,142 @@<br />> > +/*<br />> > + * Intel MIC Platform Software Stack (MPSS)<br />> > + *<br />> > + * Copyright(c) 2016 Intel Corporation.<br />> > + *<br />> > + * This program is free software; you can redistribute it and/or modify<br />> > + * it under the terms of the GNU General Public License, version 2, as<br />> > + * published by the Free Software Foundation.<br />> > + *<br />> > + * This program is distributed in the hope that it will be useful, but<br />> > + * WITHOUT ANY WARRANTY; without even the implied warranty of<br />> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU<br />> > + * General Public License for more details.<br />> > + *<br />> > + * The full GNU General Public License is included in this distribution in<br />> > + * the file called "COPYING".<br />> > + *<br />> > + * Intel Virtio over PCIe Bus driver.<br />> > + */<br />> > +#ifndef _VOP_BUS_H_<br />> > +#define _VOP_BUS_H_<br />> > +/*<br />> > + * Everything a vop driver needs to work with any particular vop<br />> > + * implementation.<br />> > + */<br />> > +#include <linux/dmaengine.h><br />> > +#include <linux/interrupt.h><br />> > +<br />> > +#include "../common/mic_dev.h"<br />> > +<br />> > +struct vop_device_id {<br />> > + u32 device;<br />> > + u32 vendor;<br />> > +};<br />> > +<br />> > +#define VOP_DEV_TRNSP 1<br />> > +#define VOP_DEV_ANY_ID 0xffffffff<br />> > +/*<br />> > + * Size of the internal buffer used during DMA's as an intermediate buffer<br />> > + * for copy to/from user. Must be an integral number of pages.<br />> > + */<br />> > +#define VOP_INT_DMA_BUF_SIZE PAGE_ALIGN(64 * 1024ULL)<br />> > +<br />> > +/**<br />> > + * vop_device - representation of a device using vop<br />> > + * @priv: private pointer for the driver's use.<br />> > + * @hw_ops: the hardware ops supported by this device.<br />> > + * @id: the device type identification (used to match it with a driver).<br />> > + * @dev: underlying device.<br />> > + * @dnode - The destination node which this device will communicate with.<br />> > + * @aper: Aperture memory window<br />> > + * @dma_ch - DMA channel<br />> > + * @index: unique position on the vop bus<br />> > + */<br />> > +struct vop_device {<br />> > + void *priv;<br />> <br />> You don't need this pointer, use the one in struct device instead.<br />> <br />> Other than that, looks good, nice job with this bus.<br />> <br /><br />Hi Greg,<br /><br />I will clean this up, refresh this patch series against the latest<br />char-misc-next tree and resend today. <br /><br />Thanks for reviewing!<br /><br />Sudeep Dutt<br /><br /></pre></td><td width="32" rowspan="2" class="c" valign="top"><img src="/images/icornerr.gif" width="32" height="32" alt="\" /></td></tr><tr><td align="right" valign="bottom"> 聽 </td></tr><tr><td align="right" valign="bottom">聽</td><td class="c" valign="bottom" style="padding-bottom: 0px"><img src="/images/bcornerl.gif" width="32" height="32" alt="\" /></td><td class="c">聽</td><td class="c" valign="bottom" style="padding-bottom: 0px"><img src="/images/bcornerr.gif" width="32" height="32" alt="/" /></td></tr><tr><td align="right" valign="top" colspan="2"> 聽 </td><td class="lm">Last update: 2016-02-08 18:41 聽聽 [from the cache]<br />漏2003-2020 <a href="http://blog.jasper.es/"><span itemprop="editor">Jasper Spaans</span></a>|hosted at <a href="https://www.digitalocean.com/?refcode=9a8e99d24cf9">Digital Ocean</a> and my Meterkast|<a href="http://blog.jasper.es/categories.html#lkml-ref">Read the blog</a></td><td>聽</td></tr></table><script language="javascript" src="/js/styleswitcher.js" type="text/javascript"></script></body></html>