socketcan 的使用(一) can raw write: No buffer space available

Neal Probert wrote:
> I'm using PCAN-USB 6.7 with latest Socket-CAN from Subversion.
>
> Can anybody tell me what this means, and how to I get around it?
>
>     "write: No buffer space available"
>
> I don't get this with vcan0, but I do with can0.  Happens with cangen
> and my own application.
>  

Hi Neal,

when you try to write more data than the 'real' CAN hardware can put
onto the bus the tx-queue from the CAN netdevice simply runs over after
some time.

If you have only 'peak' load you may try to pump up the tx_queue_len of
'can0' in the sysfs:

echo 1000 > /sys/class/net/can0/tx_queue_len

But if your idea is to generate maximum load, you could ignore/handle
the -ENOBUF return value, wait an appropriate time (e.g. 500ns?) and
send your next CAN frame.

Regards,
Oliver

https://lists.berlios.de/pipermail/socketcan-users/2008-March/000297.html
posted @ 2011-05-24 19:20  夏大王  阅读(5034)  评论(0编辑  收藏  举报