Bug 205533 - The flexcan/socketcan driver does not block and returns an error if all buffers are in use on transmit.
Summary: The flexcan/socketcan driver does not block and returns an error if all buffe...
Status: NEW
Alias: None
Product: Networking
Classification: Unclassified
Component: Other (show other bugs)
Hardware: ARM Linux
: P1 low
Assignee: Stephen Hemminger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-14 17:10 UTC by Brian Cody
Modified: 2019-11-14 17:10 UTC (History)
0 users

See Also:
Kernel Version: 4.14.149
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Brian Cody 2019-11-14 17:10:29 UTC
When the output buffer is saturated, even if the socket is set up for blocking use, a "write" to the CAN socket may result in a -1 return value with errno set to 105 (ENOBUFS).

The socket is created using socket(PF_CAN, SOCK_RAW, CAN_RAW). SO_SNDBUF is set to 2240. fcntl is used to disable O_NONBLOCK.

I see the error case after "many" sends. In this situation three separate processes are sharing the CAN bus on the local processor. The error only occurs when all processes are heavily using the bus (set at 1 MHz), and there does not appear to be a normal re-entrancy issue with the driver.

Note You need to log in before you can comment on or make changes to this bug.