-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
socketcan sometimes not receiving frame send using isotpsend #113
Comments
Hm. In fact I was not able to reproduce your reported issue. Neither when invoking
nor when I put one or many of this sequence in a script. I always get
Have you ever tried |
I just tried isotpdump and it shows the same behavior as candump. Sometimes it happens immediately but sometimes I need to repeat it as many as over 100 times. EDIT: I was wrong about the specific frame dropping. It can be any frame. Also the behavior seem to change when you host another vcan |
Can you tell me, what kind of hardware you are using? |
I tested on a Win10 Notebook inside a VM with a i7-6920Q and a Arch Linux desktop PC with an i7-5830K |
I moved the wait check - can you try this patch? diff --git a/net/can/isotp.c b/net/can/isotp.c
@@ -956,6 +956,10 @@ static int isotp_sendmsg(struct kiocb *iocb, struct socket *sock,
|
` diff --git a/net/can/isotp.c b/net/can/isotp.c
@@ -956,6 +956,10 @@ static int isotp_sendmsg(struct kiocb *iocb, struct socket *sock,
` |
The patch doesn't show correctly for me (I think you need to put the patch in between three quotes each like this: ``` But I assume you just removed the line 940: if (so->tx.state == ISOTP_IDLE) wake_up_interruptible(&so->wait); after line 958 (after If that is correct it didn't help. I can't measure it but it may have even gotten worse. |
ok. That was the idea. Thanks for testing! |
I'm not able to reproduce the problem. Can you tell what Linux kernels you are using? (uname -a) |
My physical machine has 4.19.6 I can't really confirm but it seems to get worse on faster machines |
I've simplified the kernel version dependent stuff and also added the reserved skb space and some debug info in a branch for Linux 4.17+ |
I tested it with approximately 5000 message and every single one was received (with I switched back to I will do further tests next week but so far |
Thanks for testing! Even if I wasn't able to reproduce the problem, I assume this patch to be missing in <rev 20170725 alpha> : |
Since Linux 3.9 outgoing skbuffs with CAN frames contain a reserved area with CAN specific content which is not stored in common skbuff structures. The changes accidently have not been applied to the out-of-tree isotp.c . See GitHub issues: linux-can/can-utils#113 #12 Reported-by: https://github.com/hfn92 Reported-by: https://github.com/pylessard Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Closed due to applied fix hartkopp/can-isotp@3852256 |
Sporadically frames send using
isoptsend
seem to be not correctly received by applications using raw can sockets. I'm unsure whether this because ofisotpsend
, socketcan or simply because of misuse on my part.I was able to reproduce this on different machines using vcan like this:
candump -d -e -t a vcan0
Eventually a frame (always
50 01 FF FF FF FF FF
) will not show up (isoptsend
didn't fail)This does not just happen for this single
candump
instance. Every raw can socket misses this frame.Interestingly it will show up for
isotprecv
andisotpsniffer
Additionally I set up vcan1 and a gateway from vcan0 to vcan1. And vcan1 receives the frame.
Weirdly enough the
any
interface also receives the frame.To Sum up:
isotpsend
on vcan0isotp*
tools suchisotprecv
andisotpsniffer
receive everything correctlyany
receive the message (although they sometimes also drop other frames)Things I tried:
cansend
to send frames (never failed -> couldn't reproduce)The text was updated successfully, but these errors were encountered: