netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Vitalii Demianets <vitas@nppfactor.kiev.ua>
Cc: Jay Vosburgh <fubar@us.ibm.com>,
	Andy Gospodarek <andy@greyhouse.net>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	netdev@vger.kernel.org, bonding-devel@lists.sourceforge.net
Subject: Re: [PATCH] bonding,llc: Fix structure sizeof incompatibility for some PDUs
Date: Thu, 12 May 2011 15:33:36 +0100	[thread overview]
Message-ID: <1305210816.5214.9.camel@bwh-desktop> (raw)
In-Reply-To: <201105121557.06679.vitas@nppfactor.kiev.ua>

On Thu, 2011-05-12 at 15:57 +0300, Vitalii Demianets wrote:
> With some combinations of arch/compiler the sizeof operator on structure 
> returns value greater than expected.

Yes, some architecture ABIs set a minimum alignment for structures so
they can have greater alignment than any of their members.

> In cases when the structure is used for 
> mapping PDU fields it may lead to unexpected results (e.g. holes and 
> alignment problems in skb data). Attribute "packed" prevents this undesired 
> behavior.
[...]

The '__packed' macro is preferred.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


  reply	other threads:[~2011-05-12 14:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-12 12:57 [PATCH] bonding,llc: Fix structure sizeof incompatibility for some PDUs Vitalii Demianets
2011-05-12 14:33 ` Ben Hutchings [this message]
2011-05-12 15:45   ` Vitalii Demianets
2011-05-12 15:52     ` Joe Perches
2011-05-12 16:02       ` Eric Dumazet
2011-05-12 16:10       ` Vitalii Demianets
2011-05-12 16:16         ` Joe Perches

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=1305210816.5214.9.camel@bwh-desktop \
    --to=bhutchings@solarflare.com \
    --cc=acme@ghostprotocols.net \
    --cc=andy@greyhouse.net \
    --cc=bonding-devel@lists.sourceforge.net \
    --cc=fubar@us.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=vitas@nppfactor.kiev.ua \
    /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).