linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Erik Flodin <erik@flodin.me>
Cc: linux-can@vger.kernel.org
Subject: Re: [PATCH v2 1/2] can: add support for filtering own messages only
Date: Mon, 10 May 2021 14:28:34 +0200	[thread overview]
Message-ID: <64e37aae-e6b5-20aa-04fb-10b4a2f50b5e@hartkopp.net> (raw)
In-Reply-To: <CAAMKmocsZBsFfpRLyLHqFE94xb-xrm5S8YG=QzQTndDjtOyuzw@mail.gmail.com>



On 09.05.21 13:28, Erik Flodin wrote:
> On Thu, 6 May 2021 at 07:26, Oliver Hartkopp <socketcan@hartkopp.net> wrote:

>>>>    From what I understood your main requirement is to double check the
>>>> outgoing traffic whether is has been sent.
>>>
>>> What I would like to have is:
>>> 1. Be notified when a frame has been sent. I send (from user space) a
>>> single frame and wait until I get confirmation before sending the next
>>> to give other nodes on the bus a slot to start sending, even if their
>>> frames have ID with lower priority.
>>
>> o_O
>>
>> Sorry, but I have problems to get behind your use-case.
>>
>> 1. You are sending a frame
>> 2. You get a confirmation
>> 3. You are waiting some time (which is not written above), to give other
>> nodes a slot??
> 
> No explicit sleep is needed. The machine is sufficient slow so that
> just waiting for the confirmation before sending the next frame is
> enough. But if the frames are queued in the socket/device then the
> frames are sent back-to-back.

Ok, I feel I'm getting behind your requirement ...

You mainly want to throttle the outgoing traffic, to make sure that e.g. 
a specific CAN ID is not sent 'back-to'back' and might lead to a DoS 
situation on the wire?!?

Do you know about the Linux CAN queuing disciplines that might provide 
the solution to your question?

See:

http://rtime.felk.cvut.cz/can/

http://rtime.felk.cvut.cz/can/socketcan-qdisc-final.pdf


A four-slides-intro to the concept can be found here (slides 41ff):

https://wiki.automotivelinux.org/_media/agl-distro/agl2017-socketcan-print.pdf

Best,
Oliver

> 
>> 4. goto 1??
> 
> Yes.
> 
> // Erik
> 

  reply	other threads:[~2021-05-10 13:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04 20:35 [PATCH v2 0/2] can: Add CAN_RAW_RECV_OWN_MSGS_ALL socket option Erik Flodin
2021-05-04 20:35 ` [PATCH v2 1/2] can: add support for filtering own messages only Erik Flodin
2021-05-05  6:58   ` Oliver Hartkopp
2021-05-05  8:37     ` Erik Flodin
2021-05-05  9:15       ` Oliver Hartkopp
2021-05-05 18:54         ` Erik Flodin
2021-05-06  5:26           ` Oliver Hartkopp
2021-05-09 11:28             ` Erik Flodin
2021-05-10 12:28               ` Oliver Hartkopp [this message]
2021-05-16 20:02                 ` Erik Flodin
2021-05-17  7:36                   ` Oliver Hartkopp
2021-05-17 18:09                     ` Erik Flodin
2021-05-04 20:35 ` [PATCH v2 2/2] can: raw: add CAN_RAW_RECV_OWN_MSGS_ALL socket option Erik Flodin

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=64e37aae-e6b5-20aa-04fb-10b4a2f50b5e@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=erik@flodin.me \
    --cc=linux-can@vger.kernel.org \
    /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).