From: Andreas Werner <andreas.werner@men.de>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: Andreas Werner <andreas.werner@men.de>,
Wolfgang Grandegger <wg@grandegger.com>,
mkl@pengutronix.de, linux-can@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
davem@davemloft.net, jthumshirn@suse.de, andy@wernerandy.de,
michael.miehling@men.de
Subject: Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller driver
Date: Thu, 11 Aug 2016 09:14:59 +0200 [thread overview]
Message-ID: <20160811071458.GA25813@awelinux> (raw)
In-Reply-To: <a0169f54-c8c7-5cf6-b93b-acd4a308a052@hartkopp.net>
On Wed, Aug 10, 2016 at 10:28:45PM +0200, Oliver Hartkopp wrote:
> Hi Andreas,
>
> On 08/09/2016 08:10 AM, Andreas Werner wrote:
> >On Mon, Aug 08, 2016 at 04:35:34PM +0200, Wolfgang Grandegger wrote:
>
> >>>>>>You specify here one echo_skb but it's not used anywhere. Local loopback
> >>>>>>seems not to be implemented.
> >>>>>>
> >>>>>
> >>>>>Agree with you, will set it to "0".
> >>>>
> >>>>No, the local loopback is mandetory!
> >>>>
> >>>
> >>>Hm ok, but if i check alloc_candev() in drivers/net/can/dev.c
> >>>it is not mandatory.
>
> It is.
>
> Even those drivers that show up to use zero echo skbs in alloc_candev()
> implement the echo functionality correct.
>
> Just check 'git grep IFF_ECHO'. Even grcan.c and janz-ican3.c have IFF_ECHO
> set - but implement it in a different way without using the provided
> machanism from dev.c .
>
Ok I am with you.
> >>>In the Documentation/networking/can.txt
> >>>there is also a "should" and a fallback mechnism if the driver
> >>>does not support the local loopback.
>
> But this fallback mechanism is bad - really bad!
>
> E.g. the slcan.c driver sends a stream of CAN frames without knowing whether
> the frames ever hit the wire. The slcan driver is more less for hobby users.
> The CAN frame echo with IFF_ECHO gives a correct representation of the
> traffic on the wire - including the correct timestamps.
>
> You really want to know whether a CAN frame was sent correctly on the bus
> instead of getting some shortcut info from inside the network layer.
> .
Thanks for the explanation. I make it more clear why its mandatory.
> >>
> >>Well, s/driver/hardware/ ! Local loopback is the preferred mechanism.
> >>
> >
> >Sure...
> >
> >>>I'm currently ok with this fallback mechanism.
>
> /me not.
>
> >>>Anyway I am not sure that the driver can handle the echo skb correctly.
> >>>If i understand it correctly, the can_get_echo_skb() is normally called
> >>>on a "TX done IRQ" to get the skb and loop it back.
>
> ack.
>
> >>>I do not have such a "TX done IRQ" and have not implemented implemented
> >>>and added the local looback.
>
> I'm not really sure how grcan.c and janz-ican3.c implemented the echo
> functionality but they must have faced a similar situation.
>
I will check those driver to get more information about the implementation.
> A local loopback inside the CAN controller which is generated after
> successful transmit is an excellent implementation with excellent
> timestamps. The only problem for you is to detect the looped CAN frames and
> match them to the skb pointer of the outgoing frame to 'receive' the correct
> echo skb.
>
At the moment, i think there is no way to detect those looped frames.
I will talk to our IC designer and discuss this issue with him. Maybe we
have the possibility to get a local loopback inside the CAN controller.
This seems to be the best way to do it.
> When you send CAN frames to an unconnected CAN bus it can't be sent out due
> to the missing acknowledge from other nodes. So when you send frames and you
> get echo frames due to the fallback mode your cool CAN controller degrades
> to slcan level.
>
I agree with you. This is what we do not want to have.
> Regards,
> Oliver
>
> ps. Do you have any URL where one can get the MEN 16Z192 spec?
No sorry, its not available.
Regards
Andy
WARNING: multiple messages have this Message-ID (diff)
From: Andreas Werner <andreas.werner@men.de>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: Andreas Werner <andreas.werner@men.de>,
Wolfgang Grandegger <wg@grandegger.com>, <mkl@pengutronix.de>,
<linux-can@vger.kernel.org>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <davem@davemloft.net>,
<jthumshirn@suse.de>, <andy@wernerandy.de>,
<michael.miehling@men.de>
Subject: Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller driver
Date: Thu, 11 Aug 2016 09:14:59 +0200 [thread overview]
Message-ID: <20160811071458.GA25813@awelinux> (raw)
In-Reply-To: <a0169f54-c8c7-5cf6-b93b-acd4a308a052@hartkopp.net>
On Wed, Aug 10, 2016 at 10:28:45PM +0200, Oliver Hartkopp wrote:
> Hi Andreas,
>
> On 08/09/2016 08:10 AM, Andreas Werner wrote:
> >On Mon, Aug 08, 2016 at 04:35:34PM +0200, Wolfgang Grandegger wrote:
>
> >>>>>>You specify here one echo_skb but it's not used anywhere. Local loopback
> >>>>>>seems not to be implemented.
> >>>>>>
> >>>>>
> >>>>>Agree with you, will set it to "0".
> >>>>
> >>>>No, the local loopback is mandetory!
> >>>>
> >>>
> >>>Hm ok, but if i check alloc_candev() in drivers/net/can/dev.c
> >>>it is not mandatory.
>
> It is.
>
> Even those drivers that show up to use zero echo skbs in alloc_candev()
> implement the echo functionality correct.
>
> Just check 'git grep IFF_ECHO'. Even grcan.c and janz-ican3.c have IFF_ECHO
> set - but implement it in a different way without using the provided
> machanism from dev.c .
>
Ok I am with you.
> >>>In the Documentation/networking/can.txt
> >>>there is also a "should" and a fallback mechnism if the driver
> >>>does not support the local loopback.
>
> But this fallback mechanism is bad - really bad!
>
> E.g. the slcan.c driver sends a stream of CAN frames without knowing whether
> the frames ever hit the wire. The slcan driver is more less for hobby users.
> The CAN frame echo with IFF_ECHO gives a correct representation of the
> traffic on the wire - including the correct timestamps.
>
> You really want to know whether a CAN frame was sent correctly on the bus
> instead of getting some shortcut info from inside the network layer.
> .
Thanks for the explanation. I make it more clear why its mandatory.
> >>
> >>Well, s/driver/hardware/ ! Local loopback is the preferred mechanism.
> >>
> >
> >Sure...
> >
> >>>I'm currently ok with this fallback mechanism.
>
> /me not.
>
> >>>Anyway I am not sure that the driver can handle the echo skb correctly.
> >>>If i understand it correctly, the can_get_echo_skb() is normally called
> >>>on a "TX done IRQ" to get the skb and loop it back.
>
> ack.
>
> >>>I do not have such a "TX done IRQ" and have not implemented implemented
> >>>and added the local looback.
>
> I'm not really sure how grcan.c and janz-ican3.c implemented the echo
> functionality but they must have faced a similar situation.
>
I will check those driver to get more information about the implementation.
> A local loopback inside the CAN controller which is generated after
> successful transmit is an excellent implementation with excellent
> timestamps. The only problem for you is to detect the looped CAN frames and
> match them to the skb pointer of the outgoing frame to 'receive' the correct
> echo skb.
>
At the moment, i think there is no way to detect those looped frames.
I will talk to our IC designer and discuss this issue with him. Maybe we
have the possibility to get a local loopback inside the CAN controller.
This seems to be the best way to do it.
> When you send CAN frames to an unconnected CAN bus it can't be sent out due
> to the missing acknowledge from other nodes. So when you send frames and you
> get echo frames due to the fallback mode your cool CAN controller degrades
> to slcan level.
>
I agree with you. This is what we do not want to have.
> Regards,
> Oliver
>
> ps. Do you have any URL where one can get the MEN 16Z192 spec?
No sorry, its not available.
Regards
Andy
next prev parent reply other threads:[~2016-08-11 7:14 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-26 9:16 [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller driver Andreas Werner
2016-07-26 9:16 ` Andreas Werner
2016-08-08 3:58 ` Benjamin Poirier
2016-08-08 7:26 ` Andreas Werner
2016-08-08 7:26 ` Andreas Werner
2016-08-09 3:23 ` Benjamin Poirier
2016-08-09 6:11 ` Andreas Werner
2016-08-09 6:11 ` Andreas Werner
2016-08-08 9:27 ` Wolfgang Grandegger
2016-08-08 11:39 ` Andreas Werner
2016-08-08 11:39 ` Andreas Werner
2016-08-08 12:28 ` Wolfgang Grandegger
2016-08-08 13:06 ` Kurt Van Dijck
2016-08-08 14:12 ` Andreas Werner
2016-08-08 14:12 ` Andreas Werner
2016-08-08 14:05 ` Andreas Werner
2016-08-08 14:05 ` Andreas Werner
2016-08-08 14:35 ` Wolfgang Grandegger
2016-08-09 6:10 ` Andreas Werner
2016-08-09 6:10 ` Andreas Werner
2016-08-09 11:54 ` Wolfgang Grandegger
2016-08-10 20:28 ` Oliver Hartkopp
2016-08-11 7:14 ` Andreas Werner [this message]
2016-08-11 7:14 ` Andreas Werner
2016-08-11 8:45 ` Oliver Hartkopp
2016-08-11 8:58 ` Andreas Werner
2016-08-11 8:58 ` Andreas Werner
2016-08-11 11:46 ` Oliver Hartkopp
2016-08-09 9:35 ` Ramesh Shanmugasundaram
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=20160811071458.GA25813@awelinux \
--to=andreas.werner@men.de \
--cc=andy@wernerandy.de \
--cc=davem@davemloft.net \
--cc=jthumshirn@suse.de \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.miehling@men.de \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=socketcan@hartkopp.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.