hvconsole.c : possible problem

Hollis Blanchard hollisb at us.ibm.com
Sat May 1 04:11:21 EST 2004

On Apr 28, 2004, at 5:24 PM, Benjamin Herrenschmidt wrote:
> Ah, we always ask for 16 bytes... that I didn't get. Ok, then yes, use
> a static 16 bytes buffer, and then move data from there to packets and
> leave data in there if you have no packet available. The overflow logic
> is dodgy, you should be able to do a single nice loop.

One more problem: let's say we have three of the four ring descriptors
filled already. Then we do a read, and get three packets in 16 bytes.
Then we have nowhere to put the remaining two.

This could happen regardless of the size of the ring... I see only two
- only do the read if three descriptors are available. Actually
technically four, since we can fit the first byte of the fourth packet
in a single read. I think we'd need to at least double the size of the
ring in this case (adding another 1KB to BSS). Seems like a waste.
- kmalloc ring descriptors as needed (264 bytes each). At least adding
some complexity. Sigh.

Hollis Blanchard
IBM Linux Technology Center

** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/

More information about the Linuxppc64-dev mailing list