Re: [PATCH v4] Gigabit Ethernet driver of Topcliff PCH

From: David Miller
Date: Sat Sep 18 2010 - 02:08:52 EST


From: Masayuki Ohtake <masa-korg@xxxxxxxxxxxxxxx>
Date: Wed, 15 Sep 2010 22:36:09 +0900

> +struct pch_gbe_regs_mac_adr {
> + u32 high;
> + u32 low;
> +} __attribute__ ((packed));;
...
> +struct pch_gbe_regs {
...
> +} __attribute__ ((packed));
...
> +struct pch_gbe_rx_desc {
...
> +} __attribute__ ((packed));;
...
> +struct pch_gbe_tx_desc {
...
> +} __attribute__ ((packed));;

The packed attribute should not be necessary for any of these
datastructures, so unless you can prove they are needed please
remove the attribute tag.

Besides being unnecessary, it will make cpu access to these
descriptors extremely slow on risc cpus, as the compiler will
emit byte-at-a-time accesses for all members of the structure
larger than one byte.
--
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/