lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 05 May 2014 04:15:57 -0700
From:	Hannes Frederic Sowa <hannes@...essinduktion.org>
To:	Lorenzo Colitti <lorenzo@...gle.com>, netdev@...r.kernel.org
Cc:	davem@...emloft.net, yoshifuji@...ux-ipv6.org,
	david.laight@...lab.com, eric.dumazet@...il.com
Subject: Re: [PATCH v6 1/2] net: ipv6: Unduplicate UDP, raw, and L2TP sendmsg

Hi!

On Fri, May 2, 2014, at 12:11, Lorenzo Colitti wrote:
> +
> +struct ip6_output_opts {
> +       int hlimit: 9;
> +       int tclass: 9;
> +       int dontfrag: 2;
> +       unsigned connected: 1;
> +       struct ipv6_txoptions *opt;
> +};

I don't think the bitfields are useful, they can cause more RMW cycles
and at least on 64-bit systems the structure does not shrink in size if
you instead just use s16 and bool types because of the padding needed
for the pointer. On 32-bit it does save 4 bytes on the stack, but I
don't think it is worth it.

If you put the pointer above the other members, newly added fields at
the bottom can eat into padding space instead of leaving padding holes
in it.

Greetings,

  Hannes
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists