Skip to contentSkip to conversation

socketcan receive queue too many frames

DISCUSSION du 2 participants 4 messages Mar 27, 2013 CAN network drivers

lore
Share & tools
lore

du

author
#0 lore raw

Hello, I'm using socketcan buffer ,
but i'm getting frames for tens of seconds even after I have open the CAN wire from the bus, In my application ,frame lost is not a problem since I'm using cyclic process data. I just want to make sure the frame is stopped just when I disconnect the cable.

What should I do ? How can I make receive buffer smaller?

#1 lore raw
Quoted 1 line · du

Hello, I'm using socketcan buffer ,

What is "socketcan buffer"?

Quoted 2 lines

but i'm getting frames for tens of seconds even after I have open the CAN wire from the bus, In my application ,frame lost is not a problem since I'm using

What kind of CAN frame do you get? Maybe error messages, due to the open bus?

Quoted 4 lines

cyclic process data. I just want to make sure the frame is stopped just when I disconnect the cable.

What should I do ? How can I make receive buffer smaller?

That will not solve your problem.

Marc

Signature · 4 lines
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   |
author
#2 lore raw
Quoted 1 line · Marc Kleine-Budde <mkl <at> pengutronix.de> writes:

What is "socketcan buffer"?

sorry ,I means socketcan only.

Quoted 4 lines

What kind of CAN frame do you get? Maybe error messages, due to the open bus?

It's not error message , just normal CAN data frames.

I thought it may has something to do with buffer.
If my application is not fast enough to read the frames in buffer,
I can still get frames even the bus is open, is it right?

#3 lore raw
Quoted 2 lines · du
Quoted 1 line

What is "socketcan buffer"?

sorry ,I means socketcan only.

:)

Quoted 3 lines
Quoted 2 lines

What kind of CAN frame do you get? Maybe error messages, due to the open bus?

It's not error message , just normal CAN data frames.

Okay.

Quoted 3 lines

I thought it may has something to do with buffer.
If my application is not fast enough to read the frames in buffer,
I can still get frames even the bus is open, is it right?

Yes, socketcan is designed not to drop any messages, but it will, if the rx-queue (between kernel and your apps) gets to lange. If you receive frames in your application 10 seconds after you disconnected the cable you have a serious design or performance problem (or both) in you system.

Marc

Signature · 4 lines
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   |