Thread (22 messages) 22 messages, 6 authors, 2011-09-27

Re: [PATCH net-next] tcp: unalias tcp_skb_cb flags and ip_dsfield

flat view

From: Eric Dumazet <hidden>
Date: 2011-09-27 09:23:19

Le mardi 27 septembre 2011 à 11:38 +0300, Christoph Paasch a écrit :
On Tuesday 27 September 2011 wrote David Miller:
quoted
From: Christoph Paasch <redacted>
Date: Tue, 27 Sep 2011 10:37:38 +0300
quoted
However, (as far as I can see) before Eric's change it was 42 bytes long
and now it became 43 bytes.
Then, I suggest that you go buy a pair of glasses. :-)
Yeah, maybe it's time to... ;-)

This two-byte hole, is it because "flags" and "sacked" are both __u8 and 
fields are aligned to 32-bit ?
Not exactly.

Reason for the hole is the following :

struct whatever {
	u8   first;
	u8   second;
	u32  third;
};

"third" field has an alignement requirement of 4 bytes on most arches.

Compiler inserts a 2 bytes hole before "third" to respect this
requirement.

There is no hole between "first" and "second", since second has no
alignment requirement.

sizeof(struct whatever) = 8
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help