[U-Boot] Driver model Ethernet issue

Simon Glass sjg at chromium.org
Thu Mar 26 04:10:50 CET 2015


Hi Joe,

I think moving the packet processing into the uclass was a good idea,
but I did not think it through.

If you look at the designware driver, when it receives a packet it
processes it and then retires that buffer for later reuse. The few
others I have looked at are similar.

We can't retire it in the recv() method since the packet is still
needed at that point, and may be overwritten by a new packet if we
retire its buffer space.

I am wondering if we should have a new method, like:

int free_pkt(struct udevice *dev, uchar *packet, int len)

which is called by the uclass after the packet is processed (assuming
that recv() returns a packet). It would pass the packet pointer and
length to the driver.

This would allow the driver to do what it needs to do.

What do you think? I'd like to figure this out and send v2 of the
sunxi Ethernet conversion.

Regards,
Simon


More information about the U-Boot mailing list