netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: sri@us.ibm.com
Cc: shemminger@osdl.org, rdreier@cisco.com, netdev@vger.kernel.org
Subject: Re: Excess use of packed attribute
Date: Mon, 07 Aug 2006 17:39:20 -0700 (PDT)	[thread overview]
Message-ID: <20060807.173920.102575221.davem@davemloft.net> (raw)
In-Reply-To: <1154995328.11916.24.camel@w-sridhar2.beaverton.ibm.com>

From: Sridhar Samudrala <sri@us.ibm.com>
Date: Mon, 07 Aug 2006 17:02:08 -0700

> All the structures in sctp.h that use packed atrribute define
> standard on-wire SCTP chunk/parameter formats. They need to be at the
> exact offsets as they go on wire.
> I think we saw some issues without the packed attribute on 64-bit archs
> and just to be safe we added packed to all the on-wire structures.

For the cases where it is no actually necessary, the code generation
cost on RISC cpus is very high.  Byte loads and stores will be used to
access _every_ member of such structures on RISC machines because
the compiler cannot guarentee the alignment of any data object
when packed is specified.

It's OK to do this when it's really needed, but when it's not it
should be heavily avoided.

  reply	other threads:[~2006-08-08  0:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-07 20:34 Excess use of packed attribute Stephen Hemminger
2006-08-07 23:20 ` David Miller
2006-08-09 19:17   ` Ville Nuorvala
2006-08-08  0:02 ` Sridhar Samudrala
2006-08-08  0:39   ` David Miller [this message]
2006-08-09 18:37     ` Roland Dreier
2006-08-10  4:11       ` David Miller

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=20060807.173920.102575221.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=rdreier@cisco.com \
    --cc=shemminger@osdl.org \
    --cc=sri@us.ibm.com \
    /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 NNTP newsgroup(s).