The Alignment and Init of Ethernet Data Structures

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

The Alignment and Init of Ethernet Data Structures

Les G. Miklosy-2

This question regards the Ethernet drivers found in the devs/eth
directory. I found the data structure for xxx_eth_info in these header
files: fec.h, fcc.h, quicc_eth.h, ppc405_eth.h. Moab uses the
ppc405_eth.h while Rattler uses the fcc.h. When the data structure
xxx_eth_info is initialized, the Moab and Rattler configurations use
data alignment constructs (the literature calls 'compound literals')  
while fec and quicc_eth do not. An example of the data alignment
construct for Moab is:

    // Align buffers on a cache boundary
    #define RxBUFSIZE
    #define TxBUFSIZE
    static unsigned char ppc405_eth_rxbufs[RxBUFSIZE]
    static unsigned char ppc405_eth_txbufs[TxBUFSIZE]
    static mal_bd_t
    static mal_bd_t

Why are these used in the cases of fcc and ppc405 but not for fec and
quicc? Is the alignment necessary or recommended for new ports? What
might be the consequences if alignment during initialization is not
used? For other platforms are we relying on the compiler to
rack-and-stack data structures properly on boundaries optimized by the

Thanks for any guidance.

Before posting, please read the FAQ:
and search the list archive: