From: David Miller <davem@davemloft.net>
To: jesse@nicira.com
Cc: netdev@vger.kernel.org, dev@openvswitch.org, azhou@nicira.com,
fengguan.wu@intel.com, geert@linux-m68k.org
Subject: Re: [PATCH] openvswitch: Fix alignment of struct sw_flow_key.
Date: Thu, 05 Sep 2013 14:17:51 -0400 (EDT) [thread overview]
Message-ID: <20130905.141751.945639989861997124.davem@davemloft.net> (raw)
In-Reply-To: <1378402887-17331-1-git-send-email-jesse@nicira.com>
From: Jesse Gross <jesse@nicira.com>
Date: Thu, 5 Sep 2013 10:41:27 -0700
> -} __aligned(__alignof__(long));
> +} __aligned(8); /* 8 byte alignment ensures this can be accessed as a long */
This kind of stuff drives me crazy.
If the issue is the type, therefore at least use an expression that
mentions the type explicitly. And mention the actual type that
matters. "long" isn't it.
These half-hearted attempts to fix this problem are just papering
around the issue and do not address the real issue directly.
I don't want to apply changes like this.
You don't want "8 byte alignment", you want the alignment necessary
for the types contained in the structure to be accessed without
generating exceptions. You might also want the "quickest" alignment,
and there are ways to express that as well.
This structure doesn't even contain a "long". "long" isn't even
64-bit on some architectures, and you certainly have 64-bit types in
this thing (__be64).
Let's start from the beginning, what are you actually trying to
accomplish here that isn't handled automatically by the compiler
already?
Is it "proper" alignment? That is handled automatically by the
compiler. Is it "fast" alignment? In what context and in what ways
is that important in this specific case?
next prev parent reply other threads:[~2013-09-05 18:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-05 17:41 [PATCH] openvswitch: Fix alignment of struct sw_flow_key Jesse Gross
2013-09-05 18:17 ` David Miller [this message]
2013-09-05 18:36 ` Jesse Gross
[not found] ` <CAEP_g=8gcCtkv=no=HkVmS+NDWPM-Uu-SVyR+vb-YQ=7TWJsXA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-05 18:40 ` David Miller
[not found] ` <20130905.144044.1053960608071929025.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2013-09-05 19:14 ` Jesse Gross
2013-09-05 19:20 ` Geert Uytterhoeven
2013-09-05 19:25 ` Jesse Gross
2013-09-05 19:49 ` David Miller
2013-09-05 19:47 ` Joe Perches
2013-09-06 10:18 ` David Laight
-- strict thread matches above, loose matches on Subject: below --
2013-09-05 19:17 Jesse Gross
2013-09-05 19:25 ` Geert Uytterhoeven
2013-09-05 19:54 ` 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=20130905.141751.945639989861997124.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=azhou@nicira.com \
--cc=dev@openvswitch.org \
--cc=fengguan.wu@intel.com \
--cc=geert@linux-m68k.org \
--cc=jesse@nicira.com \
--cc=netdev@vger.kernel.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 NNTP newsgroup(s).