Re: [NETFILTER 42/69]: nf_conntrack: optimize hash_conntrack()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Philip Craig <philipc@xxxxxxxxxxxx>
Date: Tue, 29 Apr 2008 16:50:56 +1000

> David Miller wrote:
> >> eg what does it do for this:
> >> 	struct t {
> >> 		struct s {
> >> 			u16 a;
> >> 			u16 b;
> >> 		} __attribute__(packed);
> >> 	};
> > 
> > 'a' and 'b' cannot be assumed to be aligned in any particular way,
> > and thus byte-at-a-time accesses will be made to them.
> 
> Does it ever do anything besides byte access for words on sparc?
> 
> Here's my results on ARM, which show that including the packed
> struct in another struct allows gcc to assume alignment.
> I'm not saying this results in pretty code though :-)

Sure, the packed doesn't get inherited by the struct the
sub-struct is in.

But it still means the bit marked packed is going to be
accessed using byte-at-a-time loads and stores.

I guess this is immaterial, as it seems the memset() is the
best solution anyways.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux