From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Marek Vasut <marex@denx.de>
Cc: Vostrikov Andrey <andrey.vostrikov@cogentembedded.com>,
Aleksander Morgado <aleksander@aleksander.es>,
Marc Kleine-Budde <mkl@pengutronix.de>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Wolfgang Grandegger <wg@grandegger.com>,
Andrew Lunn <andrew@lunn.ch>
Subject: Re: [RFC][PATCH] net: arinc429: Add ARINC-429 stack
Date: Wed, 04 Nov 2015 11:44:28 +0100 [thread overview]
Message-ID: <5639E18C.9030108@hartkopp.net> (raw)
In-Reply-To: <201511032241.09913.marex@denx.de>
Hi Marek,
On 03.11.2015 22:41, Marek Vasut wrote:
> On Tuesday, November 03, 2015 at 10:24:23 PM, Oliver Hartkopp wrote:
>> Comparing to typical ethernet frames with 1500 bytes the 16 bytes for CAN
>> frames or 72 bytes for CAN FD frames are already too small in relation to
>> the socket buffer overhead.
>>
>> If you want to improve the memory efficiency for arinc290 you should
>> probably consider to implement a character device based driver instead of
>> creating a new network protocol family.
>
> See discussion:
>
> http://comments.gmane.org/gmane.linux.kernel/1512019
>
> Which is why I picked the socket variant.
>
Oh. This provides a completely new perspective.
So far we just discussed about the 32 bit messages to be handled and filtered
by the kernel.
This could have been done by
1. A chardev interface driver
2. A netdev interface driver (drivers/net/arinc429/...) and using PF_PACKET
together with Berkley packet filtering (BPF)
3. A netdev interface driver (drivers/net/arinc429/...) and using PF_CAN which
would lead to a arinc data structure which needs to be struct can_frame
compatible.
But if you plan to implement the transport protocols (FTP/MAC) inside the
Linux kernel that have been discussed in the URL above this would be a real
difference to CAN related protocols. Only from that perspective a new protocol
family would make sense.
(..)
>> From what I've read so far there's also the sending of cyclic messages and
>> label filtering outside the HW - or why did you copy/paste the can_id/label
>> filter mechanism from af_can.c ?
>
> I think you might be mixing two people together here, I sent the patch and
> Andrey and Aleksander are working for some other interested company.
Sorry. Will try to bash only *you* in the future :-))
> The label filtering makes sense if you want to separate what you receive on
> which socket in userland, which allows an application to receive only relevant
> traffic.
ok.
>
> Hardware-accelerated filtering is another thing and at this point, we should
> not mix these two things. Does CAN framework have any such support for hardware
> assisted can_id filtering btw ?
>
No. We discussed about it. But the HW filter capabilities of CAN controllers
have a wide range of functionality. Most filters make only sense in ECUs that
pick specific CAN IDs for their functionality. It made no real sense to have
an administrative configuration interface that limits the view to the CAN bus
for the entire system. An we never had performance issues with the filtering
in the softirq context in af_can.c
>>> I'd prefer to have ARINC framework simple as it could be and separate
>>> from CAN, as these buses are not similar, besides desire to re-use
>>> SocketCAN interface/API to expose ARINC429 bus.
>>
>> Maybe you don't need that fancy stuff that comes with PF_CAN. Did you ever
>> thought about implementing a chardev driver for the ARINC429 hardware?
>> There are out-of-tree CAN drivers (e.g. can4linux or PEAK System Linux
>> driver) that handle the transfer of data structures (CAN frames) from/to
>> kernel space via character device. See an example at
>> https://en.wikipedia.org/wiki/Can4linux
>
> I guess I can answer that -- yes, I did, see above.
>
Ok - it seems to stick on the future plan whether it makes sense to implement
the FTP/MAC transport protocols inside the kernel or not.
What's your thought about that?
Regards,
Oliver
next prev parent reply other threads:[~2015-11-04 10:44 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-01 23:16 [RFC][PATCH] net: arinc429: Add ARINC-429 stack Marek Vasut
2015-11-02 9:47 ` Marc Kleine-Budde
2015-11-02 11:14 ` Oliver Hartkopp
2015-11-02 18:16 ` Marek Vasut
2015-11-02 20:15 ` Vostrikov Andrey
2015-11-02 20:25 ` Marek Vasut
2015-11-03 10:36 ` Aleksander Morgado
2015-11-03 11:36 ` Marc Kleine-Budde
2015-11-03 15:06 ` Aleksander Morgado
2015-11-03 15:15 ` Marc Kleine-Budde
2015-11-03 16:10 ` Aleksander Morgado
2015-11-03 17:32 ` Oliver Hartkopp
2015-11-03 17:41 ` Marek Vasut
2015-11-03 18:03 ` Oliver Hartkopp
2015-11-03 19:19 ` Marek Vasut
2015-11-03 19:28 ` Oliver Hartkopp
2015-11-03 21:43 ` Marek Vasut
2015-11-04 9:34 ` Aleksander Morgado
2015-11-04 13:54 ` Marek Vasut
2015-11-04 15:03 ` Vostrikov Andrey
2015-11-04 15:07 ` Marek Vasut
2015-11-04 15:18 ` Vostrikov Andrey
2015-11-04 15:19 ` Aleksander Morgado
2015-11-04 15:33 ` Marek Vasut
2015-11-04 15:45 ` Aleksander Morgado
2015-11-10 16:15 ` Marek Vasut
2015-11-18 16:38 ` Aleksander Morgado
2015-11-18 16:41 ` Marek Vasut
2015-11-03 20:26 ` Vostrikov Andrey
2015-11-03 21:24 ` Oliver Hartkopp
2015-11-03 21:41 ` Marek Vasut
2015-11-04 10:44 ` Oliver Hartkopp [this message]
2015-11-03 21:52 ` Vostrikov Andrey
2015-11-03 15:19 ` Marek Vasut
2015-11-03 16:18 ` Aleksander Morgado
2015-11-03 16:56 ` Aleksander Morgado
2015-11-03 17:33 ` Marek Vasut
2015-11-03 20:15 ` Vostrikov Andrey
2015-11-04 9:31 ` Aleksander Morgado
2015-11-03 16:47 ` Aleksander Morgado
2015-11-03 17:37 ` Marek Vasut
2015-11-03 17:01 ` Oliver Hartkopp
2015-11-04 9:51 ` Aleksander Morgado
2015-11-03 21:44 ` Marek Vasut
2015-11-02 19:41 ` Aleksander Morgado
2015-11-02 19:55 ` 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=5639E18C.9030108@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=aleksander@aleksander.es \
--cc=andrew@lunn.ch \
--cc=andrey.vostrikov@cogentembedded.com \
--cc=davem@davemloft.net \
--cc=marex@denx.de \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=wg@grandegger.com \
/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).