From: Les Miklosy <lgm0@verizon.net>
To: ecos-discuss@ecos.sourceware.org
Subject: [ECOS] The Alignment and Init of Ethernet Data Structures
Date: Fri, 04 Jul 2014 01:35:00 -0000 [thread overview]
Message-ID: <53B603D8.90807@verizon.net> (raw)
In-Reply-To: <539659A0.7070100@verizon.net>
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
CYGNUM_DEVS_ETH_POWERPC_PPC405_RxNUM*CYGNUM_DEVS_ETH_POWERPC_PPC405_BUFSIZE
#define TxBUFSIZE
CYGNUM_DEVS_ETH_POWERPC_PPC405_TxNUM*CYGNUM_DEVS_ETH_POWERPC_PPC405_BUFSIZE
static unsigned char ppc405_eth_rxbufs[RxBUFSIZE]
__attribute__((aligned(HAL_DCACHE_LINE_SIZE)));
static unsigned char ppc405_eth_txbufs[TxBUFSIZE]
__attribute__((aligned(HAL_DCACHE_LINE_SIZE)));
static mal_bd_t
ppc405_eth_rxbd[CYGNUM_DEVS_ETH_POWERPC_PPC405_RxNUM]
__attribute__((aligned(HAL_DCACHE_LINE_SIZE)));
static mal_bd_t
ppc405_eth_txbd[CYGNUM_DEVS_ETH_POWERPC_PPC405_TxNUM]
__attribute__((aligned(HAL_DCACHE_LINE_SIZE)));
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
compiler?
Thanks for any guidance.
Les
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
parent reply other threads:[~2014-07-04 1:35 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <539659A0.7070100@verizon.net>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53B603D8.90807@verizon.net \
--to=lgm0@verizon.net \
--cc=ecos-discuss@ecos.sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).