From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Wise Subject: Re: [PATCH 09/11 v2] RDMA/cxgb4: Support on-chip SQs. Date: Tue, 28 Sep 2010 13:05:56 -0500 Message-ID: <4CA22E84.404@opengridcomputing.com> References: <20100913162357.20948.28267.stgit@build.ogc.int> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Roland Dreier Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-rdma@vger.kernel.org On 09/28/2010 12:57 PM, Roland Dreier wrote: > As I said, I applied this, but I wonder: > > > +static inline pgprot_t t4_pgprot_wc(pgprot_t prot) > > +{ > > +#if defined(__i386__) || defined(__x86_64__) > > + return pgprot_writecombine(prot); > > +#elif defined(CONFIG_PPC64) > > + return __pgprot((pgprot_val(prot) | _PAGE_NO_CACHE)& > > + ~(pgprot_t)_PAGE_GUARDED); > > +#else > > + return pgprot_noncached(prot); > > +#endif > > +} > > + > > +static inline int t4_ocqp_supported(void) > > +{ > > +#if defined(__i386__) || defined(__x86_64__) || defined(CONFIG_PPC64) > > + return 1; > > +#else > > + return 0; > > +#endif > > +} > > Is there any way to avoid this ifdef-ery? It seems at least the powerpc > case should be wrapped up in an arch/powerpc version of pgprot_writecombine. > Also doing this by hand as here leaves out for example ia64, which seems > to have a definition of pgrprot_writecombine. > > We would remove it I guess. I see that mlx4 assumes pgprot_writecombine() exists and works correctly across all platforms. See mlx4_ib_mmap(). > However I don't know what (if anything) we should do for the > ocqp_supported test ... > If all platforms support pgprot_writecombine() correctly, then we don't need ocqp_supported(). Steve. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html