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

https://www.cnblogs.com/fly-fish/archive/2011/05/24/2055879.html

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

1、查看

root@socfpga:/sys/class/net/can0# cat tx_queue_len

10


2、root@socfpga:/sys/class/net/can0# echo 4096 > tx_queue_len

3、root@socfpga:/sys/class/net/can0# cat tx_queue_len
4096


4、再运行程序
————————————————

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值