DragonFly- master sys/dev/netif/emx if_emx.h

Sepherosa Ziehau sepherosa at gmail.com
Tue Apr 28 20:35:53 PDT 2009

On Wed, Apr 29, 2009 at 9:42 AM, Matthew Dillon
<dillon at apollo.backplane.com> wrote:
> :Yeah.  However, could you tell me the major reason you want to put
> :__cachealign in struct field?  I guess you worried about emx_rxdata
> :being used outside of emx_softc?
> :
> :Best Regards,
> :sephe
>    It's more obvious that the array needs to be cache-aligned if it is
>    in the softc structure.  Also, it's more C-like.  Putting storage
>    attributes on structural definitions is not very C-like.  The storage
>    attributes should be on declarations instead.

Mmm, setting __cachealign on struct field (i.e. in emx_softc) does not
achieve what I want here: I want the struct's size to be (N *
cacheline_size) in addition to be cacheline_size aligned.  So in
ifpoll, CPU0's writing to rx_data[0] will not pollute rx_data[1]'s
cache in CPU1.

Best Regards,

Live Free or Die

More information about the Commits mailing list