CINXE.COM

LKML: Robert Walsh: Re: [PATCH 01/13] [RFC] ipath basic headers

<?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: Robert Walsh: Re: [PATCH 01/13] [RFC] ipath basic headers</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 Robert Walsh" href="/groupie.php?aid=5237" /><!--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/2005"> [2005]</a> 聽 <a class="nb" href="/lkml/2005/12"> [Dec]</a> 聽 <a class="nb" href="/lkml/2005/12/17"> [17]</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/2005/12/17/102" onclick="this.href='/lkml/headers'+'/2005/12/17/102';">[headers]</a>聽 <a href="/lkml/bounce/2005/12/17/102">[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/2005/12/16/290">First message in thread</a></li><li><a href="/lkml/2005/12/16/293">Roland Dreier</a><ul><li><a href="/lkml/2005/12/16/289">Roland Dreier</a><ul><li><a href="/lkml/2005/12/16/291">Roland Dreier</a><ul><li><a href="/lkml/2005/12/16/303">Roland Dreier</a><ul><li><a href="/lkml/2005/12/16/301">Roland Dreier</a></li><li><a href="/lkml/2005/12/17/72">Andrew Morton</a></li></ul></li><li><a href="/lkml/2005/12/17/25">Pekka Enberg</a><ul><li><a href="/lkml/2005/12/17/92">Robert Walsh</a></li></ul></li><li><a href="/lkml/2005/12/17/31">Christoph Hellwig</a></li><li><a href="/lkml/2005/12/17/78">Andrew Morton</a><ul><li><a href="/lkml/2005/12/17/103">Robert Walsh</a></li></ul></li></ul></li></ul></li><li><a href="/lkml/2005/12/17/23">Pekka Enberg</a><ul><li><a href="/lkml/2005/12/17/97">Robert Walsh</a></li></ul></li><li><a href="/lkml/2005/12/17/29">Christoph Hellwig</a><ul><li><a href="/lkml/2005/12/17/96">(Eric W. Biederman)</a><ul><li><a href="/lkml/2005/12/17/129">Andi Kleen</a><ul><li><a href="/lkml/2005/12/18/34">(Eric W. Biederman)</a></li></ul></li></ul></li><li><a href="/lkml/2005/12/17/98">Robert Walsh</a><ul><li><a href="/lkml/2005/12/17/100">Arjan van de Ven</a><ul><li><a href="/lkml/2005/12/17/104">Robert Walsh</a></li></ul></li></ul></li></ul></li><li><a href="/lkml/2005/12/17/77">Andrew Morton</a><ul><li class="origin"><a href="/lkml/2005/12/17/126">Robert Walsh</a><ul><li><a href="/lkml/2005/12/17/126">Andrew Morton</a></li></ul></li><li><a href="/lkml/2005/12/19/207">Robert Walsh</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 01/13] [RFC] ipath basic headers</td></tr><tr><td class="lp">From</td><td class="rp" itemprop="author">Robert Walsh &lt;&gt;</td></tr><tr><td class="lp">Date</td><td class="rp" itemprop="datePublished">Sat, 17 Dec 2005 14:39:18 -0800</td></tr></table></td><td></td></tr></table><pre itemprop="articleBody">&gt; &gt; +#define yield() sched_yield()<br />&gt; <br />&gt; Some might get upset about what I assume is userspace test harness code or<br />&gt; what _is_ this doing?) in a driver. But if the maintainers find it useful<br />&gt; we can live with it,<br /><br />That is cosimulator code. It's easy enough to remove. I'll look into<br />it.<br /><br />&gt; &gt; +#ifndef _BITS_PER_BYTE<br />&gt; &gt; +#define _BITS_PER_BYTE 8<br />&gt; &gt; +#endif<br />&gt; <br />&gt; I'd be inclined to stick BITS_PER_BYTE into include/linux/types.h.<br /><br />Really? I was just going to suggest removing it, but if sticking it in<br />types.h works for you, then fine.<br /><br />&gt; &gt; +static __inline__ void ipath_shortcopy(void *dest, void *src, uint32_t cnt)<br />&gt; &gt; + __attribute__ ((always_inline));<br />&gt; <br />&gt; s/__inline__/inline/ throughout.<br /><br />OK.<br /><br />&gt; &gt; +#define round_up(v,sz) (((v) + (sz)-1) &amp; ~((sz)-1))<br />&gt; <br />&gt; We have ALIGN()<br /><br />Yup.<br /><br />&gt; &gt; +struct ipath_int_vec {<br />&gt; &gt; + int long long addr;<br />&gt; <br />&gt; long long<br /><br />OK.<br /><br />&gt; &gt; +#define IPATH_USERINIT _IOW('s', 16, struct ipath_user_info)<br />&gt; &gt; +/* init; kernel/chip params to user */<br />&gt; &gt; +#define IPATH_BASEINFO _IOR('s', 17, struct ipath_base_info)<br />&gt; &gt; +/* send a packet */<br />&gt; &gt; +#define IPATH_SENDPKT _IOW('s', 18, struct ipath_sendpkt)<br />&gt; <br />&gt; uh-oh. ioctls. Do we have compat conversions for them all, if needed?<br /><br />For those that are needed, I believe we covered them all. Some have<br />suggested removing ioctls. I'm willing to look into alternatives, but<br />if you think they're OK, I'd rather leave them.<br /><br />&gt; &gt; +/*<br />&gt; &gt; + * A segment is a linear region of low physical memory.<br />&gt; &gt; + * XXX Maybe we should use phys addr here and kmap()/kunmap()<br />&gt; &gt; + * Used by the verbs layer.<br />&gt; &gt; + */<br />&gt; &gt; +struct ipath_seg {<br />&gt; &gt; + void *vaddr;<br />&gt; &gt; + u64 length;<br />&gt; &gt; +};<br />&gt; <br />&gt; Suggest `long' for the length. We don't need 64 bits on 32-bit machines.<br /><br />OK.<br /><br />&gt; &gt; +struct ipath_mregion {<br />&gt; &gt; + u64 user_base; /* User's address for this region */<br />&gt; <br />&gt; void *.<br />&gt; <br />&gt; &gt; + u64 iova; /* IB start address of this region */<br />&gt; <br />&gt; Maybe here too.<br /><br />OK.<br /><br />&gt; &gt; +int ipath_mlock(unsigned long, size_t, struct page **);<br />&gt; <br />&gt; Sometimes it does `int foo()' and sometimes `extern int foo()'. I tend to<br />&gt; think the `extern' is a waste of space.<br /><br />Yup.<br /><br />&gt; &gt; +#define ipath_func_krecord(a)<br />&gt; &gt; +#define ipath_func_urecord(a, b)<br />&gt; &gt; +#define ipath_func_mrecord(a, b)<br />&gt; &gt; +#define ipath_func_rkrecord(a)<br />&gt; &gt; +#define ipath_func_rurecord(a, b)<br />&gt; &gt; +#define ipath_func_rmrecord(a, b)<br />&gt; &gt; +#define ipath_func_rsrecord(a)<br />&gt; &gt; +#define ipath_func_rcrecord(a)<br />&gt; <br />&gt; What are all these doing? Might need do{}while(0) for safety.<br /><br />I'll look at cleaning them out. Probably left-overs from some earlier<br />experiment.<br /><br />&gt; &gt; +#ifdef IPATH_COSIM<br />&gt; &gt; +extern __u32 sim_readl(const volatile void __iomem * addr);<br />&gt; &gt; +extern __u64 sim_readq(const volatile void __iomem * addr);<br />&gt; <br />&gt; The driver has a strange mixture of int32_t, s32 and __s32. s32 is<br />&gt; preferred.<br /><br />Yea - I'll clean that up.<br /><br />&gt; &gt; + */<br />&gt; &gt; +static __inline__ uint32_t ipath_kget_ureg32(const ipath_type stype,<br />&gt; &gt; + ipath_ureg regno, int port)<br />&gt; &gt; +{<br />&gt; &gt; + uint64_t *ubase;<br />&gt; &gt; +<br />&gt; &gt; + ubase = (uint64_t *) (devdata[stype].ipath_uregbase<br />&gt; &gt; + + (char *)devdata[stype].ipath_kregbase<br />&gt; &gt; + + devdata[stype].ipath_palign * port);<br />&gt; &gt; + return ubase ? ipath_readl(ubase + regno) : 0;<br />&gt; &gt; +}<br />&gt; <br />&gt; Are all these u64's needed on 32-bit?<br /><br />Don't know - I'll ask around. We don't support the hardware in 32-bit<br />anyway, so...<br /><br />&gt; &gt; +static __inline__ uint64_t ipath_kget_kreg64(const ipath_type stype,<br />&gt; &gt; + ipath_kreg regno)<br />&gt; &gt; +{<br />&gt; &gt; + if (!devdata[stype].ipath_kregbase)<br />&gt; &gt; + return ~0ULL;<br />&gt; <br />&gt; We don't know that the architecture implements u64 as unsigned long long. <br />&gt; Some use unsigned long. Best way of implmenting the all-ones pattern is<br />&gt; just `-1'.<br /><br />OK.<br /><br />&gt; Gee. Big driver.<br /><br />Tell me about it :-) Basically, we're doing infiniband in software: no<br />offload.<br /><br />Regards,<br /> Robert.<br /><br />-- <br />Robert Walsh Email: rjwalsh&#64;pathscale.com<br />PathScale, Inc. Phone: +1 650 934 8117<br />2071 Stierlin Court, Suite 200 Fax: +1 650 428 1969<br />Mountain View, CA 94043.<br /><br /><br />-<br />To unsubscribe from this list: send the line "unsubscribe linux-kernel" in<br />the body of a message to majordomo&#64;vger.kernel.org<br />More majordomo info at <a href="http://vger.kernel.org/majordomo-info.html">http://vger.kernel.org/majordomo-info.html</a><br />Please read the FAQ at <a href="http://www.tux.org/lkml/">http://www.tux.org/lkml/</a><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: 2005-12-17 23:42 聽聽 [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>

Pages: 1 2 3 4 5 6 7 8 9 10