On 10/08/2012 12:16 PM, Steffen Rose wrote: > Hello, > I'm unsure, what I see. > > I use: > Virtual box - Host Win 7/Guest kubuntu > Linux lisa 3.2.0-30-generic #48-Ubuntu SMP Fri Aug 24 16:52:48 UTC 2012 x86_64 > x86_64 x86_64 GNU/Linux > > SocketCAN connector is a EMS CPC-USB. > > On startup, the network works fine. > In different situation one or both directions (RX/TX) stop it's work. > My Linux program say: > > write: No buffer space available > > It's the write to the socketcan device can0. Your program probably produces CAN frames faster than they could be delivered by your CAN hardware. Your choices are: 1) If the write/sendto system call returns with -ENOBUFS, add the filedesciptor to poll/select and wait for it to be writeable again. For some known, but not yet resolved reasons (a.k.a. bug), the poll/select will return immediately, but the write will fail again. To workaround this usleep for some milliseconds between the write/sendto and the poll/select system call. 2) Increase txqueue length to 10000 or so. (ifconfig can0 txqueuelen 10000) This avoids to trigger the above bug and your write/sendto will block until the queues are free again and your CAN frame will added to the send queue. With this workaround poll/select work as expected, i.e. when they return the socket is writeable without problems. Hope that helps, Marc -- Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |