linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Steffen Rose <ro@emtas.de>
Cc: linux-can@vger.kernel.org
Subject: Re: [Socketcan-users] increase buffer size
Date: Tue, 24 Jan 2012 18:55:40 +0100	[thread overview]
Message-ID: <4F1EF09C.8050206@hartkopp.net> (raw)
In-Reply-To: <5532811.lHVu6H1glq@lisa>

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

  reply	other threads:[~2012-01-24 17:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
     [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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F1EF09C.8050206@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=linux-can@vger.kernel.org \
    --cc=ro@emtas.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).