Re: [PATCH] UDPCP Communication Protocol

From: Stephen Hemminger
Date: Fri Dec 31 2010 - 12:46:51 EST


On Fri, 31 Dec 2010 10:29:45 +0100
stefani@xxxxxxxxxxx wrote:

> +struct __attribute__ ((packed)) udpcphdr {
> + struct udphdr udphdr;
> + __be32 chksum;
> + __be16 msginfo;
> + u8 fragamount;
> + u8 fragnum;
> + __be16 msgid;
> + __be16 length;
> +};

Adding (unnecessary) packed attribute will make access slow on
some architectures. For arch that can't do unaligned access, the
compiler ends up doing byte access for each element.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/