[ofa-general] Re: [RFC/PATCH] mthca: ensure alignment of doorbell writes

akepner at sgi.com akepner at sgi.com
Mon Jul 30 13:43:45 PDT 2007


On Mon, Jul 30, 2007 at 01:30:40PM -0700, Roland Dreier wrote:
>  > +union mthca_doorbell {
>  > +	__be64 val64;
>  > +	__be32 val32[2];
>  > +} __attribute__ ((aligned (sizeof(__be64))));
> 
> would we get the same effect from just adding the __attribute__((aligned
> to the declarations of the doorbell arrays?

Yes. 

(And of course using "((aligned (sizeof(__be64))))" with a union 
containing a __be64 member is silly anyway....)

> 
> I wonder how it would affect the generated code on various platforms
> if we just made the doorbell values be computed as __be64 and then
> passed that in to the write64 function...
> 

That'd work fine for ia64 :-) 

For other platforms I can't answer...

-- 
Arthur




More information about the general mailing list