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

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

 



Philip Craig wrote:
> Patrick McHardy wrote:
>> Thanks for tracking this down, I didn't realize we had holes
>> in struct nf_conntrack_tuple on ARM. There are two ways to
>> fix this, one is two remove the padding, the other one is to
>> clear the padding as you did. We could join all the tuple
>> structs to avoid padding, but unfortunately that probably
>> won't help because the port structs are also padded. Maybe
>> attribute(packed) on the individual port structs within the
>> union will work, I'm not sure about that.
> 
> I prefer to remove the padding so that we don't change how other
> architectures work.  The attached patch does this.  I'm not sure
> if this has any performance penalties on ARM. 

I just noticed that IP_CT_TUPLE_U_BLANK() memsets the addresses too
now (the comment before it is outdated).  There are only two lots
of 2 bytes it doesn't memset, which hardly seems worth it, and it
may even be slower on some architectures.  So the simpler fix is
to memset the whole structure.

It still might be nice to eliminate the padding on ARM to save
memory though: it adds 8 bytes per tuple.

Thoughts?

--
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