Re: [PATCH v5 0/6] Add Fieldbus subsystem + support HMS Profinet card

From: Sven Van Asbroeck
Date: Thu Dec 06 2018 - 13:32:44 EST


Hi David, thank you for the feedback !

On Wed, Dec 5, 2018 at 9:05 PM David Lechner <david@xxxxxxxxxxxxxx> wrote:
>
> Does this actually need a new fieldbus subsystem or could it just be
> implemented as a new network protocol?
>
> Then this generic interface to a fieldbus device could just be a socket.
>

This is a fundamental question, and I'm glad we are having this discussion.

Caveat: I am by no means a Fieldbus expert. HMS Industrial Networks are. They
have recently become aware of this mainlining effort; but they are not Linux
focused. I really hope they will participate.

Fieldbus is a collection of network protocols for industrial networks.
The underlying network technology varies: e.g. Ethernet for Profinet, RS485
for Profibus, just to name a few.

The actual layout of the raw packets exchanged over the network is proprietary;
fieldbus cards will typically implement this internally, and hide the details.
Some fieldbus protocols have hard real-time requirements: the CPU inside a
fieldbus card will typically run an RTOS to satisfy these.

Could Profinet be added as a new network protocol? Leaving aside proprietary
and hard real-time concerns, the main issue is that cards implementing the
standard won't provide access to the raw packets.

As a result, the Fieldbus userspace API can only consist of whatever these cards
are willing to expose. This varies widely among implementations and fieldbus
protocols, but there are a few commonalities. For example, every fieldbus
card will expose 'process memory' which you can think of as shared memory
between a device and its controller (master).

The fieldbus subsystem proposed in this patch exposes a minimal set of
functionality that every fieldbus device is supposed to have. In many
instances, this won't even be enough to get the card to work. For example,
there is currently no way to provide initialization parameters. These vary
from setting the card network id, to configuring a built-in HTTP server
running inside the card (!!).

Linus Walleij suggested that the KVP nature of Netlink sockets might be a good
match for fieldbus initialization parameters. It sounds promising.
Yet when it comes to accessing shared memory, I cannot see how Netlink could
be of use?

It would be ideal if actual fieldbus experts could help shape this interface,
but I don't know of any that are willing to. One possible explanation is that
the fieldbus corporate environment may be a strong believer in proprietary
technologies.

Sven