Skip to contentSkip to conversation

increase buffer size

Socketcan-users Steffen Rose 2 participants 2 messages Jan 24, 2012 2 messages not in the archive CAN network drivers

lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive

Am Dienstag, 24. Januar 2012, 17:31:56 schrieb Heinz-Juergen Oertel:

Quoted 6 lines

Von meinem iPhone gesendet

Am 24.01.2012 um 16:36 schrieb Steffen Rose <[email protected]>:

Quoted 1 line

Du liest sicher mit...

Ja, werde trotzdem nicht schlau wer die Puffer, bes. RX verwaltet.

Wenn Du mich fragts:

RX Buffer: Hier wird die Socket Quere genutzt.
TX Buffer: Hierfür ist der CAN Treiber verantwortlich. Die Socket Quere könnte genutzt werden, wird aber typ. nicht genutzt.

bye
Steffen

#3 lore raw
Quoted 11 lines · Steffen Rose

Am Dienstag, 24. Januar 2012, 17:31:56 schrieb Heinz-Juergen Oertel:

Quoted 6 lines

Von meinem iPhone gesendet

Am 24.01.2012 um 16:36 schrieb Steffen Rose <[email protected]>:

Quoted 1 line

Du liest sicher mit...

Ja, werde trotzdem nicht schlau wer die Puffer, bes. RX verwaltet.

Wenn Du mich fragts:

RX Buffer: Hier wird die Socket Quere genutzt.

Yes. When a CAN frame is received the frame is delivered to the per-socket receive queue due to the socket specific selected filter (default: receive everything from the given CAN netdevice). See can.txt

http://lxr.linux.no/#linux+v3.2.1/Documentation/networking/can.txt#L245

and for the filters:

http://lxr.linux.no/#linux+v3.2.1/Documentation/networking/can.txt#L377

You can play with the filters using 'candump' that allows to set up multiple filters.

Quoted 2 lines

TX Buffer: Hierfür ist der CAN Treiber verantwortlich. Die Socket Quere könnte genutzt werden, wird aber typ. nicht genutzt.

Writing to a CAN_RAW socket leads directly to the can_send() function that put's the CAN frame to the CAN netdevice specific tx queue.

See:

http://lxr.linux.no/#linux+v3.2.1/net/can/raw.c#L640

http://lxr.linux.no/#linux+v3.2.1/net/can/raw.c#L690

If there's space in the queue it is stored into the FIFO. If the tx queue is full, you directly get an error for the write() or send[msg]() system call.

http://lxr.linux.no/#linux+v3.2.1/net/can/af_can.c#L209

Regards,
Oliver