[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1354072411.14302.46.camel@edumazet-glaptop>
Date: Tue, 27 Nov 2012 19:13:31 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Ben Hutchings <bhutchings@...arflare.com>
Cc: David Miller <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>,
Ling Ma <ling.ma.program@...il.com>
Subject: Re: [PATCH net-next] net: move inet_dport/inet_num in sock_common
On Tue, 2012-11-27 at 13:23 -0800, Eric Dumazet wrote:
> On Tue, 2012-11-27 at 19:05 +0000, Ben Hutchings wrote:
> > On Tue, 2012-11-27 at 07:06 -0800, Eric Dumazet wrote:
>
> > > struct sock_common {
> > > - /* skc_daddr and skc_rcv_saddr must be grouped :
> > > - * cf INET_MATCH() and INET_TW_MATCH()
> > > + /* skc_daddr and skc_rcv_saddr must be grouped on a 8 bytes aligned
> > > + * address on 64bit arches : cf INET_MATCH() and INET_TW_MATCH()
> >
> > __aligned(8)?
>
> Nope, only on 64 bit this requirement exists (since a long time)
>
> I am not sure we want complexity on this.
>
> And we dont want holes to be automatically added here neither.
Hmm, maybe the following could be the right way, as we did
for skc_hash/skc_u16hashes
struct sock_common {
- /* skc_daddr and skc_rcv_saddr must be grouped :
- * cf INET_MATCH() and INET_TW_MATCH()
+ /* skc_daddr and skc_rcv_saddr must be grouped on a 8 bytes aligned
+ * address on 64bit arches : cf INET_MATCH() and INET_TW_MATCH()
*/
- __be32 skc_daddr;
- __be32 skc_rcv_saddr;
-
+ union {
+ unsigned long skc_laddr;
+ struct {
+ __be32 skc_daddr;
+ __be32 skc_rcv_saddr;
+ };
+ };
union {
unsigned int skc_hash;
__u16 skc_u16hashes[2];
};
+ /* skc_dport && skc_num must be grouped as well */
+ union {
+ unsigned int skc_ports;
+ struct {
+ __be16 skc_dport;
+ __u16 skc_num;
+ };
+ };
+
unsigned short skc_family;
volatile unsigned char skc_state;
unsigned char skc_reuse;
--
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