Re: Net: ucc_geth ethernet driver optimization space

From: Li Yang
Date: Wed May 27 2009 - 06:36:29 EST

On Wed, May 27, 2009 at 1:08 PM, Liu Dave-R63238 <DaveLiu@xxxxxxxxxxxxx> wrote:
> Guys,
> The ucc_geth ethernet driver have dozens of strong sync read/write
> operation, such as in_be32/16/8, out_be32/16/8.
> all of them is sync read/write, it is very expensive for performance.

Totally agree. That's one of my concerns right from the beginning.

> For the critical patch, we can remove some unnecessary in_be(x),
> out_be(x) with normal memory operation, and keep some necessary
> memory barrier.
> eg: BD access in the interrupt handler and start_xmit.
> The BD operation only need the memory barrier between length/buffer
> and status.
> struct buffer descriptor {
> Â Â Â Âu16 status;
> Â Â Â Âu16 length;
> Â Â Â Âu32 buffer;
> } __attribute__ ((packed));
> struct buffer descriptor *BD;
> BD->length = xxxx;
> BD->buffer = yyyy;
> wmb();
> BD->status = zzzz;

The BD can reside either in memory or memory mapped region, which
makes the case more complex.

MMIO accesses need to use IO accessors for the sparse checking. We
might make use of the __raw_*() accessors, but I'm not sure if it's
suitable for non-PCI buses on powerpc. And also we need to pay
special attention to the problem described here:

- Leo
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at