Re: [EXT] Re: Introducing new Kernel Module for CAN over IP Networks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat. 27 Jul. 2024 at 12:17, Matthias Unterrainer
<matthias.unterrainer@xxxxxxxxxxxxxxxxxxxx> wrote:
> Hi Vincent,
>
> apologies for the late reply.

No problem. I am myself abroad until the end of August. My answers
will also be delayed.

> On 07-07-2024 17:23, Vincent Mailhol wrote:
> > Hi Matthias,
> >
> > On Fri. 5 Jul. 2024 at 02:47, Matthias Unterrainer
> > <matthias.unterrainer@xxxxxxxxxxxxxxxxxxxx> wrote:
> >> Hi Linux-CAN Community,
> >>
> >> my name is Matthias and I recently developed a kernel module during my Bachelor's thesis that allows for transferring CAN frames over IP networks, similar to userland tools like socketcand [0] or cannelloni [1].
> >>
> >> I wrote the thesis at dissecto GmbH [2], a german Startup that specializes in security diagnostics and analytics for embedded systems, primarily within the automotive industry.
> >>
> >> The idea behind the project is that dissecto has developed a hardware device that can be connected to a CAN bus and acts as an ethernet gateway to the bus. It is capable of capturing the CAN traffic along with the corresponding timestamps and send this data via UDP or it can receive CAN frames via UDP as well and pass them on to the CAN bus.
> >> This allows for remote interaction with a CAN bus, as well as an accurate analyses of CAN traffic, as packets contain precise time stamps.
> >>
> >> An architectural design decision was to develop it as kernel module because of lower latencies and high throughput.
> >
> > Question: did you consider Packet MMAP?
> >
> >    https://docs.kernel.org/networking/packet_mmap.html
> >
> > Most of the overhead comes from the syscall context switch between the
> > user and kernel land and Packet MMAP is exactly designed to bypass
> > this. Actually, a few months ago, I started to rewrite the can-utils's
> > candump to use Packet MMAP, but I never finished it.
>
> No, at the time I did not consider Packet MMAP. From my understanding
> Packet MMAP is used for userspace applications. But the module has to
> modify the timestamps of the CAN frames as they appear on the interface,
> which, as far as I know, is not possible from userspace.
> Please correct me if I am mistaken, but because of that I do not think
> Packet MMAP or any userspace application for that matter could actually
> be used here.

Can you explain this in more detail? The precise CAN timestamps are
all available from the user land. Some drivers even have the hardware
timestamps as generated by the device. Why do you need to *modify* the
timestamps?

> >> For example, my measurements show that the average time it takes a CAN frame to get processed by the module is just about 1/4 of the time it takes applications like socketcand or cannelloni.
> >>
> >> We have published the module on GitHub [3], and would appreciate your feedback and thoughts.
> >>
> >> If anyone is interested in this functionality for the same or similar use cases, please don't hesitate to contact us.
> >>
> >> Best regards
> >> Matthias Unterrainer





[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux