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

Simon 'corecode' Schubert corecode at fs.ei.tum.de
Wed Apr 29 04:42:08 PDT 2009

Sepherosa Ziehau wrote:
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?
   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.
Right.  Every array element needs to be cache aligned, not only the array by itself.


More information about the Commits mailing list