Re: Linux J1939: built in-kernel vs. user space stack?

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

 



On 6/26/19 9:35 AM, Marc Kleine-Budde wrote:
> Recently I started working with Van Hool, a Belgian touring car
> manufacturer that is using the J1939 stack for some of its intelligent
> devices.
> 
> I would like to introduce a test platform for internal application
> development. In search for a solution I discovered your major
> contribution to Linux for CAN and J1939.
> 
> As a pilot case, I merged your code to a recent Raspberry Pi kernel,
> which appears to be working fine at first glance.

Good to hear!

> Now I have a little question: why was the J1939 stack built into the
> kernel?

As soon as you use TP or ETP, there are timing requirements that you
have to meet, otherwise the connection breaks. Doing this in the kernel
is much easier. It also saves the overhead for the context switch
between the kernel and the user space for each CAN frame of a transfer.

Having the address claim cache in a central place is a good idea, too.

This all boils down to program j1939 in user space as similar to UDP as
possible.

> Do you think it would be an interesting contribution if I isolated
> the functionality in user space?

Why would you do that?

We, as the linux-can community, would only support the in-kernel-stack.

When it comes to licensing the stack is GPL-v2-only, as it's part of the
kernel and would have to stay under this license even in user space.
This means you can only link it to GPL-v2 compatible code anyways.

> That way we could test our application code along with the isolated
> J1939 stack on whatever CAN-enabled Linux platform is provided to us.

> Do you think this is a bad idea?

If you want help contributing to j1939 please make use of the stack,
provide your use cases. Or even better test cases. Or have a look at the
eclipse titan project for protocol testing. There is some CAN support,
but I never found time to really play with it.

regards,
Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

Attachment: signature.asc
Description: OpenPGP digital signature


[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