From: David Miller <davem@davemloft.net>
To: loke.chetan@gmail.com
Cc: netdev@vger.kernel.org, eric.dumazet@gmail.com, joe@perches.com,
bhutchings@solarflare.com, shemminger@vyatta.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 net-next af-packet 1/2] Enhance af-packet to provide (near zero)lossless packet capture functionality.
Date: Thu, 07 Jul 2011 00:13:01 -0700 (PDT) [thread overview]
Message-ID: <20110707.001301.1054777374178479078.davem@davemloft.net> (raw)
In-Reply-To: <CAAsGZS67G8H5NLBxQTY88+T1cRQ3aiwBXK5qa8SJ_TbQ7xqvhw@mail.gmail.com>
From: chetan loke <loke.chetan@gmail.com>
Date: Wed, 6 Jul 2011 17:45:20 -0400
> new format:
>
> union bd_header_u {
> /* renamed struct bd_v1 to hdr_v1 */
> struct hdr_v1 h1;
> } __attribute__ ((__packed__));
>
> struct block_desc {
> __u16 version;
> __u16 offset_to_priv;
> union bd_header_u hdr;
> } __attribute__ ((__packed__));
>
> Is this ok with you?
Get rid of __packed__, it's going to kill performance on RISC
platforms. If you use __packed__, regardless of the actual alignment,
the compiler must assume that each part of the struct "might" be
unaligned. So on architectures such as sparc where alignment matters,
a word is going to be accessed by a sequence of byte loads/stores.
Do not use packed unless absolutely enforced by a protocol or hardware
data structure, it's evil.
next prev parent reply other threads:[~2011-07-07 7:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-22 2:10 [PATCH v2 net-next af-packet 0/2] " Chetan Loke
2011-06-22 2:10 ` [PATCH v2 net-next af-packet 1/2] " Chetan Loke
2011-07-01 22:36 ` David Miller
2011-07-05 14:53 ` chetan loke
2011-07-05 15:01 ` David Miller
2011-07-06 21:45 ` chetan loke
2011-07-07 7:13 ` David Miller [this message]
2011-07-07 13:04 ` chetan loke
2011-07-07 13:11 ` David Miller
2011-06-22 2:10 ` [PATCH v2 net-next af-packet 2/2] " Chetan Loke
2011-06-22 3:02 ` [PATCH v2 net-next af-packet 0/2] " chetan loke
2011-06-22 8:35 ` 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=20110707.001301.1054777374178479078.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=bhutchings@solarflare.com \
--cc=eric.dumazet@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=loke.chetan@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.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
all inboxes | Powered by JetHome®