[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160510.140643.1891656073031893382.davem@davemloft.net>
Date: Tue, 10 May 2016 14:06:43 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: Yuval.Mintz@...gic.com
Cc: netdev@...r.kernel.org, Ariel.Elior@...gic.com
Subject: Re: [PATCH net-next 01/14] qed: Add CONFIG_QED_SRIOV
From: Yuval Mintz <Yuval.Mintz@...gic.com>
Date: Tue, 10 May 2016 17:16:16 +0000
> I'm not entirely convinced this is true; If we'll not enforce the alignment
> of this 64-bit field, it's possible there will be differences between 32-bit
> and 64-bit machines versions of this struct.
> You have to recall that this is going to be copied via DMA between PF and VF,
> so they must have the exact same representation of the structure.
Then use properly sized types to fill in all the space in the
structure, that's how you guarantee layout, not aligned_u64. Also, do
not use the packed attribute.
struct foo {
u32 x;
u32 y;
u64 z;
};
'z' will always be 64-bit aligned.
Powered by blists - more mailing lists