[ovs-dev] [PATCH] datapath: Fix unaligned access when storing stats.

Jesse Gross jesse at nicira.com
Fri Nov 18 13:39:37 PST 2011


On Fri, Nov 18, 2011 at 1:36 PM, Ben Pfaff <blp at nicira.com> wrote:
> On Fri, Nov 18, 2011 at 11:08:08AM -0800, Jesse Gross wrote:
>> Both datapath and vport stats contain 64-bit members in a struct
>> but we write them directly in Netlink attributes which only
>> guarantee 32-bit alignment.  This causes problems on RISC
>> architectures that care about alignment so this computes the stats
>> on the stack and then memcpy's them.
>>
>> Signed-off-by: Jesse Gross <jesse at nicira.com>
>
> I think that it only causes performance problems.  The network stack
> doesn't worry about unaligned accesses in cases where the unaligned
> accesses are rare.

I thought that as well but it doesn't appear to be the case for
accesses in process context: on SPARC this was filling the kernel log
with error messages and killing ovs-vswitchd.

> Acked-by: Ben Pfaff <blp at nicira.com>

Thanks, I pushed this.



More information about the dev mailing list