linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [Socketcan-users] increase buffer size
  2012-01-24 12:01 ` Oliver Hartkopp
@ 2012-01-24 15:42   ` Steffen Rose
  2012-01-24 16:17     ` Oliver Hartkopp
  0 siblings, 1 reply; 4+ messages in thread
From: Steffen Rose @ 2012-01-24 15:42 UTC (permalink / raw)
  To: linux-can

Hello Oliver

Am Dienstag, 24. Januar 2012, 13:01:45 schrieb Oliver Hartkopp:
> ifconfig can0 txqueuelen 1000
> ip link set can0 txqueuelen 1000

You wrote, that this command do not change the socket quere, this command 
change the quere within the can adaptation. I hope, I understand this 
correctly.

Is there a dependency to a specific SocketCAN version? Especially I'm 
interested on embedded linux devices. Is the quere part of the common 
socketcan code or is it depend of the implementation?

-- 
Mit freundlichen Grüßen / Regards
Steffen Rose
www.emtas.de



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Socketcan-users] increase buffer size
  2012-01-24 15:42   ` [Socketcan-users] " Steffen Rose
@ 2012-01-24 16:17     ` Oliver Hartkopp
  0 siblings, 0 replies; 4+ messages in thread
From: Oliver Hartkopp @ 2012-01-24 16:17 UTC (permalink / raw)
  To: Steffen Rose; +Cc: linux-can

On 24.01.2012 16:42, Steffen Rose wrote:

> Hello Oliver
> 
> Am Dienstag, 24. Januar 2012, 13:01:45 schrieb Oliver Hartkopp:
>> ifconfig can0 txqueuelen 1000
>> ip link set can0 txqueuelen 1000
> 
> You wrote, that this command do not change the socket quere, this command 
> change the quere within the can adaptation. I hope, I understand this 
> correctly.


You have an amount of rx/tx buffersizes inside each socket.

You may refer to the  '-r' option of the candump tool which can modify the
socket rx buffer size.

But there is currently no quota for the socket tx buffer size, as the CAN
frames are put directly into the CAN netdevice queue (which can by modified
with the commands 'ip' and 'ifconfig').

> Is there a dependency to a specific SocketCAN version? Especially I'm 
> interested on embedded linux devices.


No. SocketCAN is the official CAN networking stack of Linux.
I also run it on a MPC5200 based embedded device.

> Is the quere part of the common 
> socketcan code or is it depend of the implementation?


The queue implementation is part of Linux' general network stack on which
SocketCAN bases.

Regards,
Oliver


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Socketcan-users] increase buffer size
       [not found] ` <2F0BDF8C-F6D0-4CCD-A08D-3D969B98BB02@t-online.de>
@ 2012-01-24 16:50   ` Steffen Rose
  2012-01-24 17:55     ` Oliver Hartkopp
  0 siblings, 1 reply; 4+ messages in thread
From: Steffen Rose @ 2012-01-24 16:50 UTC (permalink / raw)
  To: linux-can

Am Dienstag, 24. Januar 2012, 17:31:56 schrieb Heinz-Juergen Oertel:
> Von meinem iPhone gesendet
> 
> Am 24.01.2012 um 16:36 schrieb Steffen Rose <ro@emtas.de>:
> > 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
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Socketcan-users] increase buffer size
  2012-01-24 16:50   ` [Socketcan-users] increase buffer size Steffen Rose
@ 2012-01-24 17:55     ` Oliver Hartkopp
  0 siblings, 0 replies; 4+ messages in thread
From: Oliver Hartkopp @ 2012-01-24 17:55 UTC (permalink / raw)
  To: Steffen Rose; +Cc: linux-can

On 24.01.2012 17:50, Steffen Rose wrote:

> Am Dienstag, 24. Januar 2012, 17:31:56 schrieb Heinz-Juergen Oertel:
>> Von meinem iPhone gesendet
>>
>> Am 24.01.2012 um 16:36 schrieb Steffen Rose <ro@emtas.de>:
>>> 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.

> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-01-24 17:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <16594621.klnj3Hkir3@lisa>
     [not found] ` <2F0BDF8C-F6D0-4CCD-A08D-3D969B98BB02@t-online.de>
2012-01-24 16:50   ` [Socketcan-users] increase buffer size Steffen Rose
2012-01-24 17:55     ` Oliver Hartkopp
     [not found] <1567213.2GCzMlGyKY@lisa>
2012-01-24 12:01 ` Oliver Hartkopp
2012-01-24 15:42   ` [Socketcan-users] " Steffen Rose
2012-01-24 16:17     ` Oliver Hartkopp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).